Class: PaymobRuby::PayCard

Inherits:
ApplicationService show all
Defined in:
lib/paymob_ruby/api/pay_card.rb

Instance Method Summary collapse

Methods inherited from ApplicationService

call, #failure, #success

Instance Method Details

#call(user:, amount:, integration_id:, iframe_id:, commission_fees: 0) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/paymob_ruby/api/pay_card.rb', line 3

def call(user:, amount:, integration_id:, iframe_id:, commission_fees: 0)
  @iframe_id = iframe_id
  result = PaymobRuby::PaymentToken.call(
    integration_id:,
    user:,
    amount:,
    commission_fees:
  ).payload
  @payment_token = result[:payment_token]

  valid_url?

  success({ payment_link: }.merge(result))
end