Class: ActiveMerchant::Billing::PaypalGateway

Inherits:
Gateway
  • Object
show all
Includes:
PaypalCommonAPI
Defined in:
lib/active_merchant/billing/gateways/paypal.rb

Constant Summary

Constants included from PaypalCommonAPI

ActiveMerchant::Billing::PaypalCommonAPI::API_VERSION, ActiveMerchant::Billing::PaypalCommonAPI::AUSTRALIAN_STATES, ActiveMerchant::Billing::PaypalCommonAPI::CREDENTIALS_NAMESPACES, ActiveMerchant::Billing::PaypalCommonAPI::EBAY_NAMESPACE, ActiveMerchant::Billing::PaypalCommonAPI::ENVELOPE_NAMESPACES, ActiveMerchant::Billing::PaypalCommonAPI::PAYPAL_NAMESPACE, ActiveMerchant::Billing::PaypalCommonAPI::SUCCESS_CODES, ActiveMerchant::Billing::PaypalCommonAPI::URLS

Constants inherited from Gateway

Gateway::DEBIT_CARDS

Constants included from PostsData

PostsData::MAX_RETRIES, PostsData::OPEN_TIMEOUT, PostsData::READ_TIMEOUT

Instance Attribute Summary

Attributes inherited from Gateway

#options

Instance Method Summary collapse

Methods included from PaypalCommonAPI

#capture, #credit, included, #initialize, #reauthorize, #test?, #transfer, #void

Methods inherited from Gateway

inherited, #initialize, supports?, #test?

Methods included from Utils

generate_unique_id

Methods included from CreditCardFormatting

#format

Methods included from RequiresParameters

#requires!

Methods included from PostsData

included, #retry_exceptions, #ssl_post

Instance Method Details

#authorize(money, credit_card, options = {}) ⇒ Object



14
15
16
17
# File 'lib/active_merchant/billing/gateways/paypal.rb', line 14

def authorize(money, credit_card, options = {})
  requires!(options, :ip)
  commit 'DoDirectPayment', build_sale_or_authorization_request('Authorization', money, credit_card, options)
end

#expressObject



24
25
26
# File 'lib/active_merchant/billing/gateways/paypal.rb', line 24

def express
  @express ||= PaypalExpressGateway.new(@options)
end

#purchase(money, credit_card, options = {}) ⇒ Object



19
20
21
22
# File 'lib/active_merchant/billing/gateways/paypal.rb', line 19

def purchase(money, credit_card, options = {})
  requires!(options, :ip)
  commit 'DoDirectPayment', build_sale_or_authorization_request('Sale', money, credit_card, options)
end