Class: ActiveMerchant::Billing::BarclaysEpdqGateway
- Defined in:
- lib/active_merchant/billing/gateways/barclays_epdq.rb
Defined Under Namespace
Constant Summary collapse
- TEST_URL =
'https://secure2.mde.epdq.co.uk:11500'
- LIVE_URL =
'https://secure2.epdq.co.uk:11500'
Constants inherited from Gateway
Gateway::CREDIT_DEPRECATION_MESSAGE, Gateway::CURRENCIES_WITHOUT_FRACTIONS, Gateway::DEBIT_CARDS
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, inherited, supports?, #test?
Methods included from CreditCardFormatting
Constructor Details
#initialize(options = {}) ⇒ BarclaysEpdqGateway
Returns a new instance of BarclaysEpdqGateway.
14 15 16 17 18 |
# File 'lib/active_merchant/billing/gateways/barclays_epdq.rb', line 14 def initialize( = {}) requires!(, :login, :password, :client_id) @options = super end |
Instance Method Details
#authorize(money, creditcard, options = {}) ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/active_merchant/billing/gateways/barclays_epdq.rb', line 20 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
53 54 55 56 57 58 59 60 61 |
# File 'lib/active_merchant/billing/gateways/barclays_epdq.rb', line 53 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
65 66 67 68 69 70 71 72 |
# File 'lib/active_merchant/billing/gateways/barclays_epdq.rb', line 65 def credit(money, , = {}) if .is_a?(String) deprecated CREDIT_DEPRECATION_MESSAGE refund(money, , ) else credit_new_order(money, , ) end end |
#purchase(money, creditcard, options = {}) ⇒ Object
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/active_merchant/billing/gateways/barclays_epdq.rb', line 33 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
74 75 76 |
# File 'lib/active_merchant/billing/gateways/barclays_epdq.rb', line 74 def refund(money, , = {}) credit_existing_order(money, , ) end |