Class: ActiveMerchant::Billing::BarclaysEpdqGateway
- Defined in:
- lib/active_merchant/billing/gateways/barclays_epdq.rb
Defined Under Namespace
Constant Summary
Constants inherited from Gateway
Gateway::CREDIT_DEPRECATION_MESSAGE, Gateway::CURRENCIES_WITHOUT_FRACTIONS, Gateway::DEBIT_CARDS, Gateway::RECURRING_DEPRECATION_MESSAGE, Gateway::STANDARD_ERROR_CODE
Instance Attribute Summary
Attributes inherited from Gateway
Instance Method Summary collapse
- #authorize(money, creditcard, options = {}) ⇒ Object
-
#capture(money, authorization, options = {}) ⇒ Object
authorization is your unique order ID, not the authorization code returned by ePDQ.
-
#credit(money, creditcard_or_authorization, options = {}) ⇒ Object
authorization is your unique order ID, not the authorization code returned by ePDQ.
-
#initialize(options = {}) ⇒ BarclaysEpdqGateway
constructor
A new instance of BarclaysEpdqGateway.
- #purchase(money, creditcard, options = {}) ⇒ Object
- #refund(money, authorization, options = {}) ⇒ Object
- #void(authorization, options = {}) ⇒ Object
Methods inherited from Gateway
#card_brand, card_brand, #generate_unique_id, inherited, non_fractional_currency?, #scrub, supported_countries, #supported_countries, supported_countries=, supports?, #supports_network_tokenization?, #supports_scrubbing?, #test?
Methods included from CreditCardFormatting
Methods included from PostsData
included, #raw_ssl_request, #ssl_get, #ssl_post, #ssl_request
Constructor Details
#initialize(options = {}) ⇒ BarclaysEpdqGateway
Returns a new instance of BarclaysEpdqGateway.
14 15 16 17 |
# File 'lib/active_merchant/billing/gateways/barclays_epdq.rb', line 14 def initialize( = {}) requires!(, :login, :password, :client_id) super end |
Instance Method Details
#authorize(money, creditcard, options = {}) ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/active_merchant/billing/gateways/barclays_epdq.rb', line 19 def (money, creditcard, = {}) document = Document.new(self, @options) do add_order_form([:order_id]) do add_consumer() do add_creditcard(creditcard) end add_transaction(:PreAuth, money) end end commit(document) end |
#capture(money, authorization, options = {}) ⇒ Object
authorization is your unique order ID, not the authorization code returned by ePDQ
52 53 54 55 56 57 58 59 60 |
# File 'lib/active_merchant/billing/gateways/barclays_epdq.rb', line 52 def capture(money, , = {}) document = Document.new(self, @options) do add_order_form() do add_transaction(:PostAuth, money) end end commit(document) end |
#credit(money, creditcard_or_authorization, options = {}) ⇒ Object
authorization is your unique order ID, not the authorization code returned by ePDQ
64 65 66 67 68 69 70 71 |
# File 'lib/active_merchant/billing/gateways/barclays_epdq.rb', line 64 def credit(money, , = {}) if .is_a?(String) ActiveMerchant.deprecated CREDIT_DEPRECATION_MESSAGE refund(money, , ) else credit_new_order(money, , ) end end |
#purchase(money, creditcard, options = {}) ⇒ Object
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/active_merchant/billing/gateways/barclays_epdq.rb', line 32 def purchase(money, creditcard, = {}) # disable fraud checks if this is a repeat order: if [:payment_number] && ([:payment_number] > 1) no_fraud = true else no_fraud = [:no_fraud] end document = Document.new(self, @options, :no_fraud => no_fraud) do add_order_form([:order_id], [:group_id]) do add_consumer() do add_creditcard(creditcard) end add_transaction(:Auth, money, ) end end commit(document) end |
#refund(money, authorization, options = {}) ⇒ Object
73 74 75 |
# File 'lib/active_merchant/billing/gateways/barclays_epdq.rb', line 73 def refund(money, , = {}) credit_existing_order(money, , ) end |