Class: ActiveMerchant::Billing::QuickpayGateway
- Inherits:
-
Gateway
- Object
- Gateway
- ActiveMerchant::Billing::QuickpayGateway
show all
- Defined in:
- lib/active_merchant/billing/gateways/quickpay.rb
Constant Summary
collapse
- MD5_CHECK_FIELDS =
{
3 => {
:authorize => %w(protocol msgtype merchant ordernumber amount
currency autocapture cardnumber expirationdate
cvd cardtypelock testmode),
:capture => %w(protocol msgtype merchant amount transaction),
:cancel => %w(protocol msgtype merchant transaction),
:refund => %w(protocol msgtype merchant amount transaction),
:subscribe => %w(protocol msgtype merchant ordernumber cardnumber
expirationdate cvd cardtypelock description testmode),
:recurring => %w(protocol msgtype merchant ordernumber amount
currency autocapture transaction),
:status => %w(protocol msgtype merchant transaction),
:chstatus => %w(protocol msgtype merchant)
},
4 => {
:authorize => %w(protocol msgtype merchant ordernumber amount
currency autocapture cardnumber expirationdate cvd
cardtypelock testmode fraud_remote_addr
fraud_http_accept fraud_http_accept_language
fraud_http_accept_encoding fraud_http_accept_charset
fraud_http_referer fraud_http_user_agent apikey),
:capture => %w(protocol msgtype merchant amount transaction apikey),
:cancel => %w(protocol msgtype merchant transaction apikey),
:refund => %w(protocol msgtype merchant amount transaction apikey),
:subscribe => %w(protocol msgtype merchant ordernumber cardnumber
expirationdate cvd cardtypelock description testmode
fraud_remote_addr fraud_http_accept fraud_http_accept_language
fraud_http_accept_encoding fraud_http_accept_charset
fraud_http_referer fraud_http_user_agent apikey),
:recurring => %w(protocol msgtype merchant ordernumber amount currency
autocapture transaction apikey),
:status => %w(protocol msgtype merchant transaction apikey),
:chstatus => %w(protocol msgtype merchant apikey)
},
5 => {
:authorize => %w(protocol msgtype merchant ordernumber amount
currency autocapture cardnumber expirationdate cvd
cardtypelock testmode fraud_remote_addr
fraud_http_accept fraud_http_accept_language
fraud_http_accept_encoding fraud_http_accept_charset
fraud_http_referer fraud_http_user_agent apikey),
:capture => %w(protocol msgtype merchant amount transaction apikey),
:cancel => %w(protocol msgtype merchant transaction apikey),
:refund => %w(protocol msgtype merchant amount transaction apikey),
:subscribe => %w(protocol msgtype merchant ordernumber cardnumber
expirationdate cvd cardtypelock description testmode
fraud_remote_addr fraud_http_accept fraud_http_accept_language
fraud_http_accept_encoding fraud_http_accept_charset
fraud_http_referer fraud_http_user_agent apikey),
:recurring => %w(protocol msgtype merchant ordernumber amount currency
autocapture transaction apikey),
:status => %w(protocol msgtype merchant transaction apikey),
:chstatus => %w(protocol msgtype merchant apikey)
},
6 => {
:authorize => %w(protocol msgtype merchant ordernumber amount
currency autocapture cardnumber expirationdate cvd
cardtypelock testmode fraud_remote_addr
fraud_http_accept fraud_http_accept_language
fraud_http_accept_encoding fraud_http_accept_charset
fraud_http_referer fraud_http_user_agent apikey),
:capture => %w(protocol msgtype merchant amount transaction
apikey),
:cancel => %w(protocol msgtype merchant transaction apikey),
:refund => %w(protocol msgtype merchant amount transaction apikey),
:subscribe => %w(protocol msgtype merchant ordernumber cardnumber
expirationdate cvd cardtypelock description testmode
fraud_remote_addr fraud_http_accept fraud_http_accept_language
fraud_http_accept_encoding fraud_http_accept_charset
fraud_http_referer fraud_http_user_agent apikey),
:recurring => %w(protocol msgtype merchant ordernumber amount currency
autocapture transaction apikey),
:status => %w(protocol msgtype merchant transaction apikey),
:chstatus => %w(protocol msgtype merchant apikey)
}
}
- APPROVED =
'000'
Constants inherited
from Gateway
Gateway::CREDIT_DEPRECATION_MESSAGE, Gateway::CURRENCIES_WITHOUT_FRACTIONS, Gateway::DEBIT_CARDS
Instance Attribute Summary
Attributes inherited from Gateway
#options
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 manager To use the API-key from the Quickpay manager, specify :api-key Using the API-key, requires that you use version 4+.
-
#purchase(money, credit_card_or_reference, options = {}) ⇒ Object
-
#refund(money, identification, options = {}) ⇒ Object
-
#store(creditcard, options = {}) ⇒ Object
-
#void(identification, options = {}) ⇒ Object
Methods inherited from Gateway
#card_brand, card_brand, inherited, supports?, #test?
#format
Constructor Details
The login is the QuickpayId The password is the md5checkword from the Quickpay manager To use the API-key from the Quickpay manager, specify :api-key Using the API-key, requires that you use version 4+. Specify :version => 4/5/6 in options.
131
132
133
134
135
|
# File 'lib/active_merchant/billing/gateways/quickpay.rb', line 131
def initialize(options = {})
requires!(options, :login, :password)
@protocol = options.delete(:version) || 3 super
end
|
Instance Method Details
#authorize(money, credit_card_or_reference, options = {}) ⇒ Object
137
138
139
140
141
142
143
144
145
146
147
148
149
150
|
# File 'lib/active_merchant/billing/gateways/quickpay.rb', line 137
def authorize(money, credit_card_or_reference, options = {})
post = {}
action = recurring_or_authorize(credit_card_or_reference)
add_amount(post, money, options)
add_invoice(post, options)
add_creditcard_or_reference(post, credit_card_or_reference, options)
add_autocapture(post, false)
add_fraud_parameters(post, options) if action.eql?(:authorize)
add_testmode(post)
commit(action, post)
end
|
#capture(money, authorization, options = {}) ⇒ Object
166
167
168
169
170
171
172
|
# File 'lib/active_merchant/billing/gateways/quickpay.rb', line 166
def capture(money, authorization, options = {})
post = {}
add_reference(post, authorization)
add_amount_without_currency(post, money)
commit(:capture, post)
end
|
#credit(money, identification, options = {}) ⇒ Object
191
192
193
194
|
# File 'lib/active_merchant/billing/gateways/quickpay.rb', line 191
def credit(money, identification, options = {})
deprecated CREDIT_DEPRECATION_MESSAGE
refund(money, identification, options)
end
|
#purchase(money, credit_card_or_reference, options = {}) ⇒ Object
152
153
154
155
156
157
158
159
160
161
162
163
164
|
# File 'lib/active_merchant/billing/gateways/quickpay.rb', line 152
def purchase(money, credit_card_or_reference, options = {})
post = {}
action = recurring_or_authorize(credit_card_or_reference)
add_amount(post, money, options)
add_creditcard_or_reference(post, credit_card_or_reference, options)
add_invoice(post, options)
add_fraud_parameters(post, options) if action.eql?(:authorize)
add_autocapture(post, true)
commit(action, post)
end
|
#refund(money, identification, options = {}) ⇒ Object
182
183
184
185
186
187
188
189
|
# File 'lib/active_merchant/billing/gateways/quickpay.rb', line 182
def refund(money, identification, options = {})
post = {}
add_amount_without_currency(post, money)
add_reference(post, identification)
commit(:refund, post)
end
|
#store(creditcard, options = {}) ⇒ Object
196
197
198
199
200
201
202
203
204
205
206
|
# File 'lib/active_merchant/billing/gateways/quickpay.rb', line 196
def store(creditcard, options = {})
post = {}
add_creditcard(post, creditcard, options)
add_invoice(post, options)
add_description(post, options)
add_fraud_parameters(post, options)
add_testmode(post)
commit(:subscribe, post)
end
|
#void(identification, options = {}) ⇒ Object
174
175
176
177
178
179
180
|
# File 'lib/active_merchant/billing/gateways/quickpay.rb', line 174
def void(identification, options = {})
post = {}
add_reference(post, identification)
commit(:cancel, post)
end
|