braintree 4.21.0 → 4.23.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/braintree/client_token_gateway.rb +2 -2
- data/lib/braintree/configuration.rb +1 -1
- data/lib/braintree/credit_card_gateway.rb +1 -0
- data/lib/braintree/credit_card_verification.rb +16 -12
- data/lib/braintree/customer.rb +2 -1
- data/lib/braintree/customer_gateway.rb +2 -0
- data/lib/braintree/error_codes.rb +3 -0
- data/lib/braintree/local_payment_completed/blik_alias.rb +23 -0
- data/lib/braintree/local_payment_completed.rb +6 -1
- data/lib/braintree/payment_instrument_type.rb +1 -0
- data/lib/braintree/payment_method_gateway.rb +3 -0
- data/lib/braintree/payment_method_parser.rb +1 -0
- data/lib/braintree/paypal_account.rb +1 -0
- data/lib/braintree/samsung_pay_card.rb +2 -0
- data/lib/braintree/test/nonce.rb +1 -0
- data/lib/braintree/transaction/local_payment_details.rb +1 -0
- data/lib/braintree/transaction/samsung_pay_card_details.rb +2 -0
- data/lib/braintree/transaction.rb +3 -1
- data/lib/braintree/transaction_gateway.rb +48 -46
- data/lib/braintree/version.rb +1 -1
- data/lib/braintree/webhook_testing_gateway.rb +36 -0
- data/lib/braintree.rb +1 -0
- data/lib/ssl/api_braintreegateway_com.ca.crt +401 -168
- data/spec/integration/braintree/apple_pay_spec.rb +1 -1
- data/spec/integration/braintree/client_api/client_token_spec.rb +229 -38
- data/spec/integration/braintree/credit_card_spec.rb +2 -2
- data/spec/integration/braintree/credit_card_verification_spec.rb +20 -1
- data/spec/integration/braintree/customer_spec.rb +23 -2
- data/spec/integration/braintree/merchant_account_spec.rb +2 -2
- data/spec/integration/braintree/merchant_spec.rb +17 -138
- data/spec/integration/braintree/payment_method_spec.rb +29 -2
- data/spec/integration/braintree/paypal_account_spec.rb +1 -0
- data/spec/integration/braintree/samsung_pay_card_spec.rb +3 -1
- data/spec/integration/braintree/transaction_spec.rb +56 -22
- data/spec/unit/braintree/client_token_spec.rb +1 -1
- data/spec/unit/braintree/configuration_spec.rb +1 -1
- data/spec/unit/braintree/credit_card_spec.rb +2 -2
- data/spec/unit/braintree/credit_card_verification_spec.rb +13 -2
- data/spec/unit/braintree/customer_spec.rb +1 -0
- data/spec/unit/braintree/error_result_spec.rb +1 -1
- data/spec/unit/braintree/local_payment_completed_spec.rb +44 -4
- data/spec/unit/braintree/paypal_account_spec.rb +9 -0
- data/spec/unit/braintree/transaction/local_payment_details_spec.rb +6 -0
- data/spec/unit/braintree/transaction_gateway_spec.rb +50 -48
- data/spec/unit/braintree/webhook_notification_spec.rb +22 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 80f9d00b4dec8e85066f61cecaf04c5863399c8c6552d5158d0fe69f8b81a64f
|
4
|
+
data.tar.gz: 4664e8431f59bf1293d6cafbaf3623b6fe2069aa81af17520384b5e85c34a0a5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 73131e462a1c99744d967f82cecdda88dc2780e04c3bb69f51cd7149fc8e747d7e487e31cc5e5e3fe7f4440d6da3ef42a90ee7e027c7fa0f567ad2b84a6119dd
|
7
|
+
data.tar.gz: a17216eb8f219f33af17d79accae60eccc23e059753ac159aed34063ec7f8abb0566c6268097647bb1a657fabf507d4f9d1d90c39e3c73b0e66f9d4c1a29c8bc
|
@@ -30,12 +30,12 @@ module Braintree
|
|
30
30
|
:address_id, :customer_id, :proxy_merchant_id, :merchant_account_id,
|
31
31
|
:version,
|
32
32
|
{:domains => [:_any_key_]},
|
33
|
-
{:options => [:
|
33
|
+
{:options => [:fail_on_duplicate_payment_method, :fail_on_duplicate_payment_method_for_customer, :make_default, :verify_card]}
|
34
34
|
]
|
35
35
|
end
|
36
36
|
|
37
37
|
def _validate_options(options)
|
38
|
-
[:
|
38
|
+
[:fail_on_duplicate_payment_method, :fail_on_duplicate_payment_method_for_customer, :make_default, :verify_card].each do |credit_card_option|
|
39
39
|
if options[credit_card_option]
|
40
40
|
raise ArgumentError.new("cannot specify #{credit_card_option} without a customer_id") unless options[:customer_id]
|
41
41
|
end
|
@@ -97,6 +97,7 @@ module Braintree
|
|
97
97
|
# The old venmo SDK class has been deprecated
|
98
98
|
options = [
|
99
99
|
:fail_on_duplicate_payment_method,
|
100
|
+
:fail_on_duplicate_payment_method_for_customer,
|
100
101
|
:make_default,
|
101
102
|
:skip_advanced_fraud_checking,
|
102
103
|
:venmo_sdk_session, # Deprecated
|
@@ -26,6 +26,8 @@ module Braintree
|
|
26
26
|
end
|
27
27
|
|
28
28
|
attr_reader :amount
|
29
|
+
attr_reader :ani_first_name_response_code
|
30
|
+
attr_reader :ani_last_name_response_code
|
29
31
|
attr_reader :avs_error_response_code
|
30
32
|
attr_reader :avs_postal_code_response_code
|
31
33
|
attr_reader :avs_street_address_response_code
|
@@ -45,8 +47,8 @@ module Braintree
|
|
45
47
|
attr_reader :processor_response_text
|
46
48
|
attr_reader :processor_response_type
|
47
49
|
attr_reader :risk_data
|
48
|
-
attr_reader :three_d_secure_info
|
49
50
|
attr_reader :status
|
51
|
+
attr_reader :three_d_secure_info
|
50
52
|
|
51
53
|
def initialize(attributes)
|
52
54
|
set_instance_variables_from_hash(attributes)
|
@@ -59,23 +61,25 @@ module Braintree
|
|
59
61
|
|
60
62
|
def inspect
|
61
63
|
attr_order = [
|
62
|
-
:status,
|
63
|
-
:processor_response_code,
|
64
|
-
:processor_response_text,
|
65
64
|
:amount,
|
66
|
-
:
|
67
|
-
:
|
65
|
+
:ani_first_name_response_code,
|
66
|
+
:ani_last_name_response_code,
|
68
67
|
:avs_error_response_code,
|
69
68
|
:avs_postal_code_response_code,
|
70
69
|
:avs_street_address_response_code,
|
71
|
-
:
|
72
|
-
:
|
73
|
-
:
|
70
|
+
:billing,
|
71
|
+
:created_at,
|
72
|
+
:credit_card,
|
73
|
+
:currency_iso_code,
|
74
|
+
:cvv_response_code,
|
74
75
|
:gateway_rejection_reason,
|
75
76
|
:id,
|
76
|
-
:
|
77
|
-
:
|
78
|
-
:
|
77
|
+
:merchant_account_id,
|
78
|
+
:network_response_code,
|
79
|
+
:network_response_text,
|
80
|
+
:processor_response_code,
|
81
|
+
:processor_response_text,
|
82
|
+
:status
|
79
83
|
]
|
80
84
|
formatted_attrs = attr_order.map do |attr|
|
81
85
|
if attr == :amount
|
data/lib/braintree/customer.rb
CHANGED
@@ -80,6 +80,7 @@ module Braintree
|
|
80
80
|
Configuration.gateway.customer.update!(*args)
|
81
81
|
end
|
82
82
|
|
83
|
+
# NEXT_MAJOR_VERSION remove samsung_pay_cards
|
83
84
|
def initialize(gateway, attributes)
|
84
85
|
@gateway = gateway
|
85
86
|
set_instance_variables_from_hash(attributes)
|
@@ -91,7 +92,7 @@ module Braintree
|
|
91
92
|
@us_bank_accounts = (@us_bank_accounts || []).map { |pm| UsBankAccount._new gateway, pm }
|
92
93
|
@visa_checkout_cards = (@visa_checkout_cards|| []).map { |pm| VisaCheckoutCard._new gateway, pm }
|
93
94
|
@sepa_direct_debit_accounts = (@sepa_debit_accounts || []).map { |pm| SepaDirectDebitAccount._new gateway, pm }
|
94
|
-
@samsung_pay_cards = (@samsung_pay_cards|| []).map { |pm| SamsungPayCard._new gateway, pm }
|
95
|
+
@samsung_pay_cards = (@samsung_pay_cards|| []).map { |pm| SamsungPayCard._new gateway, pm } # Deprecated
|
95
96
|
@addresses = (@addresses || []).map { |addr| Address._new gateway, addr }
|
96
97
|
@tax_identifiers = (@tax_identifiers || []).map { |addr| TaxIdentifier._new gateway, addr }
|
97
98
|
@custom_fields = attributes[:custom_fields].is_a?(Hash) ? attributes[:custom_fields] : {}
|
@@ -62,6 +62,8 @@ module Braintree
|
|
62
62
|
|
63
63
|
def self._create_signature
|
64
64
|
credit_card_signature = CreditCardGateway._create_signature - [:customer_id]
|
65
|
+
credit_card_options = credit_card_signature.find { |item| item.respond_to?(:keys) && item.keys == [:options] }
|
66
|
+
credit_card_options[:options].delete_if { |option| option == :fail_on_duplicate_payment_method_for_customer }
|
65
67
|
paypal_account_signature = PayPalAccountGateway._create_nested_signature
|
66
68
|
paypal_options_shipping_signature = AddressGateway._shared_signature
|
67
69
|
options = [
|
@@ -75,6 +75,7 @@ module Braintree
|
|
75
75
|
CvvIsRequired = "81706"
|
76
76
|
CvvVerificationFailed = "81736"
|
77
77
|
DuplicateCardExists = "81724"
|
78
|
+
DuplicateCardExistsForCustomer = "81763"
|
78
79
|
ExpirationDateConflict = "91708"
|
79
80
|
ExpirationDateIsInvalid = "81710"
|
80
81
|
ExpirationDateIsRequired = "81709"
|
@@ -83,6 +84,7 @@ module Braintree
|
|
83
84
|
ExpirationYearIsInvalid = "81713"
|
84
85
|
InvalidParamsForCreditCardUpdate = "91745"
|
85
86
|
InvalidVenmoSDKPaymentMethodCode = "91727"
|
87
|
+
LimitExceededforDuplicatePaymentMethodCheckForCustomer = "81764"
|
86
88
|
NetworkTokenizationAttributeCryptogramIsRequired = "81762"
|
87
89
|
NumberIsInvalid = "81715"
|
88
90
|
NumberIsProhibited = "81750"
|
@@ -712,6 +714,7 @@ module Braintree
|
|
712
714
|
module ClientToken
|
713
715
|
CustomerDoesNotExist = "92804"
|
714
716
|
FailOnDuplicatePaymentMethodRequiresCustomerId = "92803"
|
717
|
+
FailOnDuplicatePaymentMethodForCustomerRequiresCustomerId = "92805"
|
715
718
|
InvalidDomainFormat = "92011"
|
716
719
|
MakeDefaultRequiresCustomerId = "92801"
|
717
720
|
MerchantAccountDoesNotExist = "92807"
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module Braintree
|
2
|
+
class LocalPaymentCompleted
|
3
|
+
class BlikAlias
|
4
|
+
include BaseModule
|
5
|
+
|
6
|
+
attr_reader :key
|
7
|
+
attr_reader :label
|
8
|
+
|
9
|
+
def initialize(attributes)
|
10
|
+
set_instance_variables_from_hash attributes unless attributes.nil?
|
11
|
+
end
|
12
|
+
|
13
|
+
def inspect
|
14
|
+
attrs = [:key, :label]
|
15
|
+
formatted_attrs = attrs.map do |attr|
|
16
|
+
"#{attr}: #{send(attr).inspect}"
|
17
|
+
end
|
18
|
+
|
19
|
+
"#<#{formatted_attrs.join(", ")}>"
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -2,14 +2,19 @@ module Braintree
|
|
2
2
|
class LocalPaymentCompleted
|
3
3
|
include BaseModule
|
4
4
|
|
5
|
-
attr_reader :
|
5
|
+
attr_reader :bic
|
6
|
+
attr_reader :blik_aliases
|
7
|
+
attr_reader :iban_last_chars
|
6
8
|
attr_reader :payer_id
|
9
|
+
attr_reader :payer_name
|
10
|
+
attr_reader :payment_id
|
7
11
|
attr_reader :payment_method_nonce
|
8
12
|
attr_reader :transaction
|
9
13
|
|
10
14
|
def initialize(attributes)
|
11
15
|
set_instance_variables_from_hash(attributes)
|
12
16
|
@transaction = Transaction._new(Configuration.gateway, transaction) unless transaction.nil?
|
17
|
+
blik_aliases.map { |attrs| BlikAlias.new(attrs) } if blik_aliases
|
13
18
|
end
|
14
19
|
|
15
20
|
class << self
|
@@ -8,6 +8,7 @@ module Braintree
|
|
8
8
|
MetaCheckoutToken = "meta_checkout_token"
|
9
9
|
PayPalAccount = "paypal_account"
|
10
10
|
PayPalHere = "paypal_here"
|
11
|
+
# NEXT_MAJOR_VERSION remove SamsungPayCard
|
11
12
|
SamsungPayCard = "samsung_pay_card"
|
12
13
|
SepaDirectDebitAccount = "sepa_debit_account"
|
13
14
|
UsBankAccount = "us_bank_account"
|
@@ -204,9 +204,12 @@ module Braintree
|
|
204
204
|
case type
|
205
205
|
when :create
|
206
206
|
options << :fail_on_duplicate_payment_method
|
207
|
+
options << :fail_on_duplicate_payment_method_for_customer
|
207
208
|
signature << :customer_id
|
208
209
|
signature << :paypal_refresh_token
|
209
210
|
when :update
|
211
|
+
options << :fail_on_duplicate_payment_method
|
212
|
+
options << :fail_on_duplicate_payment_method_for_customer
|
210
213
|
billing_address_params << {:options => [:update_existing]}
|
211
214
|
else
|
212
215
|
raise ArgumentError
|
@@ -17,6 +17,7 @@ module Braintree
|
|
17
17
|
elsif attributes[:visa_checkout_card]
|
18
18
|
VisaCheckoutCard._new(gateway, attributes[:visa_checkout_card])
|
19
19
|
elsif attributes[:samsung_pay_card]
|
20
|
+
warn "[DEPRECATED] SamsungPayCard is no longer a supported payment method type"
|
20
21
|
SamsungPayCard._new(gateway, attributes[:samsung_pay_card])
|
21
22
|
elsif attributes[:sepa_debit_account]
|
22
23
|
SepaDirectDebitAccount._new(gateway, attributes[:sepa_debit_account])
|
data/lib/braintree/test/nonce.rb
CHANGED
@@ -69,6 +69,7 @@ module Braintree
|
|
69
69
|
VisaCheckoutDiscover = "fake-visa-checkout-discover-nonce"
|
70
70
|
VisaCheckoutMasterCard = "fake-visa-checkout-mastercard-nonce"
|
71
71
|
VisaCheckoutVisa = "fake-visa-checkout-visa-nonce"
|
72
|
+
# NEXT_MAJOR_VERSION SamsungPay is deprecated, remove all associated nonces
|
72
73
|
SamsungPayAmEx = "tokensam_fake_american_express"
|
73
74
|
SamsungPayDiscover = "tokensam_fake_discover"
|
74
75
|
SamsungPayMasterCard = "tokensam_fake_mastercard"
|
@@ -171,6 +171,7 @@ module Braintree
|
|
171
171
|
attr_reader :settlement_batch_id
|
172
172
|
attr_reader :shipping_amount
|
173
173
|
attr_reader :shipping_details
|
174
|
+
attr_reader :shipping_tax_amount
|
174
175
|
attr_reader :ships_from_postal_code
|
175
176
|
attr_reader :status # See Transaction::Status
|
176
177
|
attr_reader :status_history
|
@@ -310,6 +311,7 @@ module Braintree
|
|
310
311
|
Configuration.gateway.transaction.void!(*args)
|
311
312
|
end
|
312
313
|
|
314
|
+
# NEXT_MAJOR_VERSION remove SamsungPayCardDetails
|
313
315
|
def initialize(gateway, attributes)
|
314
316
|
@gateway = gateway
|
315
317
|
set_instance_variables_from_hash(attributes)
|
@@ -331,7 +333,7 @@ module Braintree
|
|
331
333
|
@payment_receipt = PaymentReceipt.new(attributes[:payment_receipt]) if attributes[:payment_receipt]
|
332
334
|
@paypal_details = PayPalDetails.new(@paypal)
|
333
335
|
@paypal_here_details = PayPalHereDetails.new(@paypal_here)
|
334
|
-
@samsung_pay_card_details = SamsungPayCardDetails.new(attributes[:samsung_pay_card])
|
336
|
+
@samsung_pay_card_details = SamsungPayCardDetails.new(attributes[:samsung_pay_card]) #Deprecated
|
335
337
|
@sca_exemption_requested = attributes[:sca_exemption_requested]
|
336
338
|
@sepa_direct_debit_account_details = SepaDirectDebitAccountDetails.new(@sepa_debit_account_detail)
|
337
339
|
@service_fee_amount = Util.to_big_decimal(service_fee_amount)
|
@@ -214,36 +214,45 @@ module Braintree
|
|
214
214
|
# three_d_secure_token has been deprecated in favor of three_d_secure_authentication_id
|
215
215
|
def self._create_signature
|
216
216
|
[
|
217
|
-
:amount, :billing_address_id, :channel, :
|
217
|
+
:amount, :billing_address_id, :channel, :currency_iso_code, :customer_id, :device_data,
|
218
|
+
:discount_amount, :exchange_rate_quote_id, :foreign_retailer,
|
218
219
|
:merchant_account_id, :order_id, :payment_method_nonce, :payment_method_token,
|
219
220
|
:product_sku, :purchase_order_number, :service_fee_amount, :shared_billing_address_id,
|
220
221
|
:shared_customer_id, :shared_payment_method_nonce, :shared_payment_method_token,
|
221
|
-
:shared_shipping_address_id, :shipping_address_id, :shipping_amount,
|
222
|
+
:shared_shipping_address_id, :shipping_address_id, :shipping_amount, :shipping_tax_amount,
|
222
223
|
:ships_from_postal_code, :tax_amount, :tax_exempt, :three_d_secure_authentication_id,:three_d_secure_token, #Deprecated
|
223
224
|
:transaction_source, :type, :venmo_sdk_payment_method_code, # Deprecated
|
224
|
-
:sca_exemption,
|
225
|
-
{:
|
226
|
-
{:risk_data => [:customer_browser, :customer_device_id, :customer_ip, :customer_location_zip, :customer_tenure]},
|
227
|
-
{:credit_card => [:token, :cardholder_name, :cvv, :expiration_date, :expiration_month, :expiration_year, :number, {:payment_reader_card_details => [:encrypted_card_data, :key_serial_number]}, {:network_tokenization_attributes => [:cryptogram, :ecommerce_indicator, :token_requestor_id]}]},
|
228
|
-
{:customer => [:id, :company, :email, :fax, :first_name, :last_name, :phone, :website]},
|
225
|
+
:sca_exemption,
|
226
|
+
{:apple_pay_card => [:number, :cardholder_name, :cryptogram, :expiration_month, :expiration_year, :eci_indicator]},
|
229
227
|
{
|
230
228
|
:billing => AddressGateway._shared_signature
|
231
229
|
},
|
232
|
-
{
|
233
|
-
|
234
|
-
},
|
235
|
-
{
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
:
|
245
|
-
|
246
|
-
|
230
|
+
{:credit_card => [:token, :cardholder_name, :cvv, :expiration_date, :expiration_month, :expiration_year, :number, {:payment_reader_card_details => [:encrypted_card_data, :key_serial_number]}, {:network_tokenization_attributes => [:cryptogram, :ecommerce_indicator, :token_requestor_id]}]},
|
231
|
+
{:customer => [:id, :company, :email, :fax, :first_name, :last_name, :phone, :website]},
|
232
|
+
{:custom_fields => :_any_key_},
|
233
|
+
{:descriptor => [:name, :phone, :url]},
|
234
|
+
{:external_vault => [
|
235
|
+
:status,
|
236
|
+
:previous_network_transaction_id,
|
237
|
+
]},
|
238
|
+
{:google_pay_card => [:number, :cryptogram, :google_transaction_id, :expiration_month, :expiration_year, :source_card_type, :source_card_last_four, :eci_indicator]},
|
239
|
+
{:industry => [
|
240
|
+
:industry_type,
|
241
|
+
{:data => [
|
242
|
+
:country_code, :date_of_birth, :folio_number, :check_in_date, :check_out_date, :travel_package, :lodging_check_in_date, :lodging_check_out_date, :departure_date, :lodging_name, :room_rate, :room_tax,
|
243
|
+
:passenger_first_name, :passenger_last_name, :passenger_middle_initial, :passenger_title, :issued_date, :travel_agency_name, :travel_agency_code, :ticket_number,
|
244
|
+
:issuing_carrier_code, :customer_code, :fare_amount, :fee_amount, :tax_amount, :restricted_ticket, :no_show, :advanced_deposit, :fire_safe, :property_phone, :ticket_issuer_address, :arrival_date,
|
245
|
+
{:legs => [
|
246
|
+
:conjunction_ticket, :exchange_ticket, :coupon_number, :service_class, :carrier_code, :fare_basis_code, :flight_number, :departure_date, :departure_airport_code, :departure_time,
|
247
|
+
:arrival_airport_code, :arrival_time, :stopover_permitted, :fare_amount, :fee_amount, :tax_amount, :endorsement_or_restrictions,
|
248
|
+
]},
|
249
|
+
{:additional_charges => [
|
250
|
+
:kind, :amount,
|
251
|
+
]},
|
252
|
+
]},
|
253
|
+
]},
|
254
|
+
{:installments => [:count]},
|
255
|
+
{:line_items => [:commodity_code, :description, :discount_amount, :image_url, :kind, :name, :product_code, :quantity, :tax_amount, :total_amount, :unit_amount, :unit_of_measure, :unit_tax_amount, :upc_code, :upc_type, :url]},
|
247
256
|
{:options => [
|
248
257
|
:hold_in_escrow,
|
249
258
|
:store_in_vault,
|
@@ -265,31 +274,23 @@ module Braintree
|
|
265
274
|
{:credit_card => [:account_type, :process_debit_as_credit]},
|
266
275
|
]
|
267
276
|
},
|
268
|
-
{:external_vault => [
|
269
|
-
:status,
|
270
|
-
:previous_network_transaction_id,
|
271
|
-
]},
|
272
|
-
{:custom_fields => :_any_key_},
|
273
|
-
{:descriptor => [:name, :phone, :url]},
|
274
277
|
{:paypal_account => [:email, :token, :paypal_data, :payee_id, :payee_email, :payer_id, :payment_id]},
|
275
|
-
{:
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
{:google_pay_card => [:number, :cryptogram, :google_transaction_id, :expiration_month, :expiration_year, :source_card_type, :source_card_last_four, :eci_indicator]},
|
292
|
-
{:installments => [:count]},
|
278
|
+
{:risk_data => [:customer_browser, :customer_device_id, :customer_ip, :customer_location_zip, :customer_tenure]},
|
279
|
+
{
|
280
|
+
:shipping => AddressGateway._shared_signature + [:shipping_method],
|
281
|
+
},
|
282
|
+
{
|
283
|
+
:three_d_secure_pass_thru => [
|
284
|
+
:eci_flag,
|
285
|
+
:cavv,
|
286
|
+
:xid,
|
287
|
+
:three_d_secure_version,
|
288
|
+
:authentication_response,
|
289
|
+
:directory_response,
|
290
|
+
:cavv_algorithm,
|
291
|
+
:ds_transaction_id,
|
292
|
+
]
|
293
|
+
},
|
293
294
|
]
|
294
295
|
end
|
295
296
|
|
@@ -317,6 +318,7 @@ module Braintree
|
|
317
318
|
:tax_exempt,
|
318
319
|
:discount_amount,
|
319
320
|
:shipping_amount,
|
321
|
+
:shipping_tax_amount,
|
320
322
|
:ships_from_postal_code,
|
321
323
|
:line_items => [:commodity_code, :description, :discount_amount, :image_url, :kind, :name, :product_code, :quantity, :tax_amount, :total_amount, :unit_amount, :unit_of_measure, :unit_tax_amount, :upc_code, :upc_type, :url],
|
322
324
|
]
|
data/lib/braintree/version.rb
CHANGED
@@ -1094,10 +1094,46 @@ module Braintree
|
|
1094
1094
|
end
|
1095
1095
|
|
1096
1096
|
def _local_payment_completed_sample_xml(id)
|
1097
|
+
if id == "blik_one_click_id"
|
1098
|
+
_blik_one_click_local_payment_completed_sample_xml(id)
|
1099
|
+
else
|
1100
|
+
_default_local_payment_completed_sample_xml(id)
|
1101
|
+
end
|
1102
|
+
end
|
1103
|
+
|
1104
|
+
def _default_local_payment_completed_sample_xml(id)
|
1097
1105
|
<<-XML
|
1098
1106
|
<local-payment>
|
1107
|
+
<bic>BIC</bic>
|
1108
|
+
<iban_last_chars>1234</iban_last_chars>
|
1109
|
+
<payer-id>ABCPAYER</payer-id>
|
1110
|
+
<payer-name>PAYERNAME</payer-name>
|
1099
1111
|
<payment-id>PAY-XYZ123</payment-id>
|
1112
|
+
<payment-method-nonce>ee257d98-de40-47e8-96b3-a6954ea7a9a4</payment-method-nonce>
|
1113
|
+
<transaction>
|
1114
|
+
<id>#{id}</id>
|
1115
|
+
<status>authorized</status>
|
1116
|
+
<amount>49.99</amount>
|
1117
|
+
<order-id>order4567</order-id>
|
1118
|
+
</transaction>
|
1119
|
+
</local-payment>
|
1120
|
+
XML
|
1121
|
+
end
|
1122
|
+
|
1123
|
+
def _blik_one_click_local_payment_completed_sample_xml(id)
|
1124
|
+
<<-XML
|
1125
|
+
<local-payment>
|
1126
|
+
<bic>BIC</bic>
|
1127
|
+
<blik-aliases type='array'>
|
1128
|
+
<blik-alias>
|
1129
|
+
<key>alias-key-1</key>
|
1130
|
+
<label>alias-label-1</label>
|
1131
|
+
</blik-alias>
|
1132
|
+
</blik-aliases>
|
1133
|
+
<iban_last_chars>1234</iban_last_chars>
|
1100
1134
|
<payer-id>ABCPAYER</payer-id>
|
1135
|
+
<payer-name>PAYERNAME</payer-name>
|
1136
|
+
<payment-id>PAY-XYZ123</payment-id>
|
1101
1137
|
<payment-method-nonce>ee257d98-de40-47e8-96b3-a6954ea7a9a4</payment-method-nonce>
|
1102
1138
|
<transaction>
|
1103
1139
|
<id>#{id}</id>
|
data/lib/braintree.rb
CHANGED
@@ -78,6 +78,7 @@ require "braintree/gateway"
|
|
78
78
|
require "braintree/graphql_client"
|
79
79
|
require "braintree/google_pay_card"
|
80
80
|
require "braintree/local_payment_completed"
|
81
|
+
require "braintree/local_payment_completed/blik_alias"
|
81
82
|
require "braintree/local_payment_reversed"
|
82
83
|
require "braintree/local_payment_expired"
|
83
84
|
require "braintree/local_payment_funded"
|