activemerchant 1.131.0 → 1.137.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (184) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +262 -0
  3. data/lib/active_merchant/billing/check.rb +2 -2
  4. data/lib/active_merchant/billing/compatibility.rb +4 -4
  5. data/lib/active_merchant/billing/credit_card.rb +13 -8
  6. data/lib/active_merchant/billing/credit_card_formatting.rb +4 -0
  7. data/lib/active_merchant/billing/credit_card_methods.rb +64 -7
  8. data/lib/active_merchant/billing/gateway.rb +9 -0
  9. data/lib/active_merchant/billing/gateways/adyen.rb +240 -41
  10. data/lib/active_merchant/billing/gateways/airwallex.rb +26 -12
  11. data/lib/active_merchant/billing/gateways/alelo.rb +23 -5
  12. data/lib/active_merchant/billing/gateways/authorize_net.rb +43 -35
  13. data/lib/active_merchant/billing/gateways/authorize_net_arb.rb +10 -6
  14. data/lib/active_merchant/billing/gateways/authorize_net_cim.rb +1 -3
  15. data/lib/active_merchant/billing/gateways/axcessms.rb +6 -2
  16. data/lib/active_merchant/billing/gateways/banwire.rb +4 -2
  17. data/lib/active_merchant/billing/gateways/beanstream/beanstream_core.rb +7 -3
  18. data/lib/active_merchant/billing/gateways/blue_pay.rb +13 -5
  19. data/lib/active_merchant/billing/gateways/blue_snap.rb +5 -5
  20. data/lib/active_merchant/billing/gateways/borgun.rb +6 -4
  21. data/lib/active_merchant/billing/gateways/braintree/token_nonce.rb +65 -20
  22. data/lib/active_merchant/billing/gateways/braintree_blue.rb +226 -73
  23. data/lib/active_merchant/billing/gateways/braintree_orange.rb +1 -1
  24. data/lib/active_merchant/billing/gateways/card_connect.rb +5 -2
  25. data/lib/active_merchant/billing/gateways/card_stream.rb +4 -6
  26. data/lib/active_merchant/billing/gateways/cashnet.rb +1 -1
  27. data/lib/active_merchant/billing/gateways/cecabank/cecabank_common.rb +36 -0
  28. data/lib/active_merchant/billing/gateways/cecabank/cecabank_json.rb +316 -0
  29. data/lib/active_merchant/billing/gateways/cecabank/cecabank_xml.rb +220 -0
  30. data/lib/active_merchant/billing/gateways/cecabank.rb +7 -240
  31. data/lib/active_merchant/billing/gateways/checkout_v2.rb +242 -41
  32. data/lib/active_merchant/billing/gateways/commerce_hub.rb +69 -8
  33. data/lib/active_merchant/billing/gateways/credorax.rb +3 -5
  34. data/lib/active_merchant/billing/gateways/cyber_source.rb +192 -41
  35. data/lib/active_merchant/billing/gateways/cyber_source_rest.rb +102 -58
  36. data/lib/active_merchant/billing/gateways/d_local.rb +26 -15
  37. data/lib/active_merchant/billing/gateways/data_cash.rb +21 -17
  38. data/lib/active_merchant/billing/gateways/datatrans.rb +279 -0
  39. data/lib/active_merchant/billing/gateways/decidir.rb +53 -18
  40. data/lib/active_merchant/billing/gateways/decidir_plus.rb +4 -1
  41. data/lib/active_merchant/billing/gateways/deepstack.rb +382 -0
  42. data/lib/active_merchant/billing/gateways/ebanx.rb +40 -36
  43. data/lib/active_merchant/billing/gateways/efsnet.rb +6 -2
  44. data/lib/active_merchant/billing/gateways/elavon.rb +99 -33
  45. data/lib/active_merchant/billing/gateways/element.rb +36 -7
  46. data/lib/active_merchant/billing/gateways/epay.rb +6 -2
  47. data/lib/active_merchant/billing/gateways/evo_ca.rb +6 -2
  48. data/lib/active_merchant/billing/gateways/eway.rb +4 -2
  49. data/lib/active_merchant/billing/gateways/eway_managed.rb +6 -2
  50. data/lib/active_merchant/billing/gateways/exact.rb +6 -2
  51. data/lib/active_merchant/billing/gateways/fat_zebra.rb +31 -3
  52. data/lib/active_merchant/billing/gateways/federated_canada.rb +6 -2
  53. data/lib/active_merchant/billing/gateways/first_pay/first_pay_common.rb +15 -0
  54. data/lib/active_merchant/billing/gateways/first_pay/first_pay_json.rb +190 -0
  55. data/lib/active_merchant/billing/gateways/first_pay/first_pay_xml.rb +183 -0
  56. data/lib/active_merchant/billing/gateways/first_pay.rb +6 -172
  57. data/lib/active_merchant/billing/gateways/firstdata_e4.rb +6 -2
  58. data/lib/active_merchant/billing/gateways/firstdata_e4_v27.rb +7 -3
  59. data/lib/active_merchant/billing/gateways/flex_charge.rb +347 -0
  60. data/lib/active_merchant/billing/gateways/garanti.rb +4 -2
  61. data/lib/active_merchant/billing/gateways/global_collect.rb +45 -37
  62. data/lib/active_merchant/billing/gateways/hi_pay.rb +286 -0
  63. data/lib/active_merchant/billing/gateways/hps.rb +1 -1
  64. data/lib/active_merchant/billing/gateways/iats_payments.rb +7 -2
  65. data/lib/active_merchant/billing/gateways/inspire.rb +6 -4
  66. data/lib/active_merchant/billing/gateways/instapay.rb +7 -4
  67. data/lib/active_merchant/billing/gateways/ipg.rb +10 -6
  68. data/lib/active_merchant/billing/gateways/iridium.rb +15 -5
  69. data/lib/active_merchant/billing/gateways/itransact.rb +6 -2
  70. data/lib/active_merchant/billing/gateways/iveri.rb +3 -3
  71. data/lib/active_merchant/billing/gateways/ixopay.rb +2 -2
  72. data/lib/active_merchant/billing/gateways/jetpay.rb +4 -2
  73. data/lib/active_merchant/billing/gateways/jetpay_v2.rb +4 -2
  74. data/lib/active_merchant/billing/gateways/kushki.rb +73 -13
  75. data/lib/active_merchant/billing/gateways/linkpoint.rb +6 -2
  76. data/lib/active_merchant/billing/gateways/litle.rb +33 -50
  77. data/lib/active_merchant/billing/gateways/mastercard.rb +4 -4
  78. data/lib/active_merchant/billing/gateways/maxipago.rb +2 -2
  79. data/lib/active_merchant/billing/gateways/merchant_e_solutions.rb +8 -5
  80. data/lib/active_merchant/billing/gateways/merchant_ware.rb +11 -4
  81. data/lib/active_merchant/billing/gateways/merchant_ware_version_four.rb +11 -4
  82. data/lib/active_merchant/billing/gateways/merchant_warrior.rb +19 -3
  83. data/lib/active_merchant/billing/gateways/mercury.rb +6 -2
  84. data/lib/active_merchant/billing/gateways/metrics_global.rb +8 -6
  85. data/lib/active_merchant/billing/gateways/migs/migs_codes.rb +1 -0
  86. data/lib/active_merchant/billing/gateways/migs.rb +6 -2
  87. data/lib/active_merchant/billing/gateways/mit.rb +25 -20
  88. data/lib/active_merchant/billing/gateways/modern_payments_cim.rb +18 -10
  89. data/lib/active_merchant/billing/gateways/monei.rb +1 -1
  90. data/lib/active_merchant/billing/gateways/moneris.rb +9 -3
  91. data/lib/active_merchant/billing/gateways/money_movers.rb +6 -2
  92. data/lib/active_merchant/billing/gateways/nab_transact.rb +12 -4
  93. data/lib/active_merchant/billing/gateways/net_registry.rb +6 -2
  94. data/lib/active_merchant/billing/gateways/netbanx.rb +1 -3
  95. data/lib/active_merchant/billing/gateways/netbilling.rb +6 -2
  96. data/lib/active_merchant/billing/gateways/network_merchants.rb +6 -2
  97. data/lib/active_merchant/billing/gateways/nmi.rb +23 -6
  98. data/lib/active_merchant/billing/gateways/ogone.rb +6 -2
  99. data/lib/active_merchant/billing/gateways/openpay.rb +4 -2
  100. data/lib/active_merchant/billing/gateways/opp.rb +1 -2
  101. data/lib/active_merchant/billing/gateways/optimal_payment.rb +6 -2
  102. data/lib/active_merchant/billing/gateways/orbital/orbital_soft_descriptors.rb +1 -3
  103. data/lib/active_merchant/billing/gateways/orbital.rb +83 -24
  104. data/lib/active_merchant/billing/gateways/pac_net_raven.rb +7 -4
  105. data/lib/active_merchant/billing/gateways/pay_gate_xml.rb +6 -2
  106. data/lib/active_merchant/billing/gateways/pay_hub.rb +4 -2
  107. data/lib/active_merchant/billing/gateways/pay_junction.rb +6 -2
  108. data/lib/active_merchant/billing/gateways/pay_secure.rb +6 -2
  109. data/lib/active_merchant/billing/gateways/pay_trace.rb +31 -18
  110. data/lib/active_merchant/billing/gateways/payeezy.rb +19 -8
  111. data/lib/active_merchant/billing/gateways/payex.rb +4 -2
  112. data/lib/active_merchant/billing/gateways/payflow/payflow_common_api.rb +1 -1
  113. data/lib/active_merchant/billing/gateways/payflow.rb +1 -3
  114. data/lib/active_merchant/billing/gateways/payment_express.rb +8 -4
  115. data/lib/active_merchant/billing/gateways/paymentez.rb +23 -11
  116. data/lib/active_merchant/billing/gateways/paysafe.rb +12 -11
  117. data/lib/active_merchant/billing/gateways/payscout.rb +7 -4
  118. data/lib/active_merchant/billing/gateways/paystation.rb +7 -3
  119. data/lib/active_merchant/billing/gateways/payway.rb +6 -2
  120. data/lib/active_merchant/billing/gateways/payway_dot_com.rb +3 -3
  121. data/lib/active_merchant/billing/gateways/pin.rb +22 -4
  122. data/lib/active_merchant/billing/gateways/plexo.rb +49 -10
  123. data/lib/active_merchant/billing/gateways/plugnpay.rb +6 -2
  124. data/lib/active_merchant/billing/gateways/priority.rb +6 -5
  125. data/lib/active_merchant/billing/gateways/psigate.rb +6 -2
  126. data/lib/active_merchant/billing/gateways/psl_card.rb +6 -2
  127. data/lib/active_merchant/billing/gateways/qbms.rb +6 -2
  128. data/lib/active_merchant/billing/gateways/quantum.rb +6 -2
  129. data/lib/active_merchant/billing/gateways/quickbooks.rb +6 -5
  130. data/lib/active_merchant/billing/gateways/quickpay/quickpay_v10.rb +7 -4
  131. data/lib/active_merchant/billing/gateways/quickpay/quickpay_v4to7.rb +6 -2
  132. data/lib/active_merchant/billing/gateways/rapyd.rb +148 -46
  133. data/lib/active_merchant/billing/gateways/reach.rb +11 -4
  134. data/lib/active_merchant/billing/gateways/redsys.rb +2 -10
  135. data/lib/active_merchant/billing/gateways/redsys_rest.rb +507 -0
  136. data/lib/active_merchant/billing/gateways/s5.rb +3 -3
  137. data/lib/active_merchant/billing/gateways/safe_charge.rb +38 -17
  138. data/lib/active_merchant/billing/gateways/sage.rb +12 -4
  139. data/lib/active_merchant/billing/gateways/sage_pay.rb +79 -5
  140. data/lib/active_merchant/billing/gateways/sallie_mae.rb +6 -2
  141. data/lib/active_merchant/billing/gateways/secure_net.rb +6 -2
  142. data/lib/active_merchant/billing/gateways/secure_pay.rb +8 -6
  143. data/lib/active_merchant/billing/gateways/secure_pay_au.rb +12 -4
  144. data/lib/active_merchant/billing/gateways/secure_pay_tech.rb +6 -2
  145. data/lib/active_merchant/billing/gateways/securion_pay.rb +24 -10
  146. data/lib/active_merchant/billing/gateways/shift4.rb +17 -20
  147. data/lib/active_merchant/billing/gateways/shift4_v2.rb +117 -0
  148. data/lib/active_merchant/billing/gateways/simetrik.rb +17 -11
  149. data/lib/active_merchant/billing/gateways/skip_jack.rb +6 -2
  150. data/lib/active_merchant/billing/gateways/smart_ps.rb +7 -4
  151. data/lib/active_merchant/billing/gateways/so_easy_pay.rb +4 -2
  152. data/lib/active_merchant/billing/gateways/spreedly_core.rb +2 -4
  153. data/lib/active_merchant/billing/gateways/stripe.rb +63 -19
  154. data/lib/active_merchant/billing/gateways/stripe_payment_intents.rb +280 -88
  155. data/lib/active_merchant/billing/gateways/sum_up.rb +223 -0
  156. data/lib/active_merchant/billing/gateways/swipe_checkout.rb +4 -2
  157. data/lib/active_merchant/billing/gateways/telr.rb +3 -4
  158. data/lib/active_merchant/billing/gateways/trans_first.rb +1 -2
  159. data/lib/active_merchant/billing/gateways/trans_first_transaction_express.rb +8 -16
  160. data/lib/active_merchant/billing/gateways/transact_pro.rb +1 -1
  161. data/lib/active_merchant/billing/gateways/trust_commerce.rb +6 -2
  162. data/lib/active_merchant/billing/gateways/usa_epay_advanced.rb +9 -8
  163. data/lib/active_merchant/billing/gateways/usa_epay_transaction.rb +6 -2
  164. data/lib/active_merchant/billing/gateways/vanco.rb +2 -4
  165. data/lib/active_merchant/billing/gateways/vantiv_express.rb +587 -0
  166. data/lib/active_merchant/billing/gateways/verifi.rb +6 -2
  167. data/lib/active_merchant/billing/gateways/viaklix.rb +6 -2
  168. data/lib/active_merchant/billing/gateways/visanet_peru.rb +2 -2
  169. data/lib/active_merchant/billing/gateways/vpos.rb +4 -4
  170. data/lib/active_merchant/billing/gateways/wirecard.rb +7 -3
  171. data/lib/active_merchant/billing/gateways/wompi.rb +5 -0
  172. data/lib/active_merchant/billing/gateways/worldpay.rb +141 -93
  173. data/lib/active_merchant/billing/gateways/worldpay_online_payments.rb +13 -10
  174. data/lib/active_merchant/billing/gateways/xpay.rb +242 -0
  175. data/lib/active_merchant/billing/network_tokenization_credit_card.rb +1 -1
  176. data/lib/active_merchant/billing/response.rb +2 -2
  177. data/lib/active_merchant/connection.rb +3 -17
  178. data/lib/active_merchant/country.rb +1 -0
  179. data/lib/active_merchant/errors.rb +10 -0
  180. data/lib/active_merchant/version.rb +1 -1
  181. data/lib/support/gateway_support.rb +2 -2
  182. data/lib/support/ssl_verify.rb +4 -4
  183. data/lib/support/ssl_version.rb +6 -6
  184. metadata +30 -9
@@ -1,248 +1,15 @@
1
+ require 'active_merchant/billing/gateways/cecabank/cecabank_xml'
2
+ require 'active_merchant/billing/gateways/cecabank/cecabank_json'
3
+
1
4
  module ActiveMerchant #:nodoc:
2
5
  module Billing #:nodoc:
3
6
  class CecabankGateway < Gateway
4
- self.test_url = 'https://tpv.ceca.es'
5
- self.live_url = 'https://pgw.ceca.es'
6
-
7
- self.supported_countries = ['ES']
8
- self.supported_cardtypes = %i[visa master american_express]
9
- self.homepage_url = 'http://www.ceca.es/es/'
10
- self.display_name = 'Cecabank'
11
- self.default_currency = 'EUR'
12
- self.money_format = :cents
13
-
14
- #### CECA's MAGIC NUMBERS
15
- CECA_NOTIFICATIONS_URL = 'NONE'
16
- CECA_ENCRIPTION = 'SHA2'
17
- CECA_DECIMALS = '2'
18
- CECA_MODE = 'SSL'
19
- CECA_UI_LESS_LANGUAGE = 'XML'
20
- CECA_UI_LESS_LANGUAGE_REFUND = '1'
21
- CECA_UI_LESS_REFUND_PAGE = 'anulacion_xml'
22
- CECA_ACTION_REFUND = 'anulaciones/anularParcial' # use partial refund's URL to avoid time frame limitations and decision logic on client side
23
- CECA_ACTION_PURCHASE = 'tpv/compra'
24
- CECA_CURRENCIES_DICTIONARY = { 'EUR' => 978, 'USD' => 840, 'GBP' => 826 }
25
-
26
- # Creates a new CecabankGateway
27
- #
28
- # The gateway requires four values for connection to be passed
29
- # in the +options+ hash.
30
- #
31
- # ==== Options
32
- #
33
- # * <tt>:merchant_id</tt> -- Cecabank's merchant_id (REQUIRED)
34
- # * <tt>:acquirer_bin</tt> -- Cecabank's acquirer_bin (REQUIRED)
35
- # * <tt>:terminal_id</tt> -- Cecabank's terminal_id (REQUIRED)
36
- # * <tt>:key</tt> -- Cecabank's cypher key (REQUIRED)
37
- # * <tt>:test</tt> -- +true+ or +false+. If true, perform transactions against the test server.
38
- # Otherwise, perform transactions against the production server.
39
- def initialize(options = {})
40
- requires!(options, :merchant_id, :acquirer_bin, :terminal_id, :key)
41
- super
42
- end
43
-
44
- # Perform a purchase, which is essentially an authorization and capture in a single operation.
45
- #
46
- # ==== Parameters
47
- #
48
- # * <tt>money</tt> -- The amount to be purchased as an Integer value in cents.
49
- # * <tt>creditcard</tt> -- The CreditCard details for the transaction.
50
- # * <tt>options</tt> -- A hash of optional parameters.
51
- #
52
- # ==== Options
53
- #
54
- # * <tt>:order_id</tt> -- order_id passed used purchase. (REQUIRED)
55
- # * <tt>:currency</tt> -- currency. Supported: EUR, USD, GBP.
56
- # * <tt>:description</tt> -- description to be pased to the gateway.
57
- def purchase(money, creditcard, options = {})
58
- requires!(options, :order_id)
59
-
60
- post = { 'Descripcion' => options[:description],
61
- 'Num_operacion' => options[:order_id],
62
- 'Idioma' => CECA_UI_LESS_LANGUAGE,
63
- 'Pago_soportado' => CECA_MODE,
64
- 'URL_OK' => CECA_NOTIFICATIONS_URL,
65
- 'URL_NOK' => CECA_NOTIFICATIONS_URL,
66
- 'Importe' => amount(money),
67
- 'TipoMoneda' => CECA_CURRENCIES_DICTIONARY[options[:currency] || currency(money)] }
68
-
69
- add_creditcard(post, creditcard)
70
-
71
- commit(CECA_ACTION_PURCHASE, post)
72
- end
73
-
74
- # Refund a transaction.
75
- #
76
- # This transaction indicates to the gateway that
77
- # money should flow from the merchant to the customer.
78
- #
79
- # ==== Parameters
80
- #
81
- # * <tt>money</tt> -- The amount to be credited to the customer as an Integer value in cents.
82
- # * <tt>identification</tt> -- The reference given from the gateway on purchase (reference, not operation).
83
- # * <tt>options</tt> -- A hash of parameters.
84
- def refund(money, identification, options = {})
85
- reference, order_id = split_authorization(identification)
86
-
87
- post = { 'Referencia' => reference,
88
- 'Num_operacion' => order_id,
89
- 'Idioma' => CECA_UI_LESS_LANGUAGE_REFUND,
90
- 'Pagina' => CECA_UI_LESS_REFUND_PAGE,
91
- 'Importe' => amount(money),
92
- 'TipoMoneda' => CECA_CURRENCIES_DICTIONARY[options[:currency] || currency(money)] }
93
-
94
- commit(CECA_ACTION_REFUND, post)
95
- end
96
-
97
- def supports_scrubbing
98
- true
99
- end
100
-
101
- def scrub(transcript)
102
- transcript.
103
- gsub(%r((Authorization: Basic )\w+), '\1[FILTERED]').
104
- gsub(%r((&?pan=)[^&]*)i, '\1[FILTERED]').
105
- gsub(%r((&?cvv2=)[^&]*)i, '\1[FILTERED]')
106
- end
107
-
108
- private
109
-
110
- def add_creditcard(post, creditcard)
111
- post['PAN'] = creditcard.number
112
- post['Caducidad'] = expdate(creditcard)
113
- post['CVV2'] = creditcard.verification_value
114
- post['Pago_elegido'] = CECA_MODE
115
- end
7
+ self.abstract_class = true
116
8
 
117
- def expdate(creditcard)
118
- "#{format(creditcard.year, :four_digits)}#{format(creditcard.month, :two_digits)}"
119
- end
120
-
121
- def parse(body)
122
- response = {}
123
-
124
- root = REXML::Document.new(body).root
125
-
126
- response[:success] = (root.attributes['valor'] == 'OK')
127
- response[:date] = root.attributes['fecha']
128
- response[:operation_number] = root.attributes['numeroOperacion']
129
- response[:message] = root.attributes['valor']
130
-
131
- if root.elements['OPERACION']
132
- response[:operation_type] = root.elements['OPERACION'].attributes['tipo']
133
- response[:amount] = root.elements['OPERACION/importe'].text.strip
134
- end
135
-
136
- response[:description] = root.elements['OPERACION/descripcion'].text if root.elements['OPERACION/descripcion']
137
- response[:authorization_number] = root.elements['OPERACION/numeroAutorizacion'].text if root.elements['OPERACION/numeroAutorizacion']
138
- response[:reference] = root.elements['OPERACION/referencia'].text if root.elements['OPERACION/referencia']
139
- response[:pan] = root.elements['OPERACION/pan'].text if root.elements['OPERACION/pan']
140
-
141
- if root.elements['ERROR']
142
- response[:error_code] = root.elements['ERROR/codigo'].text
143
- response[:error_message] = root.elements['ERROR/descripcion'].text
144
- else
145
- if root.elements['OPERACION'].attributes['numeroOperacion'] == '000'
146
- response[:authorization] = root.elements['OPERACION/numeroAutorizacion'].text if root.elements['OPERACION/numeroAutorizacion']
147
- else
148
- response[:authorization] = root.attributes['numeroOperacion']
149
- end
150
- end
151
-
152
- return response
153
- rescue REXML::ParseException => e
154
- response[:success] = false
155
- response[:message] = 'Unable to parse the response.'
156
- response[:error_message] = e.message
157
- response
158
- end
159
-
160
- def commit(action, parameters)
161
- parameters.merge!(
162
- 'Cifrado' => CECA_ENCRIPTION,
163
- 'Firma' => generate_signature(action, parameters),
164
- 'Exponente' => CECA_DECIMALS,
165
- 'MerchantID' => options[:merchant_id],
166
- 'AcquirerBIN' => options[:acquirer_bin],
167
- 'TerminalID' => options[:terminal_id]
168
- )
169
- url = (test? ? self.test_url : self.live_url) + "/tpvweb/#{action}.action"
170
- xml = ssl_post("#{url}?", post_data(parameters))
171
- response = parse(xml)
172
- Response.new(
173
- response[:success],
174
- message_from(response),
175
- response,
176
- test: test?,
177
- authorization: build_authorization(response),
178
- error_code: response[:error_code]
179
- )
180
- end
181
-
182
- def message_from(response)
183
- if response[:message] == 'ERROR' && response[:error_message]
184
- response[:error_message]
185
- elsif response[:error_message]
186
- "#{response[:message]} #{response[:error_message]}"
187
- else
188
- response[:message]
189
- end
190
- end
191
-
192
- def post_data(params)
193
- return nil unless params
194
-
195
- params.map do |key, value|
196
- next if value.blank?
197
-
198
- if value.is_a?(Hash)
199
- h = {}
200
- value.each do |k, v|
201
- h["#{key}.#{k}"] = v unless v.blank?
202
- end
203
- post_data(h)
204
- else
205
- "#{key}=#{CGI.escape(value.to_s)}"
206
- end
207
- end.compact.join('&')
208
- end
209
-
210
- def build_authorization(response)
211
- [response[:reference], response[:authorization]].join('|')
212
- end
213
-
214
- def split_authorization(authorization)
215
- authorization.split('|')
216
- end
9
+ def self.new(options = {})
10
+ return CecabankJsonGateway.new(options) if options[:is_rest_json]
217
11
 
218
- def generate_signature(action, parameters)
219
- signature_fields =
220
- case action
221
- when CECA_ACTION_REFUND
222
- options[:key].to_s +
223
- options[:merchant_id].to_s +
224
- options[:acquirer_bin].to_s +
225
- options[:terminal_id].to_s +
226
- parameters['Num_operacion'].to_s +
227
- parameters['Importe'].to_s +
228
- parameters['TipoMoneda'].to_s +
229
- CECA_DECIMALS +
230
- parameters['Referencia'].to_s +
231
- CECA_ENCRIPTION
232
- else
233
- options[:key].to_s +
234
- options[:merchant_id].to_s +
235
- options[:acquirer_bin].to_s +
236
- options[:terminal_id].to_s +
237
- parameters['Num_operacion'].to_s +
238
- parameters['Importe'].to_s +
239
- parameters['TipoMoneda'].to_s +
240
- CECA_DECIMALS +
241
- CECA_ENCRIPTION +
242
- CECA_NOTIFICATIONS_URL +
243
- CECA_NOTIFICATIONS_URL
244
- end
245
- Digest::SHA2.hexdigest(signature_fields)
12
+ CecabankXmlGateway.new(options)
246
13
  end
247
14
  end
248
15
  end