activemerchant 1.83.0 → 1.84.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (146) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +19 -0
  3. data/lib/active_merchant/billing/base.rb +1 -1
  4. data/lib/active_merchant/billing/check.rb +3 -2
  5. data/lib/active_merchant/billing/compatibility.rb +2 -4
  6. data/lib/active_merchant/billing/credit_card.rb +6 -39
  7. data/lib/active_merchant/billing/credit_card_formatting.rb +0 -1
  8. data/lib/active_merchant/billing/credit_card_methods.rb +67 -44
  9. data/lib/active_merchant/billing/gateway.rb +1 -8
  10. data/lib/active_merchant/billing/gateways/adyen.rb +1 -1
  11. data/lib/active_merchant/billing/gateways/allied_wallet.rb +0 -1
  12. data/lib/active_merchant/billing/gateways/authorize_net.rb +0 -1
  13. data/lib/active_merchant/billing/gateways/axcessms.rb +1 -1
  14. data/lib/active_merchant/billing/gateways/balanced.rb +9 -9
  15. data/lib/active_merchant/billing/gateways/banwire.rb +5 -5
  16. data/lib/active_merchant/billing/gateways/barclaycard_smartpay.rb +1 -1
  17. data/lib/active_merchant/billing/gateways/beanstream.rb +1 -0
  18. data/lib/active_merchant/billing/gateways/beanstream/beanstream_core.rb +0 -1
  19. data/lib/active_merchant/billing/gateways/blue_snap.rb +5 -7
  20. data/lib/active_merchant/billing/gateways/braintree_blue.rb +12 -6
  21. data/lib/active_merchant/billing/gateways/bridge_pay.rb +0 -1
  22. data/lib/active_merchant/billing/gateways/card_connect.rb +2 -2
  23. data/lib/active_merchant/billing/gateways/card_save.rb +1 -1
  24. data/lib/active_merchant/billing/gateways/card_stream.rb +9 -18
  25. data/lib/active_merchant/billing/gateways/cardknox.rb +8 -9
  26. data/lib/active_merchant/billing/gateways/cc5.rb +0 -1
  27. data/lib/active_merchant/billing/gateways/cecabank.rb +0 -1
  28. data/lib/active_merchant/billing/gateways/cenpos.rb +1 -1
  29. data/lib/active_merchant/billing/gateways/checkout_v2.rb +6 -6
  30. data/lib/active_merchant/billing/gateways/citrus_pay.rb +1 -1
  31. data/lib/active_merchant/billing/gateways/commercegate.rb +0 -1
  32. data/lib/active_merchant/billing/gateways/conekta.rb +6 -8
  33. data/lib/active_merchant/billing/gateways/creditcall.rb +1 -2
  34. data/lib/active_merchant/billing/gateways/ct_payment.rb +1 -1
  35. data/lib/active_merchant/billing/gateways/culqi.rb +8 -10
  36. data/lib/active_merchant/billing/gateways/cyber_source.rb +1 -2
  37. data/lib/active_merchant/billing/gateways/data_cash.rb +16 -29
  38. data/lib/active_merchant/billing/gateways/dibs.rb +1 -7
  39. data/lib/active_merchant/billing/gateways/digitzs.rb +1 -1
  40. data/lib/active_merchant/billing/gateways/efsnet.rb +0 -4
  41. data/lib/active_merchant/billing/gateways/element.rb +1 -1
  42. data/lib/active_merchant/billing/gateways/epay.rb +8 -9
  43. data/lib/active_merchant/billing/gateways/eway.rb +1 -0
  44. data/lib/active_merchant/billing/gateways/eway_managed.rb +2 -3
  45. data/lib/active_merchant/billing/gateways/exact.rb +0 -2
  46. data/lib/active_merchant/billing/gateways/ezic.rb +0 -1
  47. data/lib/active_merchant/billing/gateways/fat_zebra.rb +9 -11
  48. data/lib/active_merchant/billing/gateways/federated_canada.rb +1 -1
  49. data/lib/active_merchant/billing/gateways/first_giving.rb +3 -3
  50. data/lib/active_merchant/billing/gateways/first_pay.rb +5 -0
  51. data/lib/active_merchant/billing/gateways/firstdata_e4.rb +2 -2
  52. data/lib/active_merchant/billing/gateways/garanti.rb +4 -5
  53. data/lib/active_merchant/billing/gateways/global_collect.rb +6 -7
  54. data/lib/active_merchant/billing/gateways/iats_payments.rb +1 -1
  55. data/lib/active_merchant/billing/gateways/inspire.rb +2 -2
  56. data/lib/active_merchant/billing/gateways/ipp.rb +1 -1
  57. data/lib/active_merchant/billing/gateways/iridium.rb +3 -3
  58. data/lib/active_merchant/billing/gateways/iveri.rb +1 -1
  59. data/lib/active_merchant/billing/gateways/komoju.rb +1 -1
  60. data/lib/active_merchant/billing/gateways/kushki.rb +7 -9
  61. data/lib/active_merchant/billing/gateways/latitude19.rb +29 -34
  62. data/lib/active_merchant/billing/gateways/linkpoint.rb +1 -3
  63. data/lib/active_merchant/billing/gateways/litle.rb +1 -1
  64. data/lib/active_merchant/billing/gateways/mastercard.rb +1 -2
  65. data/lib/active_merchant/billing/gateways/mercado_pago.rb +0 -1
  66. data/lib/active_merchant/billing/gateways/merchant_e_solutions.rb +0 -1
  67. data/lib/active_merchant/billing/gateways/merchant_one.rb +1 -1
  68. data/lib/active_merchant/billing/gateways/merchant_ware.rb +3 -3
  69. data/lib/active_merchant/billing/gateways/merchant_ware_version_four.rb +3 -3
  70. data/lib/active_merchant/billing/gateways/mercury.rb +1 -1
  71. data/lib/active_merchant/billing/gateways/micropayment.rb +0 -2
  72. data/lib/active_merchant/billing/gateways/modern_payments.rb +1 -0
  73. data/lib/active_merchant/billing/gateways/modern_payments_cim.rb +4 -3
  74. data/lib/active_merchant/billing/gateways/moneris.rb +0 -1
  75. data/lib/active_merchant/billing/gateways/moneris_us.rb +1 -2
  76. data/lib/active_merchant/billing/gateways/money_movers.rb +1 -1
  77. data/lib/active_merchant/billing/gateways/mundipagg.rb +9 -9
  78. data/lib/active_merchant/billing/gateways/nab_transact.rb +0 -1
  79. data/lib/active_merchant/billing/gateways/net_registry.rb +1 -0
  80. data/lib/active_merchant/billing/gateways/nmi.rb +1 -2
  81. data/lib/active_merchant/billing/gateways/ogone.rb +9 -10
  82. data/lib/active_merchant/billing/gateways/openpay.rb +7 -8
  83. data/lib/active_merchant/billing/gateways/opp.rb +110 -112
  84. data/lib/active_merchant/billing/gateways/optimal_payment.rb +1 -4
  85. data/lib/active_merchant/billing/gateways/orbital.rb +1 -2
  86. data/lib/active_merchant/billing/gateways/pagarme.rb +3 -5
  87. data/lib/active_merchant/billing/gateways/pay_conex.rb +0 -1
  88. data/lib/active_merchant/billing/gateways/pay_junction_v2.rb +10 -12
  89. data/lib/active_merchant/billing/gateways/pay_secure.rb +1 -1
  90. data/lib/active_merchant/billing/gateways/paybox_direct.rb +0 -1
  91. data/lib/active_merchant/billing/gateways/payeezy.rb +15 -4
  92. data/lib/active_merchant/billing/gateways/payex.rb +5 -6
  93. data/lib/active_merchant/billing/gateways/payflow.rb +0 -4
  94. data/lib/active_merchant/billing/gateways/payflow/payflow_common_api.rb +1 -2
  95. data/lib/active_merchant/billing/gateways/payflow/payflow_response.rb +1 -1
  96. data/lib/active_merchant/billing/gateways/payflow_express.rb +54 -55
  97. data/lib/active_merchant/billing/gateways/payflow_uk.rb +1 -1
  98. data/lib/active_merchant/billing/gateways/payment_express.rb +0 -6
  99. data/lib/active_merchant/billing/gateways/paymill.rb +0 -2
  100. data/lib/active_merchant/billing/gateways/paypal.rb +0 -8
  101. data/lib/active_merchant/billing/gateways/payscout.rb +0 -1
  102. data/lib/active_merchant/billing/gateways/paystation.rb +2 -2
  103. data/lib/active_merchant/billing/gateways/payu_latam.rb +37 -32
  104. data/lib/active_merchant/billing/gateways/pin.rb +2 -2
  105. data/lib/active_merchant/billing/gateways/plugnpay.rb +1 -0
  106. data/lib/active_merchant/billing/gateways/psl_card.rb +3 -10
  107. data/lib/active_merchant/billing/gateways/quantum.rb +4 -4
  108. data/lib/active_merchant/billing/gateways/quickpay/quickpay_common.rb +0 -3
  109. data/lib/active_merchant/billing/gateways/quickpay/quickpay_v10.rb +3 -7
  110. data/lib/active_merchant/billing/gateways/realex.rb +6 -8
  111. data/lib/active_merchant/billing/gateways/redsys.rb +1 -0
  112. data/lib/active_merchant/billing/gateways/s5.rb +0 -1
  113. data/lib/active_merchant/billing/gateways/safe_charge.rb +4 -4
  114. data/lib/active_merchant/billing/gateways/sage.rb +16 -13
  115. data/lib/active_merchant/billing/gateways/sage_pay.rb +2 -9
  116. data/lib/active_merchant/billing/gateways/secure_net.rb +0 -1
  117. data/lib/active_merchant/billing/gateways/securion_pay.rb +3 -6
  118. data/lib/active_merchant/billing/gateways/skip_jack.rb +2 -2
  119. data/lib/active_merchant/billing/gateways/smart_ps.rb +2 -4
  120. data/lib/active_merchant/billing/gateways/so_easy_pay.rb +5 -5
  121. data/lib/active_merchant/billing/gateways/spreedly_core.rb +1 -2
  122. data/lib/active_merchant/billing/gateways/stripe.rb +60 -15
  123. data/lib/active_merchant/billing/gateways/telr.rb +5 -6
  124. data/lib/active_merchant/billing/gateways/tns.rb +1 -1
  125. data/lib/active_merchant/billing/gateways/trans_first.rb +0 -1
  126. data/lib/active_merchant/billing/gateways/trexle.rb +6 -5
  127. data/lib/active_merchant/billing/gateways/trust_commerce.rb +1 -0
  128. data/lib/active_merchant/billing/gateways/usa_epay_advanced.rb +2 -2
  129. data/lib/active_merchant/billing/gateways/usa_epay_transaction.rb +0 -1
  130. data/lib/active_merchant/billing/gateways/vanco.rb +1 -1
  131. data/lib/active_merchant/billing/gateways/viaklix.rb +1 -0
  132. data/lib/active_merchant/billing/gateways/visanet_peru.rb +28 -32
  133. data/lib/active_merchant/billing/gateways/wepay.rb +0 -1
  134. data/lib/active_merchant/billing/gateways/wirecard.rb +2 -1
  135. data/lib/active_merchant/billing/gateways/worldpay.rb +1 -4
  136. data/lib/active_merchant/billing/gateways/worldpay_online_payments.rb +5 -8
  137. data/lib/active_merchant/connection.rb +0 -2
  138. data/lib/active_merchant/country.rb +1 -0
  139. data/lib/active_merchant/net_http_ssl_connection.rb +1 -1
  140. data/lib/active_merchant/network_connection_retries.rb +1 -0
  141. data/lib/active_merchant/post_data.rb +1 -0
  142. data/lib/active_merchant/posts_data.rb +0 -2
  143. data/lib/active_merchant/version.rb +1 -1
  144. data/lib/support/gateway_support.rb +3 -4
  145. data/lib/support/ssl_verify.rb +0 -1
  146. metadata +2 -2
@@ -10,7 +10,7 @@ module ActiveMerchant #:nodoc:
10
10
  'NL', 'NO', 'PL', 'PT', 'RO', 'SK', 'SI', 'ES', 'SE', 'CH']
11
11
 
12
12
  # The card types supported by the payment gateway
13
- self.supported_cardtypes = [:visa, :master, :american_express, :discover, :diners_club, :solo] # :switch?
13
+ self.supported_cardtypes = [:visa, :master, :american_express, :discover, :diners_club]
14
14
 
15
15
  # The homepage URL of the gateway
16
16
  self.homepage_url = 'http://www.optimalpayments.com/'
@@ -19,7 +19,6 @@ module ActiveMerchant #:nodoc:
19
19
  self.display_name = 'Optimal Payments'
20
20
 
21
21
  def initialize(options = {})
22
-
23
22
  if(options[:login])
24
23
  ActiveMerchant.deprecated("The 'login' option is deprecated in favor of 'store_id' and will be removed in a future version.")
25
24
  options[:store_id] = options[:login]
@@ -320,8 +319,6 @@ module ActiveMerchant #:nodoc:
320
319
  'american_express'=> 'AM',
321
320
  'discover' => 'DI',
322
321
  'diners_club' => 'DC',
323
- #'switch' => '',
324
- 'solo' => 'SO'
325
322
  }[key]
326
323
  end
327
324
 
@@ -251,7 +251,6 @@ module ActiveMerchant #:nodoc:
251
251
  commit(order, :void, options[:trace_number])
252
252
  end
253
253
 
254
-
255
254
  # ==== Customer Profiles
256
255
  # :customer_ref_num should be set unless you're happy with Orbital providing one
257
256
  #
@@ -398,7 +397,7 @@ module ActiveMerchant #:nodoc:
398
397
  end
399
398
 
400
399
  xml.tag! :AVSname, ((creditcard && creditcard.name) ? creditcard.name[0..29] : nil)
401
- xml.tag! :AVScountryCode, (avs_supported ? (byte_limit(format_address_field(address[:country]), 2)) : '')
400
+ xml.tag! :AVScountryCode, (avs_supported ? byte_limit(format_address_field(address[:country]), 2) : '')
402
401
 
403
402
  # Needs to come after AVScountryCode
404
403
  add_destination_address(xml, address) if avs_supported
@@ -175,11 +175,9 @@ module ActiveMerchant #:nodoc:
175
175
  end
176
176
 
177
177
  def response_error(raw_response)
178
- begin
179
- parse(raw_response)
180
- rescue JSON::ParserError
181
- json_error(raw_response)
182
- end
178
+ parse(raw_response)
179
+ rescue JSON::ParserError
180
+ json_error(raw_response)
183
181
  end
184
182
 
185
183
  def json_error(raw_response)
@@ -213,7 +213,6 @@ module ActiveMerchant #:nodoc:
213
213
  :cvv_result => CVVResult.new(response['cvv2_response']),
214
214
  test: test?
215
215
  )
216
-
217
216
  rescue JSON::ParserError
218
217
  unparsable_response(raw_response)
219
218
  end
@@ -141,7 +141,7 @@ module ActiveMerchant #:nodoc:
141
141
  'Authorization' => 'Basic ' + Base64.encode64("#{@options[:api_login]}:#{@options[:api_password]}").strip,
142
142
  'Content-Type' => 'application/x-www-form-urlencoded;charset=UTF-8',
143
143
  'Accept' => 'application/json',
144
- 'X-PJ-Application-Key' => "#{@options[:api_key]}"
144
+ 'X-PJ-Application-Key' => @options[:api_key].to_s
145
145
  }
146
146
  end
147
147
 
@@ -154,17 +154,15 @@ module ActiveMerchant #:nodoc:
154
154
  end
155
155
 
156
156
  def parse(body)
157
- begin
158
- JSON.parse(body)
159
- rescue JSON::ParserError
160
- message = 'Invalid JSON response received from PayJunctionV2Gateway. Please contact PayJunctionV2Gateway if you continue to receive this message.'
161
- message += " (The raw response returned by the API was #{body.inspect})"
162
- {
163
- 'errors' => [{
164
- 'message' => message
165
- }]
166
- }
167
- end
157
+ JSON.parse(body)
158
+ rescue JSON::ParserError
159
+ message = 'Invalid JSON response received from PayJunctionV2Gateway. Please contact PayJunctionV2Gateway if you continue to receive this message.'
160
+ message += " (The raw response returned by the API was #{body.inspect})"
161
+ {
162
+ 'errors' => [{
163
+ 'message' => message
164
+ }]
165
+ }
168
166
  end
169
167
 
170
168
  def success_from(response)
@@ -39,6 +39,7 @@ module ActiveMerchant #:nodoc:
39
39
  end
40
40
 
41
41
  private
42
+
42
43
  # Used for capturing, which is currently not supported.
43
44
  def add_reference(post, identification)
44
45
  auth, trans_id = identification.split(';')
@@ -71,7 +72,6 @@ module ActiveMerchant #:nodoc:
71
72
  :test => test_response?(response),
72
73
  :authorization => authorization_from(response)
73
74
  )
74
-
75
75
  end
76
76
 
77
77
  def successful?(response)
@@ -174,7 +174,6 @@ module ActiveMerchant #:nodoc:
174
174
  end
175
175
 
176
176
  def post_data(action, parameters = {})
177
-
178
177
  parameters.update(
179
178
  :version => API_VERSION,
180
179
  :type => TRANSACTIONS[action.to_sym],
@@ -34,6 +34,7 @@ module ActiveMerchant
34
34
  params = payment_method.is_a?(String) ? { transaction_type: 'recurring' } : { transaction_type: 'purchase' }
35
35
 
36
36
  add_invoice(params, options)
37
+ add_reversal_id(params, options)
37
38
  add_payment_method(params, payment_method, options)
38
39
  add_address(params, options)
39
40
  add_amount(params, amount, options)
@@ -46,6 +47,7 @@ module ActiveMerchant
46
47
  params = {transaction_type: 'authorize'}
47
48
 
48
49
  add_invoice(params, options)
50
+ add_reversal_id(params, options)
49
51
  add_payment_method(params, payment_method, options)
50
52
  add_address(params, options)
51
53
  add_amount(params, amount, options)
@@ -84,7 +86,7 @@ module ActiveMerchant
84
86
  def void(authorization, options = {})
85
87
  params = {transaction_type: 'void'}
86
88
 
87
- add_authorization_info(params, authorization)
89
+ add_authorization_info(params, authorization, options)
88
90
  add_amount(params, amount_from_authorization(authorization), options)
89
91
 
90
92
  commit(params, options)
@@ -123,15 +125,24 @@ module ActiveMerchant
123
125
  params[:merchant_ref] = options[:order_id]
124
126
  end
125
127
 
128
+ def add_reversal_id(params, options)
129
+ params[:reversal_id] = options[:reversal_id] if options[:reversal_id]
130
+ end
131
+
126
132
  def amount_from_authorization(authorization)
127
133
  authorization.split('|').last.to_i
128
134
  end
129
135
 
130
- def add_authorization_info(params, authorization)
136
+ def add_authorization_info(params, authorization, options = {})
131
137
  transaction_id, transaction_tag, method, _ = authorization.split('|')
132
- params[:transaction_id] = transaction_id
133
- params[:transaction_tag] = transaction_tag
134
138
  params[:method] = (method == 'token') ? 'credit_card' : method
139
+
140
+ if options[:reversal_id]
141
+ params[:reversal_id] = options[:reversal_id]
142
+ else
143
+ params[:transaction_id] = transaction_id
144
+ params[:transaction_tag] = transaction_tag
145
+ end
135
146
  end
136
147
 
137
148
  def add_creditcard_for_tokenization(params, payment_method, options)
@@ -70,7 +70,6 @@ module ActiveMerchant #:nodoc:
70
70
  # stored authorization
71
71
  send_autopay(amount, payment_method, true, options)
72
72
  end
73
-
74
73
  end
75
74
 
76
75
  # Public: Send a purchase Payex request
@@ -387,11 +386,11 @@ module ActiveMerchant #:nodoc:
387
386
  }
388
387
  response = parse(ssl_post(url, request, headers))
389
388
  Response.new(success?(response),
390
- message_from(response),
391
- response,
392
- test: test?,
393
- authorization: build_authorization(response)
394
- )
389
+ message_from(response),
390
+ response,
391
+ test: test?,
392
+ authorization: build_authorization(response)
393
+ )
395
394
  end
396
395
 
397
396
  def build_authorization(response)
@@ -237,10 +237,6 @@ module ActiveMerchant #:nodoc:
237
237
  end
238
238
  end
239
239
 
240
- if requires_start_date_or_issue_number?(credit_card)
241
- xml.tag!('ExtData', 'Name' => 'CardStart', 'Value' => startdate(credit_card)) unless credit_card.start_month.blank? || credit_card.start_year.blank?
242
- xml.tag!('ExtData', 'Name' => 'CardIssue', 'Value' => format(credit_card.issue_number, :two_digits)) unless credit_card.issue_number.blank?
243
- end
244
240
  xml.tag! 'ExtData', 'Name' => 'LASTNAME', 'Value' => credit_card.last_name
245
241
  end
246
242
  end
@@ -43,8 +43,6 @@ module ActiveMerchant #:nodoc:
43
43
  :american_express => 'Amex',
44
44
  :jcb => 'JCB',
45
45
  :diners_club => 'DinersClub',
46
- :switch => 'Switch',
47
- :solo => 'Solo'
48
46
  }
49
47
 
50
48
  TRANSACTIONS = {
@@ -80,6 +78,7 @@ module ActiveMerchant #:nodoc:
80
78
  end
81
79
 
82
80
  private
81
+
83
82
  def build_request(body, options = {})
84
83
  xml = Builder::XmlMarkup.new
85
84
  xml.instruct!
@@ -6,7 +6,7 @@ module ActiveMerchant #:nodoc:
6
6
  end
7
7
 
8
8
  def payment_history
9
- @payment_history ||= @params['rp_payment_result'].collect{ |result| result.stringify_keys } rescue []
9
+ @payment_history ||= @params['rp_payment_result'].collect(&:stringify_keys) rescue []
10
10
  end
11
11
  end
12
12
  end
@@ -4,60 +4,59 @@ require 'active_merchant/billing/gateways/paypal_express_common'
4
4
 
5
5
  module ActiveMerchant #:nodoc:
6
6
  module Billing #:nodoc:
7
- # ==General Parameters
8
- # The following parameters are supported for #setup_authorization, #setup_purchase, #authorize and #purchase transactions. I've read
9
- # in the docs that they recommend you pass the exact same parameters to both setup and authorize/purchase.
10
- #
11
- # This information was gleaned from a mix of:
12
- # * {PayFlow documentation}[https://developer.paypal.com/docs/classic/payflow/integration-guide/]
13
- # * previous ActiveMerchant code
14
- # * trial & error
15
- #
16
- # The following parameters are currently supported.
17
- # [<tt>:ip</tt>] (opt) Customer IP Address
18
- # [<tt>:order_id</tt>] (opt) An order or invoice number. This will be passed through to the Payflow backend at manager.paypal.com, and show up as "Supplier Reference #"
19
- # [<tt>:description</tt>] (opt) Order description, shown to buyer (after redirected to PayPal). If Order Line Items are used (see below), then the description is suppressed. This will not be passed through to the Payflow backend.
20
- # [<tt>:billing_address</tt>] (opt) See ActiveMerchant::Billing::Gateway for details
21
- # [<tt>:shipping_address</tt>] (opt) See ActiveMerchant::Billing::Gateway for details
22
- # [<tt>:currency</tt>] (req) Currency of transaction, will be set to USD by default for PayFlow Express if not specified
23
- # [<tt>:email</tt>] (opt) Email of buyer; used to pre-fill PayPal login screen
24
- # [<tt>:payer_id</tt>] (opt) Unique PayPal buyer account identification number, as returned by details_for request
25
- # [<tt>:token</tt>] (req for #authorize & #purchase) Token returned by setup transaction
26
- # [<tt>:no_shipping</tt>] (opt) Boolean for whether or not to display shipping address to buyer
27
- # [<tt>:address_override</tt>] (opt) Boolean. If true, display shipping address passed by parameters, rather than shipping address on file with PayPal
28
- # [<tt>:allow_note</tt>] (opt) Boolean for permitting buyer to add note during checkout. Note contents can be retrieved with details_for transaction
29
- # [<tt>:return_url</tt>] (req) URL to which the buyer’s browser is returned after choosing to pay.
30
- # [<tt>:cancel_return_url</tt>] (req) URL to which the buyer is returned if the buyer cancels the order.
31
- # [<tt>:notify_url</tt>] (opt) Your URL for receiving Instant Payment Notification (IPN) about this transaction.
32
- # [<tt>:comment</tt>] (opt) Comment field which will be reported to Payflow backend (at manager.paypal.com) as Comment1
33
- # [<tt>:comment2</tt>] (opt) Comment field which will be reported to Payflow backend (at manager.paypal.com) as Comment2
34
- # [<tt>:discount</tt>] (opt) Total discounts in cents
35
- #
36
- # ==Line Items
37
- # Support for order line items is available, but has to be enabled on the PayFlow backend. This is what I was told by Todd Sieber at Technical Support:
38
- #
39
- # <em>You will need to call Payflow Support at 1-888-883-9770, choose option #2. Request that they update your account in "Pandora" under Product Settings >> PayPal Mark and update the Features Bitmap to 1111111111111112. This is 15 ones and a two.</em>
40
- #
41
- # See here[https://www.x.com/message/206214#206214] for the forum discussion (requires login to {x.com}[https://x.com]
42
- #
43
- # [<tt>:items</tt>] (opt) Array of Order Line Items hashes. These are shown to the buyer after redirect to PayPal.
44
- #
45
- #
46
- #
47
- # The following keys are supported for line items:
48
- # [<tt>:name</tt>] Name of line item
49
- # [<tt>:description</tt>] Description of line item
50
- # [<tt>:amount</tt>] Line Item Amount in Cents (as Integer)
51
- # [<tt>:quantity</tt>] Line Item Quantity (default to 1 if left blank)
52
- #
53
- # ====Customization of Payment Page
54
- # [<tt>:page_style</tt>] (opt) Your URL for receiving Instant Payment Notification (IPN) about this transaction.
55
- # [<tt>:header_image</tt>] (opt) Your URL for receiving Instant Payment Notification (IPN) about this transaction.
56
- # [<tt>:background_color</tt>] (opt) Your URL for receiving Instant Payment Notification (IPN) about this transaction.
57
- # ====Additional options for old Checkout Experience, being phased out in 2010 and 2011
58
- # [<tt>:header_background_color</tt>] (opt) Your URL for receiving Instant Payment Notification (IPN) about this transaction.
59
- # [<tt>:header_border_color</tt>] (opt) Your URL for receiving Instant Payment Notification (IPN) about this transaction.
60
-
7
+ # ==General Parameters
8
+ # The following parameters are supported for #setup_authorization, #setup_purchase, #authorize and #purchase transactions. I've read
9
+ # in the docs that they recommend you pass the exact same parameters to both setup and authorize/purchase.
10
+ #
11
+ # This information was gleaned from a mix of:
12
+ # * {PayFlow documentation}[https://developer.paypal.com/docs/classic/payflow/integration-guide/]
13
+ # * previous ActiveMerchant code
14
+ # * trial & error
15
+ #
16
+ # The following parameters are currently supported.
17
+ # [<tt>:ip</tt>] (opt) Customer IP Address
18
+ # [<tt>:order_id</tt>] (opt) An order or invoice number. This will be passed through to the Payflow backend at manager.paypal.com, and show up as "Supplier Reference #"
19
+ # [<tt>:description</tt>] (opt) Order description, shown to buyer (after redirected to PayPal). If Order Line Items are used (see below), then the description is suppressed. This will not be passed through to the Payflow backend.
20
+ # [<tt>:billing_address</tt>] (opt) See ActiveMerchant::Billing::Gateway for details
21
+ # [<tt>:shipping_address</tt>] (opt) See ActiveMerchant::Billing::Gateway for details
22
+ # [<tt>:currency</tt>] (req) Currency of transaction, will be set to USD by default for PayFlow Express if not specified
23
+ # [<tt>:email</tt>] (opt) Email of buyer; used to pre-fill PayPal login screen
24
+ # [<tt>:payer_id</tt>] (opt) Unique PayPal buyer account identification number, as returned by details_for request
25
+ # [<tt>:token</tt>] (req for #authorize & #purchase) Token returned by setup transaction
26
+ # [<tt>:no_shipping</tt>] (opt) Boolean for whether or not to display shipping address to buyer
27
+ # [<tt>:address_override</tt>] (opt) Boolean. If true, display shipping address passed by parameters, rather than shipping address on file with PayPal
28
+ # [<tt>:allow_note</tt>] (opt) Boolean for permitting buyer to add note during checkout. Note contents can be retrieved with details_for transaction
29
+ # [<tt>:return_url</tt>] (req) URL to which the buyer’s browser is returned after choosing to pay.
30
+ # [<tt>:cancel_return_url</tt>] (req) URL to which the buyer is returned if the buyer cancels the order.
31
+ # [<tt>:notify_url</tt>] (opt) Your URL for receiving Instant Payment Notification (IPN) about this transaction.
32
+ # [<tt>:comment</tt>] (opt) Comment field which will be reported to Payflow backend (at manager.paypal.com) as Comment1
33
+ # [<tt>:comment2</tt>] (opt) Comment field which will be reported to Payflow backend (at manager.paypal.com) as Comment2
34
+ # [<tt>:discount</tt>] (opt) Total discounts in cents
35
+ #
36
+ # ==Line Items
37
+ # Support for order line items is available, but has to be enabled on the PayFlow backend. This is what I was told by Todd Sieber at Technical Support:
38
+ #
39
+ # <em>You will need to call Payflow Support at 1-888-883-9770, choose option #2. Request that they update your account in "Pandora" under Product Settings >> PayPal Mark and update the Features Bitmap to 1111111111111112. This is 15 ones and a two.</em>
40
+ #
41
+ # See here[https://www.x.com/message/206214#206214] for the forum discussion (requires login to {x.com}[https://x.com]
42
+ #
43
+ # [<tt>:items</tt>] (opt) Array of Order Line Items hashes. These are shown to the buyer after redirect to PayPal.
44
+ #
45
+ #
46
+ #
47
+ # The following keys are supported for line items:
48
+ # [<tt>:name</tt>] Name of line item
49
+ # [<tt>:description</tt>] Description of line item
50
+ # [<tt>:amount</tt>] Line Item Amount in Cents (as Integer)
51
+ # [<tt>:quantity</tt>] Line Item Quantity (default to 1 if left blank)
52
+ #
53
+ # ====Customization of Payment Page
54
+ # [<tt>:page_style</tt>] (opt) Your URL for receiving Instant Payment Notification (IPN) about this transaction.
55
+ # [<tt>:header_image</tt>] (opt) Your URL for receiving Instant Payment Notification (IPN) about this transaction.
56
+ # [<tt>:background_color</tt>] (opt) Your URL for receiving Instant Payment Notification (IPN) about this transaction.
57
+ # ====Additional options for old Checkout Experience, being phased out in 2010 and 2011
58
+ # [<tt>:header_background_color</tt>] (opt) Your URL for receiving Instant Payment Notification (IPN) about this transaction.
59
+ # [<tt>:header_border_color</tt>] (opt) Your URL for receiving Instant Payment Notification (IPN) about this transaction.
61
60
 
62
61
  class PayflowExpressGateway < Gateway
63
62
  include PayflowCommonAPI
@@ -109,6 +108,7 @@ module ActiveMerchant #:nodoc:
109
108
  end
110
109
 
111
110
  private
111
+
112
112
  def build_get_express_details_request(token)
113
113
  xml = Builder::XmlMarkup.new :indent => 2
114
114
  xml.tag! 'GetExpressCheckout' do
@@ -180,7 +180,6 @@ module ActiveMerchant #:nodoc:
180
180
  end
181
181
  xml.tag! 'DiscountAmt', amount(options[:discount]) if options[:discount]
182
182
  xml.tag! 'TotalAmt', amount(money), 'Currency' => options[:currency] || currency(money)
183
-
184
183
  end
185
184
 
186
185
  xml.tag! 'Tender' do
@@ -11,7 +11,7 @@ module ActiveMerchant #:nodoc:
11
11
  @express ||= PayflowExpressUkGateway.new(@options)
12
12
  end
13
13
 
14
- self.supported_cardtypes = [:visa, :master, :american_express, :discover, :solo, :switch]
14
+ self.supported_cardtypes = [:visa, :master, :american_express, :discover]
15
15
  self.supported_countries = ['GB']
16
16
  self.homepage_url = 'https://www.paypal.com/uk/webapps/mpp/pro'
17
17
  self.display_name = 'PayPal Payments Pro (UK)'
@@ -2,7 +2,6 @@ require 'rexml/document'
2
2
 
3
3
  module ActiveMerchant #:nodoc:
4
4
  module Billing #:nodoc:
5
-
6
5
  # In NZ DPS supports ANZ, Westpac, National Bank, ASB and BNZ.
7
6
  # In Australia DPS supports ANZ, NAB, Westpac, CBA, St George and Bank of South Australia.
8
7
  # The Maybank in Malaysia is supported and the Citibank for Singapore.
@@ -194,11 +193,6 @@ module ActiveMerchant #:nodoc:
194
193
  xml.add_element('Cvc2').text = credit_card.verification_value
195
194
  xml.add_element('Cvc2Presence').text = '1'
196
195
  end
197
-
198
- if requires_start_date_or_issue_number?(credit_card)
199
- xml.add_element('DateStart').text = format_date(credit_card.start_month, credit_card.start_year) unless credit_card.start_month.blank? || credit_card.start_year.blank?
200
- xml.add_element('IssueNumber').text = credit_card.issue_number unless credit_card.issue_number.blank?
201
- end
202
196
  end
203
197
 
204
198
  def add_billing_token(xml, token)
@@ -240,7 +240,6 @@ module ActiveMerchant #:nodoc:
240
240
  31203 => 'Pending due to currency conflict (accept manually)',
241
241
  31204 => 'Pending due to fraud filters (accept manually)',
242
242
 
243
-
244
243
  40000 => 'Problem with transaction data',
245
244
  40001 => 'Problem with payment data',
246
245
  40002 => 'Invalid checksum',
@@ -321,7 +320,6 @@ module ActiveMerchant #:nodoc:
321
320
  RESPONSE_CODES[code] || code.to_s
322
321
  end
323
322
 
324
-
325
323
  class ResponseParser
326
324
  attr_reader :raw_response, :parsed, :succeeded, :message, :options
327
325
 
@@ -81,12 +81,6 @@ module ActiveMerchant #:nodoc:
81
81
  xml.tag! 'n2:ExpYear', format(credit_card.year, :four_digits)
82
82
  xml.tag! 'n2:CVV2', credit_card.verification_value unless credit_card.verification_value.blank?
83
83
 
84
- if [ 'switch', 'solo' ].include?(card_brand(credit_card).to_s)
85
- xml.tag! 'n2:StartMonth', format(credit_card.start_month, :two_digits) unless credit_card.start_month.blank?
86
- xml.tag! 'n2:StartYear', format(credit_card.start_year, :four_digits) unless credit_card.start_year.blank?
87
- xml.tag! 'n2:IssueNumber', format(credit_card.issue_number, :two_digits) unless credit_card.issue_number.blank?
88
- end
89
-
90
84
  xml.tag! 'n2:CardOwner' do
91
85
  xml.tag! 'n2:PayerName' do
92
86
  xml.tag! 'n2:FirstName', credit_card.first_name
@@ -110,8 +104,6 @@ module ActiveMerchant #:nodoc:
110
104
  when 'master' then 'MasterCard'
111
105
  when 'discover' then 'Discover'
112
106
  when 'american_express' then 'Amex'
113
- when 'switch' then 'Switch'
114
- when 'solo' then 'Solo'
115
107
  end
116
108
  end
117
109
 
@@ -41,7 +41,6 @@ module ActiveMerchant #:nodoc:
41
41
  commit('capture', money, post)
42
42
  end
43
43
 
44
-
45
44
  def refund(money, authorization, options = {})
46
45
  post = {}
47
46
  post[:transactionid] = authorization