Class: Workarea::Payment::Authorize::Paypal

Inherits:
Object
  • Object
show all
Includes:
CreditCardOperation, OperationImplementation
Defined in:
app/models/workarea/payment/authorize/paypal.rb

Instance Method Summary collapse

Instance Method Details

#cancel!Object



21
22
23
24
25
26
27
# File 'app/models/workarea/payment/authorize/paypal.rb', line 21

def cancel!
  return unless transaction.success?

  transaction.cancellation = handle_active_merchant_errors do
    gateway.void(transaction.response.params['transaction_id'])
  end
end

#complete!Object



10
11
12
13
14
15
16
17
18
19
# File 'app/models/workarea/payment/authorize/paypal.rb', line 10

def complete!
  transaction.response = handle_active_merchant_errors do
    gateway.authorize(
      transaction.amount.cents,
      token: tender.token,
      payer_id: tender.payer_id,
      currency: transaction.amount.currency
    )
  end
end