Skip to content

Instantly share code, notes, and snippets.

@philiplambok
Last active February 24, 2021 02:50
Show Gist options
  • Select an option

  • Save philiplambok/7b2d579b75b6828131012fbe80e171a7 to your computer and use it in GitHub Desktop.

Select an option

Save philiplambok/7b2d579b75b6828131012fbe80e171a7 to your computer and use it in GitHub Desktop.
# lib/credit_card__payment_payload.rb
class CreditCardPaymentPayload 
  def initialize(payment)
  end
  
  def record
  end

  def to_json
  end
end

# lib/virtual_account__payment_payload.rb
class VirtualAccountPaymentPayload
  def initialize(payment)
  end
  
  def record
  end

  def to_json
  end
end


# app/services/payments_services/send_callback_to_service.rb
class SendPaymentCallbackToService
  def initialize(service:, payload:)
  end

  def call
    Faraday.post(service.url, payload.to_json)
    create_callback_record(payload.record)
  end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment