activemerchant 1.79.2 → 1.80.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +33 -0
- data/README.md +10 -2
- data/lib/active_merchant.rb +1 -1
- data/lib/active_merchant/billing/check.rb +4 -4
- data/lib/active_merchant/billing/compatibility.rb +1 -1
- data/lib/active_merchant/billing/credit_card.rb +21 -21
- data/lib/active_merchant/billing/credit_card_formatting.rb +2 -2
- data/lib/active_merchant/billing/credit_card_methods.rb +2 -2
- data/lib/active_merchant/billing/gateway.rb +13 -13
- data/lib/active_merchant/billing/gateways/adyen.rb +31 -15
- data/lib/active_merchant/billing/gateways/allied_wallet.rb +22 -22
- data/lib/active_merchant/billing/gateways/authorize_net.rb +72 -72
- data/lib/active_merchant/billing/gateways/authorize_net_arb.rb +3 -3
- data/lib/active_merchant/billing/gateways/authorize_net_cim.rb +3 -3
- data/lib/active_merchant/billing/gateways/axcessms.rb +51 -51
- data/lib/active_merchant/billing/gateways/balanced.rb +29 -29
- data/lib/active_merchant/billing/gateways/bank_frick.rb +3 -3
- data/lib/active_merchant/billing/gateways/banwire.rb +8 -8
- data/lib/active_merchant/billing/gateways/barclaycard_smartpay.rb +5 -5
- data/lib/active_merchant/billing/gateways/barclays_epdq_extra_plus.rb +6 -6
- data/lib/active_merchant/billing/gateways/be2bill.rb +2 -2
- data/lib/active_merchant/billing/gateways/beanstream.rb +1 -1
- data/lib/active_merchant/billing/gateways/beanstream/beanstream_core.rb +69 -69
- data/lib/active_merchant/billing/gateways/blue_pay.rb +19 -19
- data/lib/active_merchant/billing/gateways/blue_snap.rb +42 -42
- data/lib/active_merchant/billing/gateways/bogus.rb +10 -10
- data/lib/active_merchant/billing/gateways/borgun.rb +10 -10
- data/lib/active_merchant/billing/gateways/bpoint.rb +1 -1
- data/lib/active_merchant/billing/gateways/braintree/braintree_common.rb +2 -2
- data/lib/active_merchant/billing/gateways/braintree_blue.rb +94 -94
- data/lib/active_merchant/billing/gateways/braintree_orange.rb +1 -1
- data/lib/active_merchant/billing/gateways/bridge_pay.rb +39 -39
- data/lib/active_merchant/billing/gateways/cams.rb +12 -12
- data/lib/active_merchant/billing/gateways/card_connect.rb +38 -13
- data/lib/active_merchant/billing/gateways/card_stream.rb +116 -116
- data/lib/active_merchant/billing/gateways/cardknox.rb +7 -7
- data/lib/active_merchant/billing/gateways/cardprocess.rb +1 -1
- data/lib/active_merchant/billing/gateways/cashnet.rb +10 -10
- data/lib/active_merchant/billing/gateways/cc5.rb +3 -5
- data/lib/active_merchant/billing/gateways/cecabank.rb +6 -6
- data/lib/active_merchant/billing/gateways/cenpos.rb +36 -36
- data/lib/active_merchant/billing/gateways/checkout.rb +5 -5
- data/lib/active_merchant/billing/gateways/checkout_v2.rb +31 -31
- data/lib/active_merchant/billing/gateways/clearhaus.rb +5 -5
- data/lib/active_merchant/billing/gateways/commercegate.rb +6 -6
- data/lib/active_merchant/billing/gateways/conekta.rb +24 -19
- data/lib/active_merchant/billing/gateways/creditcall.rb +41 -41
- data/lib/active_merchant/billing/gateways/credorax.rb +104 -103
- data/lib/active_merchant/billing/gateways/culqi.rb +25 -25
- data/lib/active_merchant/billing/gateways/cyber_source.rb +65 -65
- data/lib/active_merchant/billing/gateways/data_cash.rb +4 -4
- data/lib/active_merchant/billing/gateways/dibs.rb +24 -24
- data/lib/active_merchant/billing/gateways/digitzs.rb +35 -35
- data/lib/active_merchant/billing/gateways/ebanx.rb +26 -26
- data/lib/active_merchant/billing/gateways/efsnet.rb +10 -10
- data/lib/active_merchant/billing/gateways/elavon.rb +5 -5
- data/lib/active_merchant/billing/gateways/element.rb +35 -35
- data/lib/active_merchant/billing/gateways/epay.rb +4 -4
- data/lib/active_merchant/billing/gateways/evo_ca.rb +1 -1
- data/lib/active_merchant/billing/gateways/eway.rb +65 -65
- data/lib/active_merchant/billing/gateways/eway_managed.rb +11 -11
- data/lib/active_merchant/billing/gateways/eway_rapid.rb +31 -31
- data/lib/active_merchant/billing/gateways/exact.rb +12 -12
- data/lib/active_merchant/billing/gateways/ezic.rb +13 -13
- data/lib/active_merchant/billing/gateways/fat_zebra.rb +24 -24
- data/lib/active_merchant/billing/gateways/federated_canada.rb +3 -3
- data/lib/active_merchant/billing/gateways/first_giving.rb +16 -16
- data/lib/active_merchant/billing/gateways/first_pay.rb +7 -4
- data/lib/active_merchant/billing/gateways/firstdata_e4.rb +71 -71
- data/lib/active_merchant/billing/gateways/flo2cash.rb +12 -12
- data/lib/active_merchant/billing/gateways/flo2cash_simple.rb +1 -1
- data/lib/active_merchant/billing/gateways/forte.rb +26 -16
- data/lib/active_merchant/billing/gateways/garanti.rb +10 -12
- data/lib/active_merchant/billing/gateways/global_collect.rb +88 -88
- data/lib/active_merchant/billing/gateways/global_transport.rb +4 -4
- data/lib/active_merchant/billing/gateways/hdfc.rb +33 -33
- data/lib/active_merchant/billing/gateways/hps.rb +28 -28
- data/lib/active_merchant/billing/gateways/iats_payments.rb +26 -26
- data/lib/active_merchant/billing/gateways/inspire.rb +15 -15
- data/lib/active_merchant/billing/gateways/instapay.rb +4 -4
- data/lib/active_merchant/billing/gateways/ipp.rb +17 -17
- data/lib/active_merchant/billing/gateways/iridium.rb +207 -207
- data/lib/active_merchant/billing/gateways/iveri.rb +8 -8
- data/lib/active_merchant/billing/gateways/jetpay.rb +134 -134
- data/lib/active_merchant/billing/gateways/jetpay_v2.rb +141 -141
- data/lib/active_merchant/billing/gateways/komoju.rb +15 -15
- data/lib/active_merchant/billing/gateways/kushki.rb +31 -37
- data/lib/active_merchant/billing/gateways/latitude19.rb +64 -64
- data/lib/active_merchant/billing/gateways/linkpoint.rb +22 -22
- data/lib/active_merchant/billing/gateways/litle.rb +4 -4
- data/lib/active_merchant/billing/gateways/mastercard.rb +3 -3
- data/lib/active_merchant/billing/gateways/maxipago.rb +2 -2
- data/lib/active_merchant/billing/gateways/mercado_pago.rb +28 -28
- data/lib/active_merchant/billing/gateways/merchant_e_solutions.rb +9 -9
- data/lib/active_merchant/billing/gateways/merchant_one.rb +6 -6
- data/lib/active_merchant/billing/gateways/merchant_partners.rb +24 -24
- data/lib/active_merchant/billing/gateways/merchant_ware.rb +49 -49
- data/lib/active_merchant/billing/gateways/merchant_ware_version_four.rb +36 -36
- data/lib/active_merchant/billing/gateways/merchant_warrior.rb +4 -4
- data/lib/active_merchant/billing/gateways/mercury.rb +28 -28
- data/lib/active_merchant/billing/gateways/metrics_global.rb +7 -7
- data/lib/active_merchant/billing/gateways/micropayment.rb +31 -31
- data/lib/active_merchant/billing/gateways/migs.rb +11 -9
- data/lib/active_merchant/billing/gateways/modern_payments.rb +1 -1
- data/lib/active_merchant/billing/gateways/modern_payments_cim.rb +16 -16
- data/lib/active_merchant/billing/gateways/monei.rb +5 -5
- data/lib/active_merchant/billing/gateways/moneris.rb +26 -26
- data/lib/active_merchant/billing/gateways/moneris_us.rb +81 -37
- data/lib/active_merchant/billing/gateways/money_movers.rb +3 -3
- data/lib/active_merchant/billing/gateways/mundipagg.rb +1 -1
- data/lib/active_merchant/billing/gateways/nab_transact.rb +6 -6
- data/lib/active_merchant/billing/gateways/ncr_secure_pay.rb +3 -3
- data/lib/active_merchant/billing/gateways/netaxept.rb +15 -15
- data/lib/active_merchant/billing/gateways/netbanx.rb +2 -2
- data/lib/active_merchant/billing/gateways/netbilling.rb +1 -1
- data/lib/active_merchant/billing/gateways/netpay.rb +5 -5
- data/lib/active_merchant/billing/gateways/nmi.rb +18 -18
- data/lib/active_merchant/billing/gateways/ogone.rb +22 -22
- data/lib/active_merchant/billing/gateways/omise.rb +3 -3
- data/lib/active_merchant/billing/gateways/openpay.rb +6 -4
- data/lib/active_merchant/billing/gateways/opp.rb +4 -4
- data/lib/active_merchant/billing/gateways/optimal_payment.rb +2 -2
- data/lib/active_merchant/billing/gateways/orbital.rb +61 -61
- data/lib/active_merchant/billing/gateways/orbital/orbital_soft_descriptors.rb +4 -4
- data/lib/active_merchant/billing/gateways/pac_net_raven.rb +5 -5
- data/lib/active_merchant/billing/gateways/pagarme.rb +27 -27
- data/lib/active_merchant/billing/gateways/pago_facil.rb +8 -8
- data/lib/active_merchant/billing/gateways/pay_conex.rb +25 -25
- data/lib/active_merchant/billing/gateways/pay_gate_xml.rb +32 -32
- data/lib/active_merchant/billing/gateways/pay_hub.rb +29 -29
- data/lib/active_merchant/billing/gateways/pay_junction.rb +7 -7
- data/lib/active_merchant/billing/gateways/pay_junction_v2.rb +30 -30
- data/lib/active_merchant/billing/gateways/pay_secure.rb +4 -4
- data/lib/active_merchant/billing/gateways/paybox_direct.rb +15 -15
- data/lib/active_merchant/billing/gateways/payeezy.rb +5 -5
- data/lib/active_merchant/billing/gateways/payex.rb +4 -4
- data/lib/active_merchant/billing/gateways/payflow.rb +7 -7
- data/lib/active_merchant/billing/gateways/payflow/payflow_common_api.rb +23 -22
- data/lib/active_merchant/billing/gateways/payflow_express.rb +2 -2
- data/lib/active_merchant/billing/gateways/payment_express.rb +40 -37
- data/lib/active_merchant/billing/gateways/paymentez.rb +11 -3
- data/lib/active_merchant/billing/gateways/paymill.rb +115 -115
- data/lib/active_merchant/billing/gateways/paypal.rb +1 -1
- data/lib/active_merchant/billing/gateways/paypal_digital_goods.rb +1 -1
- data/lib/active_merchant/billing/gateways/payscout.rb +1 -1
- data/lib/active_merchant/billing/gateways/paystation.rb +14 -14
- data/lib/active_merchant/billing/gateways/payu_in.rb +43 -43
- data/lib/active_merchant/billing/gateways/payu_latam.rb +41 -41
- data/lib/active_merchant/billing/gateways/payway.rb +6 -6
- data/lib/active_merchant/billing/gateways/pin.rb +7 -7
- data/lib/active_merchant/billing/gateways/plugnpay.rb +62 -62
- data/lib/active_merchant/billing/gateways/pro_pay.rb +123 -123
- data/lib/active_merchant/billing/gateways/psigate.rb +16 -16
- data/lib/active_merchant/billing/gateways/psl_card.rb +13 -13
- data/lib/active_merchant/billing/gateways/qbms.rb +52 -52
- data/lib/active_merchant/billing/gateways/quantum.rb +5 -5
- data/lib/active_merchant/billing/gateways/quickbooks.rb +10 -10
- data/lib/active_merchant/billing/gateways/quickpay.rb +1 -1
- data/lib/active_merchant/billing/gateways/quickpay/quickpay_v10.rb +11 -11
- data/lib/active_merchant/billing/gateways/quickpay/quickpay_v4to7.rb +3 -3
- data/lib/active_merchant/billing/gateways/qvalent.rb +55 -55
- data/lib/active_merchant/billing/gateways/realex.rb +16 -15
- data/lib/active_merchant/billing/gateways/redsys.rb +128 -121
- data/lib/active_merchant/billing/gateways/s5.rb +5 -5
- data/lib/active_merchant/billing/gateways/safe_charge.rb +16 -16
- data/lib/active_merchant/billing/gateways/sage.rb +20 -20
- data/lib/active_merchant/billing/gateways/sage_pay.rb +32 -32
- data/lib/active_merchant/billing/gateways/sallie_mae.rb +11 -11
- data/lib/active_merchant/billing/gateways/secure_net.rb +19 -19
- data/lib/active_merchant/billing/gateways/secure_pay.rb +5 -5
- data/lib/active_merchant/billing/gateways/secure_pay_au.rb +7 -7
- data/lib/active_merchant/billing/gateways/secure_pay_tech.rb +9 -9
- data/lib/active_merchant/billing/gateways/securion_pay.rb +12 -12
- data/lib/active_merchant/billing/gateways/skip_jack.rb +28 -28
- data/lib/active_merchant/billing/gateways/smart_ps.rb +31 -31
- data/lib/active_merchant/billing/gateways/so_easy_pay.rb +3 -3
- data/lib/active_merchant/billing/gateways/spreedly_core.rb +1 -1
- data/lib/active_merchant/billing/gateways/stripe.rb +63 -63
- data/lib/active_merchant/billing/gateways/swipe_checkout.rb +5 -5
- data/lib/active_merchant/billing/gateways/telr.rb +26 -26
- data/lib/active_merchant/billing/gateways/trans_first.rb +28 -28
- data/lib/active_merchant/billing/gateways/trans_first_transaction_express.rb +224 -224
- data/lib/active_merchant/billing/gateways/transact_pro.rb +7 -7
- data/lib/active_merchant/billing/gateways/transnational.rb +1 -1
- data/lib/active_merchant/billing/gateways/trexle.rb +5 -5
- data/lib/active_merchant/billing/gateways/trust_commerce.rb +38 -38
- data/lib/active_merchant/billing/gateways/usa_epay.rb +3 -3
- data/lib/active_merchant/billing/gateways/usa_epay_advanced.rb +37 -37
- data/lib/active_merchant/billing/gateways/usa_epay_transaction.rb +3 -3
- data/lib/active_merchant/billing/gateways/vanco.rb +25 -25
- data/lib/active_merchant/billing/gateways/verifi.rb +40 -40
- data/lib/active_merchant/billing/gateways/viaklix.rb +5 -5
- data/lib/active_merchant/billing/gateways/visanet_peru.rb +64 -36
- data/lib/active_merchant/billing/gateways/webpay.rb +8 -8
- data/lib/active_merchant/billing/gateways/wepay.rb +25 -25
- data/lib/active_merchant/billing/gateways/wirecard.rb +26 -26
- data/lib/active_merchant/billing/gateways/worldpay.rb +15 -15
- data/lib/active_merchant/billing/gateways/worldpay_online_payments.rb +42 -42
- data/lib/active_merchant/billing/gateways/worldpay_us.rb +17 -17
- data/lib/active_merchant/billing/model.rb +2 -2
- data/lib/active_merchant/billing/network_tokenization_credit_card.rb +1 -1
- data/lib/active_merchant/billing/rails.rb +1 -1
- data/lib/active_merchant/connection.rb +10 -8
- data/lib/active_merchant/country.rb +1 -1
- data/lib/active_merchant/net_http_ssl_connection.rb +1 -0
- data/lib/active_merchant/network_connection_retries.rb +12 -12
- data/lib/active_merchant/post_data.rb +1 -1
- data/lib/active_merchant/posts_data.rb +1 -1
- data/lib/active_merchant/version.rb +1 -1
- data/lib/certs/cacert.pem +37 -0
- data/lib/support/gateway_support.rb +2 -2
- data/lib/support/ssl_verify.rb +5 -5
- data/lib/support/ssl_version.rb +7 -7
- metadata +3 -7
- data/lib/active_merchant/billing/gateways/ideal/ideal_base.rb +0 -246
- data/lib/active_merchant/billing/gateways/ideal/ideal_rabobank.pem +0 -13
- data/lib/active_merchant/billing/gateways/ideal/ideal_response.rb +0 -29
- data/lib/active_merchant/billing/gateways/ideal_rabobank.rb +0 -66
@@ -1,246 +0,0 @@
|
|
1
|
-
require 'active_merchant/billing/gateways/ideal/ideal_response'
|
2
|
-
|
3
|
-
module ActiveMerchant #:nodoc:
|
4
|
-
module Billing #:nodoc:
|
5
|
-
# Implementation contains some simplifications
|
6
|
-
# - does not support multiple subID per merchant
|
7
|
-
# - language is fixed to 'nl'
|
8
|
-
class IdealBaseGateway < Gateway
|
9
|
-
class_attribute :server_pem, :pem_password, :default_expiration_period
|
10
|
-
self.default_expiration_period = 'PT10M'
|
11
|
-
self.default_currency = 'EUR'
|
12
|
-
self.pem_password = true
|
13
|
-
|
14
|
-
self.abstract_class = true
|
15
|
-
|
16
|
-
# These constants will never change for most users
|
17
|
-
AUTHENTICATION_TYPE = 'SHA1_RSA'
|
18
|
-
LANGUAGE = 'nl'
|
19
|
-
SUB_ID = '0'
|
20
|
-
API_VERSION = '1.1.0'
|
21
|
-
|
22
|
-
def initialize(options = {})
|
23
|
-
requires!(options, :login, :password, :pem)
|
24
|
-
|
25
|
-
options[:pem_password] = options[:password]
|
26
|
-
super
|
27
|
-
end
|
28
|
-
|
29
|
-
# Setup transaction. Get redirect_url from response.service_url
|
30
|
-
def setup_purchase(money, options = {})
|
31
|
-
requires!(options, :issuer_id, :return_url, :order_id, :currency, :description, :entrance_code)
|
32
|
-
|
33
|
-
commit(build_transaction_request(money, options))
|
34
|
-
end
|
35
|
-
|
36
|
-
# Check status of transaction and confirm payment
|
37
|
-
# transaction_id must be a valid transaction_id from a prior setup.
|
38
|
-
def capture(transaction, options = {})
|
39
|
-
options[:transaction_id] = transaction
|
40
|
-
commit(build_status_request(options))
|
41
|
-
end
|
42
|
-
|
43
|
-
# Get list of issuers from response.issuer_list
|
44
|
-
def issuers
|
45
|
-
commit(build_directory_request)
|
46
|
-
end
|
47
|
-
|
48
|
-
private
|
49
|
-
|
50
|
-
def url
|
51
|
-
(test? ? test_url : live_url)
|
52
|
-
end
|
53
|
-
|
54
|
-
def token
|
55
|
-
@token ||= create_fingerprint(@options[:pem])
|
56
|
-
end
|
57
|
-
|
58
|
-
# <?xml version="1.0" encoding="UTF-8"?>
|
59
|
-
# <AcquirerTrxReq xmlns="http://www.idealdesk.com/Message" version="1.1.0">
|
60
|
-
# <createDateTimeStamp>2001-12-17T09:30:47.0Z</createDateTimeStamp>
|
61
|
-
# <Issuer>
|
62
|
-
# <issuerID>1003</issuerID>
|
63
|
-
# </Issuer>
|
64
|
-
# <Merchant>
|
65
|
-
# <merchantID>000123456</merchantID>
|
66
|
-
# <subID>0</subID>
|
67
|
-
# <authentication>passkey</authentication>
|
68
|
-
# <token>1</token>
|
69
|
-
# <tokenCode>3823ad872eff23</tokenCode>
|
70
|
-
# <merchantReturnURL>https://www.mijnwinkel.nl/betaalafhandeling
|
71
|
-
# </merchantReturnURL>
|
72
|
-
# </Merchant>
|
73
|
-
# <Transaction>
|
74
|
-
# <purchaseID>iDEAL-aankoop 21</purchaseID>
|
75
|
-
# <amount>5999</amount>
|
76
|
-
# <currency>EUR</currency>
|
77
|
-
# <expirationPeriod>PT3M30S</expirationPeriod>
|
78
|
-
# <language>nl</language>
|
79
|
-
# <description>Documentensuite</description>
|
80
|
-
# <entranceCode>D67tyx6rw9IhY71</entranceCode>
|
81
|
-
# </Transaction>
|
82
|
-
# </AcquirerTrxReq>
|
83
|
-
def build_transaction_request(money, options)
|
84
|
-
date_time_stamp = create_time_stamp
|
85
|
-
message = date_time_stamp +
|
86
|
-
options[:issuer_id] +
|
87
|
-
@options[:login] +
|
88
|
-
SUB_ID +
|
89
|
-
options[:return_url] +
|
90
|
-
options[:order_id] +
|
91
|
-
money.to_s +
|
92
|
-
(options[:currency] || currency(money)) +
|
93
|
-
LANGUAGE +
|
94
|
-
options[:description] +
|
95
|
-
options[:entrance_code]
|
96
|
-
token_code = sign_message(@options[:pem], @options[:password], message)
|
97
|
-
|
98
|
-
xml = Builder::XmlMarkup.new(:indent => 2)
|
99
|
-
xml.instruct!
|
100
|
-
xml.tag! 'AcquirerTrxReq', 'xmlns' => 'http://www.idealdesk.com/Message', 'version' => API_VERSION do
|
101
|
-
xml.tag! 'createDateTimeStamp', date_time_stamp
|
102
|
-
xml.tag! 'Issuer' do
|
103
|
-
xml.tag! 'issuerID', options[:issuer_id]
|
104
|
-
end
|
105
|
-
xml.tag! 'Merchant' do
|
106
|
-
xml.tag! 'merchantID', @options[:login]
|
107
|
-
xml.tag! 'subID', SUB_ID
|
108
|
-
xml.tag! 'authentication', AUTHENTICATION_TYPE
|
109
|
-
xml.tag! 'token', token
|
110
|
-
xml.tag! 'tokenCode', token_code
|
111
|
-
xml.tag! 'merchantReturnURL', options[:return_url]
|
112
|
-
end
|
113
|
-
xml.tag! 'Transaction' do
|
114
|
-
xml.tag! 'purchaseID', options[:order_id]
|
115
|
-
xml.tag! 'amount', money
|
116
|
-
xml.tag! 'currency', options[:currency]
|
117
|
-
xml.tag! 'expirationPeriod', options[:expiration_period] || default_expiration_period
|
118
|
-
xml.tag! 'language', LANGUAGE
|
119
|
-
xml.tag! 'description', options[:description]
|
120
|
-
xml.tag! 'entranceCode', options[:entrance_code]
|
121
|
-
end
|
122
|
-
xml.target!
|
123
|
-
end
|
124
|
-
end
|
125
|
-
|
126
|
-
# <?xml version="1.0" encoding="UTF-8"?>
|
127
|
-
# <AcquirerStatusReq xmlns="http://www.idealdesk.com/Message" version="1.1.0">
|
128
|
-
# <createDateTimeStamp>2001-12-17T09:30:47.0Z</createDateTimeStamp>
|
129
|
-
# <Merchant>
|
130
|
-
# <merchantID>000123456</merchantID>
|
131
|
-
# <subID>0</subID>
|
132
|
-
# <authentication>keyed hash</authentication>
|
133
|
-
# <token>1</token>
|
134
|
-
# <tokenCode>3823ad872eff23</tokenCode>
|
135
|
-
# </Merchant>
|
136
|
-
# <Transaction>
|
137
|
-
# <transactionID>0001023456789112</transactionID>
|
138
|
-
# </Transaction>
|
139
|
-
# </AcquirerStatusReq>
|
140
|
-
def build_status_request(options)
|
141
|
-
datetimestamp = create_time_stamp
|
142
|
-
message = datetimestamp + @options[:login] + SUB_ID + options[:transaction_id]
|
143
|
-
tokenCode = sign_message(@options[:pem], @options[:password], message)
|
144
|
-
|
145
|
-
xml = Builder::XmlMarkup.new(:indent => 2)
|
146
|
-
xml.instruct!
|
147
|
-
xml.tag! 'AcquirerStatusReq', 'xmlns' => 'http://www.idealdesk.com/Message', 'version' => API_VERSION do
|
148
|
-
xml.tag! 'createDateTimeStamp', datetimestamp
|
149
|
-
xml.tag! 'Merchant' do
|
150
|
-
xml.tag! 'merchantID', @options[:login]
|
151
|
-
xml.tag! 'subID', SUB_ID
|
152
|
-
xml.tag! 'authentication' , AUTHENTICATION_TYPE
|
153
|
-
xml.tag! 'token', token
|
154
|
-
xml.tag! 'tokenCode', tokenCode
|
155
|
-
end
|
156
|
-
xml.tag! 'Transaction' do
|
157
|
-
xml.tag! 'transactionID', options[:transaction_id]
|
158
|
-
end
|
159
|
-
end
|
160
|
-
xml.target!
|
161
|
-
end
|
162
|
-
|
163
|
-
# <?xml version="1.0" encoding="UTF-8"?>
|
164
|
-
# <DirectoryReq xmlns="http://www.idealdesk.com/Message" version="1.1.0">
|
165
|
-
# <createDateTimeStamp>2001-12-17T09:30:47.0Z</createDateTimeStamp>
|
166
|
-
# <Merchant>
|
167
|
-
# <merchantID>000000001</merchantID>
|
168
|
-
# <subID>0</subID>
|
169
|
-
# <authentication>1</authentication>
|
170
|
-
# <token>hashkey</token>
|
171
|
-
# <tokenCode>WajqV1a3nDen0be2r196g9FGFF=</tokenCode>
|
172
|
-
# </Merchant>
|
173
|
-
# </DirectoryReq>
|
174
|
-
def build_directory_request
|
175
|
-
datetimestamp = create_time_stamp
|
176
|
-
message = datetimestamp + @options[:login] + SUB_ID
|
177
|
-
tokenCode = sign_message(@options[:pem], @options[:password], message)
|
178
|
-
|
179
|
-
xml = Builder::XmlMarkup.new(:indent => 2)
|
180
|
-
xml.instruct!
|
181
|
-
xml.tag! 'DirectoryReq', 'xmlns' => 'http://www.idealdesk.com/Message', 'version' => API_VERSION do
|
182
|
-
xml.tag! 'createDateTimeStamp', datetimestamp
|
183
|
-
xml.tag! 'Merchant' do
|
184
|
-
xml.tag! 'merchantID', @options[:login]
|
185
|
-
xml.tag! 'subID', SUB_ID
|
186
|
-
xml.tag! 'authentication', AUTHENTICATION_TYPE
|
187
|
-
xml.tag! 'token', token
|
188
|
-
xml.tag! 'tokenCode', tokenCode
|
189
|
-
end
|
190
|
-
end
|
191
|
-
xml.target!
|
192
|
-
end
|
193
|
-
|
194
|
-
def commit(request)
|
195
|
-
raw_response = ssl_post(url, request)
|
196
|
-
response = Hash.from_xml(raw_response.to_s)
|
197
|
-
response_type = response.keys[0]
|
198
|
-
|
199
|
-
case response_type
|
200
|
-
when 'AcquirerTrxRes', 'DirectoryRes'
|
201
|
-
success = true
|
202
|
-
when 'ErrorRes'
|
203
|
-
success = false
|
204
|
-
when 'AcquirerStatusRes'
|
205
|
-
raise SecurityError, "Message verification failed.", caller unless status_response_verified?(response)
|
206
|
-
success = (response['AcquirerStatusRes']['Transaction']['status'] == 'Success')
|
207
|
-
else
|
208
|
-
raise ArgumentError, "Unknown response type.", caller
|
209
|
-
end
|
210
|
-
|
211
|
-
return IdealResponse.new(success, response.keys[0], response, :test => test?)
|
212
|
-
end
|
213
|
-
|
214
|
-
def create_fingerprint(cert_file)
|
215
|
-
cert_data = OpenSSL::X509::Certificate.new(cert_file).to_s
|
216
|
-
cert_data = cert_data.sub(/-----BEGIN CERTIFICATE-----/, '')
|
217
|
-
cert_data = cert_data.sub(/-----END CERTIFICATE-----/, '')
|
218
|
-
fingerprint = Base64.decode64(cert_data)
|
219
|
-
fingerprint = Digest::SHA1.hexdigest(fingerprint)
|
220
|
-
return fingerprint.upcase
|
221
|
-
end
|
222
|
-
|
223
|
-
def sign_message(private_key_data, password, data)
|
224
|
-
private_key = OpenSSL::PKey::RSA.new(private_key_data, password)
|
225
|
-
signature = private_key.sign(OpenSSL::Digest::SHA1.new, data.gsub('\s', ''))
|
226
|
-
return Base64.encode64(signature).gsub(/\n/, '')
|
227
|
-
end
|
228
|
-
|
229
|
-
def verify_message(cert_file, data, signature)
|
230
|
-
public_key = OpenSSL::X509::Certificate.new(cert_file).public_key
|
231
|
-
return public_key.verify(OpenSSL::Digest::SHA1.new, Base64.decode64(signature), data)
|
232
|
-
end
|
233
|
-
|
234
|
-
def status_response_verified?(response)
|
235
|
-
transaction = response['AcquirerStatusRes']['Transaction']
|
236
|
-
message = response['AcquirerStatusRes']['createDateTimeStamp'] + transaction['transactionID' ] + transaction['status']
|
237
|
-
message << transaction['consumerAccountNumber'].to_s
|
238
|
-
verify_message(server_pem, message, response['AcquirerStatusRes']['Signature']['signatureValue'])
|
239
|
-
end
|
240
|
-
|
241
|
-
def create_time_stamp
|
242
|
-
Time.now.gmtime.strftime('%Y-%m-%dT%H:%M:%S.000Z')
|
243
|
-
end
|
244
|
-
end
|
245
|
-
end
|
246
|
-
end
|
@@ -1,13 +0,0 @@
|
|
1
|
-
-----BEGIN CERTIFICATE-----
|
2
|
-
MIICQDCCAakCBELvbPYwDQYJKoZIhvcNAQEEBQAwZzELMAkGA1UEBhMCREUxDzANBgNVBAgTBkhl
|
3
|
-
c3NlbjESMBAGA1UEBxMJRnJhbmtmdXJ0MQ4wDAYDVQQKEwVpREVBTDEOMAwGA1UECxMFaURFQUwx
|
4
|
-
EzARBgNVBAMTCmlERUFMIFJhYm8wHhcNMDUwODAyMTI1NDE0WhcNMTUwNzMxMTI1NDE0WjBnMQsw
|
5
|
-
CQYDVQQGEwJERTEPMA0GA1UECBMGSGVzc2VuMRIwEAYDVQQHEwlGcmFua2Z1cnQxDjAMBgNVBAoT
|
6
|
-
BWlERUFMMQ4wDAYDVQQLEwVpREVBTDETMBEGA1UEAxMKaURFQUwgUmFibzCBnzANBgkqhkiG9w0B
|
7
|
-
AQEFAAOBjQAwgYkCgYEA486iIKVhr8RNjxH+PZ3yTWx/8k2fqDFm8XU8I1Z5esRmPFnXmlgA8cG7
|
8
|
-
e9AaBPaLoP7Dc8dRQoUO66KMakzGI/WAVdHIJiiKrz8xOcioIgrzPSqec7aqse3J28UraEHkGESJ
|
9
|
-
7dAW7Pw/shrmpmkzKsunLt6AkXss4W3JUndZUN0CAwEAATANBgkqhkiG9w0BAQQFAAOBgQCGy/FK
|
10
|
-
Lotp2ZOTtuLMgvDy74eicq/Znv4bLfpglzAPHycRHcHsXuer/lNHyvpKf2gdYe+IFalUW3OJZWIM
|
11
|
-
jpm4UniJ16RPdgwWVRJEdPr/P7JXMIqD2IEOgujuuTQ7x0VgCf9XrsPsP9ZR5DIPcDDhbrpSE0yF
|
12
|
-
Do77nwG61xMaGA==
|
13
|
-
-----END CERTIFICATE-----
|
@@ -1,29 +0,0 @@
|
|
1
|
-
module ActiveMerchant #:nodoc:
|
2
|
-
module Billing #:nodoc:
|
3
|
-
class IdealResponse < Response
|
4
|
-
|
5
|
-
def issuer_list
|
6
|
-
list = @params.values[0]['Directory']['Issuer']
|
7
|
-
case list
|
8
|
-
when Hash
|
9
|
-
return [list]
|
10
|
-
when Array
|
11
|
-
return list
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
def service_url
|
16
|
-
@params.values[0]['Issuer']['issuerAuthenticationURL']
|
17
|
-
end
|
18
|
-
|
19
|
-
def transaction
|
20
|
-
@params.values[0]['Transaction']
|
21
|
-
end
|
22
|
-
|
23
|
-
def error
|
24
|
-
@params.values[0]['Error']
|
25
|
-
end
|
26
|
-
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
@@ -1,66 +0,0 @@
|
|
1
|
-
require 'active_merchant/billing/gateways/ideal/ideal_base'
|
2
|
-
|
3
|
-
module ActiveMerchant #:nodoc:
|
4
|
-
module Billing #:nodoc:
|
5
|
-
# First, make sure you have everything setup correctly and all of your dependencies in place with:
|
6
|
-
#
|
7
|
-
# require 'rubygems'
|
8
|
-
# require 'active_merchant'
|
9
|
-
#
|
10
|
-
# ActiveMerchant expects the amounts to be given as an Integer in cents. In this case, 10 EUR becomes 1000.
|
11
|
-
#
|
12
|
-
# Create certificates for authentication:
|
13
|
-
#
|
14
|
-
# The PEM file expected should contain both the certificate and the generated PEM file.
|
15
|
-
# Some sample shell commands to generate the certificates:
|
16
|
-
#
|
17
|
-
# openssl genrsa -aes128 -out priv.pem -passout pass:[YOUR PASSWORD] 1024
|
18
|
-
# openssl req -x509 -new -key priv.pem -passin pass:[YOUR PASSWORD] -days 3000 -out cert.cer
|
19
|
-
# cat cert.cer priv.pem > ideal.pem
|
20
|
-
#
|
21
|
-
# Following the steps above, upload cert.cer to the ideal web interface and pass the path of ideal.pem to the :pem option.
|
22
|
-
#
|
23
|
-
# Configure the gateway using your iDEAL bank account info and security settings:
|
24
|
-
#
|
25
|
-
# Create gateway:
|
26
|
-
# gateway = ActiveMerchant::Billing::IdealRabobankGateway.new(
|
27
|
-
# :login => '123456789', # 9 digit merchant number
|
28
|
-
# :pem => File.read(Rails.root + 'config/ideal.pem'),
|
29
|
-
# :password => 'password' # password for the PEM key
|
30
|
-
# )
|
31
|
-
#
|
32
|
-
# Get list of issuers to fill selection list on your payment form:
|
33
|
-
# response = gateway.issuers
|
34
|
-
# list = response.issuer_list
|
35
|
-
#
|
36
|
-
# Request transaction:
|
37
|
-
#
|
38
|
-
# options = {
|
39
|
-
# :issuer_id => '0001',
|
40
|
-
# :expiration_period => 'PT10M',
|
41
|
-
# :return_url => 'http://www.return.url',
|
42
|
-
# :order_id => '1234567890123456',
|
43
|
-
# :currency => 'EUR',
|
44
|
-
# :description => 'Een omschrijving',
|
45
|
-
# :entrance_code => '1234'
|
46
|
-
# }
|
47
|
-
#
|
48
|
-
# response = gateway.setup_purchase(amount, options)
|
49
|
-
# transaction_id = response.transaction['transactionID']
|
50
|
-
# redirect_url = response.service_url
|
51
|
-
#
|
52
|
-
# Mandatory status request will confirm transaction:
|
53
|
-
# response = gateway.capture(transaction_id)
|
54
|
-
#
|
55
|
-
# Implementation contains some simplifications
|
56
|
-
# - does not support multiple subID per merchant
|
57
|
-
# - language is fixed to 'nl'
|
58
|
-
class IdealRabobankGateway < IdealBaseGateway
|
59
|
-
class_attribute :test_url, :live_url
|
60
|
-
|
61
|
-
self.test_url = 'https://idealtest.rabobank.nl/ideal/iDeal'
|
62
|
-
self.live_url = 'https://ideal.rabobank.nl/ideal/iDeal'
|
63
|
-
self.server_pem = File.read(File.dirname(__FILE__) + '/ideal/ideal_rabobank.pem')
|
64
|
-
end
|
65
|
-
end
|
66
|
-
end
|