Class: FlexCommerce::PaypalExpress::Auth

Inherits:
Object
  • Object
show all
Includes:
Api, Retry
Defined in:
lib/paypal_express/auth.rb

Overview

This service authorises the payment via the Paypal gateway

Constant Summary collapse

DEFAULT_CURRENCY =
"GBP"

Constants included from Api

FlexCommerce::PaypalExpress::Api::USER_ERRORS

Constants included from Retry

Retry::DEFAULT_MAX_NO_OF_RETRIES, Retry::DEFAULT_RESCUE_ERRORS

Instance Method Summary collapse

Methods included from Retry

call

Constructor Details

#initialize(cart:, token:, payer_id:, payment_transaction:, gateway_class: ::ActiveMerchant::Billing::PaypalExpressGateway) ⇒ Auth

Returns a new instance of Auth.

Parameters:

  • token (String)
    • Paypal token

  • payer_id (String)
    • Paypal user id



21
22
23
24
25
26
27
# File 'lib/paypal_express/auth.rb', line 21

def initialize(cart:, token:, payer_id:, payment_transaction:, gateway_class: ::ActiveMerchant::Billing::PaypalExpressGateway)
  self.cart = cart
  self.token = token
  self.payer_id = payer_id
  self.payment_transaction = payment_transaction
  self.gateway_class = gateway_class
end

Instance Method Details

#callObject



29
30
31
# File 'lib/paypal_express/auth.rb', line 29

def call
  process_with_gateway
end