Class: ActiveMerchant::Billing::WirecardGateway
- Defined in:
- lib/active_merchant/billing/gateways/wirecard.rb
Constant Summary collapse
- ENVELOPE_NAMESPACES =
The Namespaces are not really needed, because it just tells the System, that there’s actually no namespace used. It’s just specified here for completeness.
{ 'xmlns:xsi' => 'http://www.w3.org/1999/XMLSchema-instance', 'xsi:noNamespaceSchemaLocation' => 'wirecard.xsd' }
- PERMITTED_TRANSACTIONS =
%w[ AUTHORIZATION CAPTURE_AUTHORIZATION PURCHASE ]
- RETURN_CODES =
%w[ ACK NOK ]
- VALID_PHONE_FORMAT =
Wirecard only allows phone numbers with a format like this: +xxx(yyy)zzz-zzzz-ppp, where:
xxx = Country code yyy = Area or city code zzz-zzzz = Local number ppp = PBX extension
For example, a typical U.S. or Canadian number would be “+1(202)555-1234-739” indicating PBX extension 739 at phone number 5551234 within area code 202 (country code 1).
/\+\d{1,3}(\(?\d{3}\)?)?\d{3}-\d{4}-\d{3}/
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
Authorization.
-
#capture(money, authorization, options = {}) ⇒ Object
Capture Authorization.
-
#initialize(options = {}) ⇒ WirecardGateway
constructor
A new instance of WirecardGateway.
-
#purchase(money, creditcard, options = {}) ⇒ Object
Purchase.
-
#test? ⇒ Boolean
Should run against the test servers or not?.
Methods inherited from Gateway
#card_brand, card_brand, inherited, supports?
Methods included from CreditCardFormatting
Constructor Details
#initialize(options = {}) ⇒ WirecardGateway
Returns a new instance of WirecardGateway.
55 56 57 58 59 60 61 62 |
# File 'lib/active_merchant/billing/gateways/wirecard.rb', line 55 def initialize( = {}) # verify that username and password are supplied requires!(, :login, :password) # unfortunately Wirecard also requires a BusinessCaseSignature in the XML request requires!(, :signature) @options = super end |
Instance Method Details
#authorize(money, creditcard, options = {}) ⇒ Object
Authorization
70 71 72 73 |
# File 'lib/active_merchant/billing/gateways/wirecard.rb', line 70 def (money, creditcard, = {}) [:credit_card] = creditcard commit(:authorization, money, ) end |
#capture(money, authorization, options = {}) ⇒ Object
Capture Authorization
76 77 78 79 |
# File 'lib/active_merchant/billing/gateways/wirecard.rb', line 76 def capture(money, , = {}) [:authorization] = commit(:capture_authorization, money, ) end |
#purchase(money, creditcard, options = {}) ⇒ Object
Purchase
82 83 84 85 |
# File 'lib/active_merchant/billing/gateways/wirecard.rb', line 82 def purchase(money, creditcard, = {}) [:credit_card] = creditcard commit(:purchase, money, ) end |
#test? ⇒ Boolean
Should run against the test servers or not?
65 66 67 |
# File 'lib/active_merchant/billing/gateways/wirecard.rb', line 65 def test? @options[:test] || super end |