Class: ActiveMerchant::Billing::QuickpayGateway
- Defined in:
- lib/active_merchant/billing/gateways/quickpay.rb
Constant Summary collapse
- URL =
'https://secure.quickpay.dk/api'
- PROTOCOL =
3
- MD5_CHECK_FIELDS =
{ :authorize => [:protocol, :msgtype, :merchant, :ordernumber, :amount, :currency, :autocapture, :cardnumber, :expirationdate, :cvd, :cardtypelock], :capture => [:protocol, :msgtype, :merchant, :amount, :transaction], :cancel => [:protocol, :msgtype, :merchant, :transaction], :refund => [:protocol, :msgtype, :merchant, :amount, :transaction], :subscribe => [:protocol, :msgtype, :merchant, :ordernumber, :cardnumber, :expirationdate, :cvd, :cardtypelock, :description], :recurring => [:protocol, :msgtype, :merchant, :ordernumber, :amount, :currency, :autocapture, :transaction], :status => [:protocol, :msgtype, :merchant, :transaction], :chstatus => [:protocol, :msgtype, :merchant], }
- APPROVED =
'000'
Constants inherited from Gateway
Instance Attribute Summary
Attributes inherited from Gateway
Instance Method Summary collapse
- #authorize(money, credit_card_or_reference, options = {}) ⇒ Object
- #capture(money, authorization, options = {}) ⇒ Object
- #credit(money, identification, options = {}) ⇒ Object
-
#initialize(options = {}) ⇒ QuickpayGateway
constructor
The login is the QuickpayId The password is the md5checkword from the Quickpay admin interface.
- #purchase(money, credit_card_or_reference, options = {}) ⇒ Object
- #store(creditcard, options = {}) ⇒ Object
- #void(identification, options = {}) ⇒ Object
Methods inherited from Gateway
#card_brand, card_brand, inherited, supports?, #test?
Methods included from Utils
Methods included from CreditCardFormatting
Methods included from RequiresParameters
Methods included from PostsData
Constructor Details
#initialize(options = {}) ⇒ QuickpayGateway
The login is the QuickpayId The password is the md5checkword from the Quickpay admin interface
33 34 35 36 37 |
# File 'lib/active_merchant/billing/gateways/quickpay.rb', line 33 def initialize( = {}) requires!(, :login, :password) @options = super end |
Instance Method Details
#authorize(money, credit_card_or_reference, options = {}) ⇒ Object
39 40 41 42 43 44 45 46 47 48 |
# File 'lib/active_merchant/billing/gateways/quickpay.rb', line 39 def (money, credit_card_or_reference, = {}) post = {} add_amount(post, money, ) add_invoice(post, ) add_creditcard_or_reference(post, credit_card_or_reference, ) add_autocapture(post, false) commit((credit_card_or_reference), post) end |
#capture(money, authorization, options = {}) ⇒ Object
61 62 63 64 65 66 67 68 |
# File 'lib/active_merchant/billing/gateways/quickpay.rb', line 61 def capture(money, , = {}) post = {} add_reference(post, ) add_amount_without_currency(post, money) commit(:capture, post) end |
#credit(money, identification, options = {}) ⇒ Object
78 79 80 81 82 83 84 85 |
# File 'lib/active_merchant/billing/gateways/quickpay.rb', line 78 def credit(money, identification, = {}) post = {} add_amount_without_currency(post, money) add_reference(post, identification) commit(:refund, post) end |
#purchase(money, credit_card_or_reference, options = {}) ⇒ Object
50 51 52 53 54 55 56 57 58 59 |
# File 'lib/active_merchant/billing/gateways/quickpay.rb', line 50 def purchase(money, credit_card_or_reference, = {}) post = {} add_amount(post, money, ) add_creditcard_or_reference(post, credit_card_or_reference, ) add_invoice(post, ) add_autocapture(post, true) commit((credit_card_or_reference), post) end |
#store(creditcard, options = {}) ⇒ Object
87 88 89 90 91 92 93 94 95 |
# File 'lib/active_merchant/billing/gateways/quickpay.rb', line 87 def store(creditcard, = {}) post = {} add_creditcard(post, creditcard, ) add_invoice(post, ) add_description(post, ) commit(:subscribe, post) end |
#void(identification, options = {}) ⇒ Object
70 71 72 73 74 75 76 |
# File 'lib/active_merchant/billing/gateways/quickpay.rb', line 70 def void(identification, = {}) post = {} add_reference(post, identification) commit(:cancel, post) end |