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[ PREAUTHORIZATION CAPTURE 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
- #capture(money, authorization, options = {}) ⇒ Object
-
#initialize(options = {}) ⇒ WirecardGateway
constructor
Public: Create a new Wirecard gateway.
- #purchase(money, creditcard, options = {}) ⇒ Object
- #refund(money, identification, options = {}) ⇒ Object
- #void(identification, options = {}) ⇒ Object
Methods inherited from Gateway
#card_brand, card_brand, inherited, supports?, #test?
Methods included from CreditCardFormatting
Constructor Details
#initialize(options = {}) ⇒ WirecardGateway
Public: Create a new Wirecard gateway.
options - A hash of options:
:login - The username
:password - The password
:signature - The BusinessCaseSignature
42 43 44 45 |
# File 'lib/active_merchant/billing/gateways/wirecard.rb', line 42 def initialize( = {}) requires!(, :login, :password, :signature) super end |
Instance Method Details
#authorize(money, creditcard, options = {}) ⇒ Object
47 48 49 50 |
# File 'lib/active_merchant/billing/gateways/wirecard.rb', line 47 def (money, creditcard, = {}) [:credit_card] = creditcard commit(:preauthorization, money, ) end |
#capture(money, authorization, options = {}) ⇒ Object
52 53 54 55 |
# File 'lib/active_merchant/billing/gateways/wirecard.rb', line 52 def capture(money, , = {}) [:preauthorization] = commit(:capture, money, ) end |
#purchase(money, creditcard, options = {}) ⇒ Object
57 58 59 60 |
# File 'lib/active_merchant/billing/gateways/wirecard.rb', line 57 def purchase(money, creditcard, = {}) [:credit_card] = creditcard commit(:purchase, money, ) end |
#refund(money, identification, options = {}) ⇒ Object
67 68 69 70 |
# File 'lib/active_merchant/billing/gateways/wirecard.rb', line 67 def refund(money, identification, = {}) [:preauthorization] = identification commit(:bookback, money, ) end |
#void(identification, options = {}) ⇒ Object
62 63 64 65 |
# File 'lib/active_merchant/billing/gateways/wirecard.rb', line 62 def void(identification, = {}) [:preauthorization] = identification commit(:reversal, nil, ) end |