braintree 4.25.0 → 4.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/braintree/apple_pay_card.rb +1 -0
- data/lib/braintree/bin_data.rb +2 -1
- data/lib/braintree/configuration.rb +1 -1
- data/lib/braintree/credit_card.rb +6 -5
- data/lib/braintree/error_codes.rb +46 -104
- data/lib/braintree/gateway.rb +4 -0
- data/lib/braintree/google_pay_card.rb +1 -0
- data/lib/braintree/merchant_account.rb +1 -25
- data/lib/braintree/merchant_account_gateway.rb +0 -81
- data/lib/braintree/meta_checkout_card.rb +6 -5
- data/lib/braintree/meta_checkout_token.rb +6 -5
- data/lib/braintree/paypal_payment_resource.rb +22 -0
- data/lib/braintree/paypal_payment_resource_gateway.rb +36 -0
- data/lib/braintree/test/credit_card.rb +1 -0
- data/lib/braintree/transaction/apple_pay_details.rb +1 -0
- data/lib/braintree/transaction/credit_card_details.rb +12 -10
- data/lib/braintree/transaction/google_pay_details.rb +11 -10
- data/lib/braintree/transaction/meta_checkout_card_details.rb +5 -2
- data/lib/braintree/transaction/meta_checkout_token_details.rb +6 -2
- data/lib/braintree/transaction/visa_checkout_card_details.rb +5 -2
- data/lib/braintree/transaction.rb +0 -26
- data/lib/braintree/transaction_gateway.rb +9 -20
- data/lib/braintree/version.rb +1 -1
- data/lib/braintree/visa_checkout_card.rb +5 -5
- data/lib/braintree/webhook_notification.rb +0 -4
- data/lib/braintree/webhook_testing_gateway.rb +0 -33
- data/lib/braintree.rb +2 -3
- data/spec/integration/braintree/credit_card_spec.rb +12 -0
- data/spec/integration/braintree/credit_card_verification_spec.rb +24 -0
- data/spec/integration/braintree/customer_spec.rb +22 -6
- data/spec/integration/braintree/disbursement_spec.rb +1 -1
- data/spec/integration/braintree/merchant_account_spec.rb +0 -342
- data/spec/integration/braintree/payment_method_nonce_spec.rb +11 -0
- data/spec/integration/braintree/payment_method_spec.rb +3 -3
- data/spec/integration/braintree/paypal_payment_resource_spec.rb +141 -0
- data/spec/integration/braintree/transaction_payment_facilitator_spec.rb +119 -0
- data/spec/integration/braintree/transaction_spec.rb +16 -305
- data/spec/spec_helper.rb +1 -1
- data/spec/unit/braintree/apple_pay_card_spec.rb +1 -0
- data/spec/unit/braintree/configuration_spec.rb +1 -1
- data/spec/unit/braintree/credit_card_spec.rb +5 -0
- data/spec/unit/braintree/google_pay_card_spec.rb +8 -0
- data/spec/unit/braintree/meta_checkout_card_spec.rb +53 -51
- data/spec/unit/braintree/meta_checkout_token_spec.rb +3 -1
- data/spec/unit/braintree/payment_method_nonce_spec.rb +4 -1
- data/spec/unit/braintree/paypal_payment_resource_spec.rb +125 -0
- data/spec/unit/braintree/transaction/apple_pay_details_spec.rb +8 -0
- data/spec/unit/braintree/transaction/credit_card_details_spec.rb +2 -1
- data/spec/unit/braintree/transaction/google_pay_details_spec.rb +8 -0
- data/spec/unit/braintree/transaction/meta_checkout_card_details_spec.rb +8 -0
- data/spec/unit/braintree/transaction/meta_checkout_token_details_spec.rb +8 -0
- data/spec/unit/braintree/transaction/visa_checkout_card_details_spec.rb +8 -0
- data/spec/unit/braintree/transaction_gateway_spec.rb +19 -0
- data/spec/unit/braintree/transaction_spec.rb +2 -0
- data/spec/unit/braintree/visa_checkout_card_spec.rb +8 -0
- data/spec/unit/braintree/webhook_notification_spec.rb +0 -53
- data/spec/unit/credit_card_details_spec.rb +8 -0
- metadata +15 -7
- data/lib/braintree/merchant_account/business_details.rb +0 -17
- data/lib/braintree/merchant_account/funding_details.rb +0 -18
- data/lib/braintree/merchant_account/individual_details.rb +0 -20
- data/spec/unit/braintree/disbursement_spec.rb +0 -131
- data/spec/unit/braintree/merchant_account_spec.rb +0 -33
@@ -5,27 +5,28 @@ module Braintree
|
|
5
5
|
|
6
6
|
attr_reader :bin
|
7
7
|
attr_reader :card_type
|
8
|
+
attr_reader :commercial
|
9
|
+
attr_reader :country_of_issuance
|
10
|
+
attr_reader :debit
|
11
|
+
attr_reader :durbin_regulated
|
8
12
|
attr_reader :expiration_month
|
9
13
|
attr_reader :expiration_year
|
14
|
+
attr_reader :global_id
|
10
15
|
attr_reader :google_transaction_id
|
16
|
+
attr_reader :healthcare
|
11
17
|
attr_reader :image_url
|
18
|
+
attr_reader :issuing_bank
|
12
19
|
attr_reader :last_4
|
20
|
+
attr_reader :payroll
|
21
|
+
attr_reader :prepaid
|
22
|
+
attr_reader :prepaid_reloadable
|
23
|
+
attr_reader :product_id
|
13
24
|
attr_reader :source_card_last_4
|
14
25
|
attr_reader :source_card_type
|
15
26
|
attr_reader :source_description
|
16
27
|
attr_reader :token
|
17
28
|
attr_reader :virtual_card_last_4
|
18
29
|
attr_reader :virtual_card_type
|
19
|
-
attr_reader :prepaid
|
20
|
-
attr_reader :healthcare
|
21
|
-
attr_reader :debit
|
22
|
-
attr_reader :durbin_regulated
|
23
|
-
attr_reader :commercial
|
24
|
-
attr_reader :payroll
|
25
|
-
attr_reader :issuing_bank
|
26
|
-
attr_reader :country_of_issuance
|
27
|
-
attr_reader :product_id
|
28
|
-
attr_reader :global_id
|
29
30
|
|
30
31
|
def initialize(attributes)
|
31
32
|
set_instance_variables_from_hash attributes unless attributes.nil?
|
@@ -22,6 +22,7 @@ module Braintree
|
|
22
22
|
attr_reader :last_4
|
23
23
|
attr_reader :payroll
|
24
24
|
attr_reader :prepaid
|
25
|
+
attr_reader :prepaid_reloadable
|
25
26
|
attr_reader :product_id
|
26
27
|
attr_reader :token
|
27
28
|
attr_reader :unique_number_identifier
|
@@ -36,8 +37,10 @@ module Braintree
|
|
36
37
|
end
|
37
38
|
|
38
39
|
def inspect
|
39
|
-
attr_order = [
|
40
|
-
|
40
|
+
attr_order = [
|
41
|
+
:bin, :card_type, :cardholder_name, :commercial, :container_id, :country_of_issuance,
|
42
|
+
:customer_location, :debit, :durbin_regulated, :expiration_date, :healthcare, :image_url,
|
43
|
+
:issuing_bank, :last_4, :payroll, :prepaid, :prepaid_reloadable, :product_id, :token]
|
41
44
|
formatted_attrs = attr_order.map do |attr|
|
42
45
|
"#{attr}: #{send(attr).inspect}"
|
43
46
|
end
|
@@ -24,6 +24,7 @@ module Braintree
|
|
24
24
|
attr_reader :last_4
|
25
25
|
attr_reader :payroll
|
26
26
|
attr_reader :prepaid
|
27
|
+
attr_reader :prepaid_reloadable
|
27
28
|
attr_reader :product_id
|
28
29
|
attr_reader :token
|
29
30
|
attr_reader :unique_number_identifier
|
@@ -38,8 +39,11 @@ module Braintree
|
|
38
39
|
end
|
39
40
|
|
40
41
|
def inspect
|
41
|
-
attr_order = [
|
42
|
-
|
42
|
+
attr_order = [
|
43
|
+
:bin, :card_type, :cardholder_name, :commercial, :container_id, :country_of_issuance,
|
44
|
+
:cryptogram, :customer_location, :debit, :durbin_regulated, :ecommerce_indicator,
|
45
|
+
:expiration_date, :healthcare, :image_url, :is_network_tokenized, :issuing_bank, :last_4,
|
46
|
+
:payroll, :prepaid, :prepaid_reloadable, :product_id, :token]
|
43
47
|
formatted_attrs = attr_order.map do |attr|
|
44
48
|
"#{attr}: #{send(attr).inspect}"
|
45
49
|
end
|
@@ -20,6 +20,7 @@ module Braintree
|
|
20
20
|
attr_reader :last_4
|
21
21
|
attr_reader :payroll
|
22
22
|
attr_reader :prepaid
|
23
|
+
attr_reader :prepaid_reloadable
|
23
24
|
attr_reader :product_id
|
24
25
|
attr_reader :token
|
25
26
|
|
@@ -32,8 +33,10 @@ module Braintree
|
|
32
33
|
end
|
33
34
|
|
34
35
|
def inspect
|
35
|
-
attr_order = [
|
36
|
-
|
36
|
+
attr_order = [
|
37
|
+
:bin, :call_id, :card_type, :cardholder_name, :commercial, :country_of_issuance, :customer_location,
|
38
|
+
:debit, :durbin_regulated, :expiration_date, :healthcare, :image_url, :issuing_bank, :last_4, :payroll,
|
39
|
+
:prepaid, :prepaid_reloadable, :product_id, :token]
|
37
40
|
formatted_attrs = attr_order.map do |attr|
|
38
41
|
"#{attr}: #{send(attr).inspect}"
|
39
42
|
end
|
@@ -9,15 +9,6 @@ module Braintree
|
|
9
9
|
Unrecognized = "unrecognized"
|
10
10
|
end
|
11
11
|
|
12
|
-
module EscrowStatus
|
13
|
-
HoldPending = "hold_pending"
|
14
|
-
Held = "held"
|
15
|
-
ReleasePending = "release_pending"
|
16
|
-
Released = "released"
|
17
|
-
Refunded = "refunded"
|
18
|
-
Unrecognized = "unrecognized"
|
19
|
-
end
|
20
|
-
|
21
12
|
module GatewayRejectionReason
|
22
13
|
ApplicationIncomplete = "application_incomplete"
|
23
14
|
AVS = "avs"
|
@@ -118,7 +109,6 @@ module Braintree
|
|
118
109
|
attr_reader :discount_amount
|
119
110
|
attr_reader :discounts
|
120
111
|
attr_reader :disputes
|
121
|
-
attr_reader :escrow_status
|
122
112
|
attr_reader :facilitated_details
|
123
113
|
attr_reader :facilitator_details
|
124
114
|
attr_reader :foreign_retailer
|
@@ -235,14 +225,6 @@ module Braintree
|
|
235
225
|
Configuration.gateway.transaction_line_item.find_all(*args)
|
236
226
|
end
|
237
227
|
|
238
|
-
def self.hold_in_escrow(*args)
|
239
|
-
Configuration.gateway.transaction.hold_in_escrow(*args)
|
240
|
-
end
|
241
|
-
|
242
|
-
def self.hold_in_escrow!(*args)
|
243
|
-
Configuration.gateway.transaction.hold_in_escrow!(*args)
|
244
|
-
end
|
245
|
-
|
246
228
|
def self.refund(*args)
|
247
229
|
Configuration.gateway.transaction.refund(*args)
|
248
230
|
end
|
@@ -263,14 +245,6 @@ module Braintree
|
|
263
245
|
Configuration.gateway.transaction.search(&block)
|
264
246
|
end
|
265
247
|
|
266
|
-
def self.release_from_escrow(*args)
|
267
|
-
Configuration.gateway.transaction.release_from_escrow(*args)
|
268
|
-
end
|
269
|
-
|
270
|
-
def self.release_from_escrow!(*args)
|
271
|
-
Configuration.gateway.transaction.release_from_escrow!(*args)
|
272
|
-
end
|
273
|
-
|
274
248
|
def self.submit_for_settlement(*args)
|
275
249
|
Configuration.gateway.transaction.submit_for_settlement(*args)
|
276
250
|
end
|
@@ -31,16 +31,6 @@ module Braintree
|
|
31
31
|
return_object_or_raise(:transaction) { cancel_release(*args) }
|
32
32
|
end
|
33
33
|
|
34
|
-
def hold_in_escrow(transaction_id)
|
35
|
-
raise ArgumentError, "transaction_id is invalid" unless transaction_id =~ /\A[0-9a-z]+\z/
|
36
|
-
response = @config.http.put("#{@config.base_merchant_path}/transactions/#{transaction_id}/hold_in_escrow")
|
37
|
-
_handle_transaction_response(response)
|
38
|
-
end
|
39
|
-
|
40
|
-
def hold_in_escrow!(*args)
|
41
|
-
return_object_or_raise(:transaction) { hold_in_escrow(*args) }
|
42
|
-
end
|
43
|
-
|
44
34
|
def _handle_transaction_response(response)
|
45
35
|
if response[:transaction]
|
46
36
|
SuccessfulResult.new(:transaction => Transaction._new(@gateway, response[:transaction]))
|
@@ -135,16 +125,6 @@ module Braintree
|
|
135
125
|
end
|
136
126
|
end
|
137
127
|
|
138
|
-
def release_from_escrow(transaction_id)
|
139
|
-
raise ArgumentError, "transaction_id is invalid" unless transaction_id =~ /\A[0-9a-z]+\z/
|
140
|
-
response = @config.http.put("#{@config.base_merchant_path}/transactions/#{transaction_id}/release_from_escrow")
|
141
|
-
_handle_transaction_response(response)
|
142
|
-
end
|
143
|
-
|
144
|
-
def release_from_escrow!(*args)
|
145
|
-
return_object_or_raise(:transaction) { release_from_escrow(*args) }
|
146
|
-
end
|
147
|
-
|
148
128
|
def submit_for_settlement(transaction_id, amount = nil, options = {})
|
149
129
|
raise ArgumentError, "transaction_id is invalid" unless transaction_id =~ /\A[0-9a-z]+\z/
|
150
130
|
Util.verify_keys(TransactionGateway._submit_for_settlement_signature, options)
|
@@ -275,6 +255,15 @@ module Braintree
|
|
275
255
|
]
|
276
256
|
},
|
277
257
|
{:paypal_account => [:email, :token, :paypal_data, :payee_id, :payee_email, :payer_id, :payment_id]},
|
258
|
+
{:payment_facilitator => [
|
259
|
+
:payment_facilitator_id,
|
260
|
+
{:sub_merchant => [:reference_number, :tax_id, :legal_name,
|
261
|
+
{:address => [ :street_address, :locality, :region, :country_code_alpha2, :postal_code,
|
262
|
+
{:international_phone => [:country_code, :national_number
|
263
|
+
]}
|
264
|
+
]}
|
265
|
+
]}
|
266
|
+
]},
|
278
267
|
{:risk_data => [:customer_browser, :customer_device_id, :customer_ip, :customer_location_zip, :customer_tenure]},
|
279
268
|
{
|
280
269
|
:shipping => AddressGateway._shared_signature + [:shipping_method],
|
data/lib/braintree/version.rb
CHANGED
@@ -23,6 +23,7 @@ module Braintree
|
|
23
23
|
attr_reader :last_4
|
24
24
|
attr_reader :payroll
|
25
25
|
attr_reader :prepaid
|
26
|
+
attr_reader :prepaid_reloadable
|
26
27
|
attr_reader :product_id
|
27
28
|
attr_reader :subscriptions
|
28
29
|
attr_reader :token
|
@@ -75,11 +76,10 @@ module Braintree
|
|
75
76
|
|
76
77
|
def self._attributes
|
77
78
|
[
|
78
|
-
:
|
79
|
-
:customer_id, :customer_location, :
|
80
|
-
:
|
81
|
-
:
|
82
|
-
:country_of_issuance, :issuing_bank, :image_url, :call_id
|
79
|
+
:bin, :billing_address, :card_type, :cardholder_name, :commercial, :container_id, :country_of_issuance,
|
80
|
+
:created_at, :customer_id, :customer_location, :debit, :durbin_regulated, :expiration_month,
|
81
|
+
:expiration_year, :healthcare, :image_url, :issuing_bank, :last_4, :payroll, :prepaid,
|
82
|
+
:prepaid_reloadable, :product_id, :token, :updated_at
|
83
83
|
]
|
84
84
|
end
|
85
85
|
|
@@ -13,7 +13,6 @@ module Braintree
|
|
13
13
|
ConnectedMerchantPayPalStatusChanged = "connected_merchant_paypal_status_changed"
|
14
14
|
ConnectedMerchantStatusTransitioned = "connected_merchant_status_transitioned"
|
15
15
|
Disbursement = "disbursement"
|
16
|
-
DisbursementException = "disbursement_exception"
|
17
16
|
|
18
17
|
DisputeAccepted = "dispute_accepted"
|
19
18
|
DisputeAutoAccepted = "dispute_auto_accepted"
|
@@ -57,9 +56,6 @@ module Braintree
|
|
57
56
|
SubscriptionWentActive = "subscription_went_active"
|
58
57
|
SubscriptionWentPastDue = "subscription_went_past_due"
|
59
58
|
|
60
|
-
SubMerchantAccountApproved = "sub_merchant_account_approved"
|
61
|
-
SubMerchantAccountDeclined = "sub_merchant_account_declined"
|
62
|
-
|
63
59
|
TransactionDisbursed = "transaction_disbursed"
|
64
60
|
TransactionReviewed = "transaction_reviewed"
|
65
61
|
TransactionSettlementDeclined = "transaction_settlement_declined"
|
@@ -58,10 +58,6 @@ module Braintree
|
|
58
58
|
_partner_merchant_declined_sample_xml(id)
|
59
59
|
when Braintree::WebhookNotification::Kind::OAuthAccessRevoked
|
60
60
|
_oauth_access_revoked_sample_xml(id)
|
61
|
-
when Braintree::WebhookNotification::Kind::SubMerchantAccountApproved
|
62
|
-
_merchant_account_approved_sample_xml(id)
|
63
|
-
when Braintree::WebhookNotification::Kind::SubMerchantAccountDeclined
|
64
|
-
_merchant_account_declined_sample_xml(id)
|
65
61
|
when Braintree::WebhookNotification::Kind::TransactionDisbursed
|
66
62
|
_transaction_disbursed_sample_xml(id)
|
67
63
|
when Braintree::WebhookNotification::Kind::TransactionReviewed
|
@@ -70,8 +66,6 @@ module Braintree
|
|
70
66
|
_transaction_settled_sample_xml(id)
|
71
67
|
when Braintree::WebhookNotification::Kind::TransactionSettlementDeclined
|
72
68
|
_transaction_settlement_declined_sample_xml(id)
|
73
|
-
when Braintree::WebhookNotification::Kind::DisbursementException
|
74
|
-
_disbursement_exception_sample_xml(id)
|
75
69
|
when Braintree::WebhookNotification::Kind::Disbursement
|
76
70
|
_disbursement_sample_xml(id)
|
77
71
|
when Braintree::WebhookNotification::Kind::SubscriptionBillingSkipped
|
@@ -959,33 +953,7 @@ module Braintree
|
|
959
953
|
XML
|
960
954
|
end
|
961
955
|
|
962
|
-
def _disbursement_exception_sample_xml(id)
|
963
|
-
|
964
|
-
<<-XML
|
965
|
-
<disbursement>
|
966
|
-
<id>#{id}</id>
|
967
|
-
<transaction-ids type="array">
|
968
|
-
<item>afv56j</item>
|
969
|
-
<item>kj8hjk</item>
|
970
|
-
</transaction-ids>
|
971
|
-
<success type="boolean">false</success>
|
972
|
-
<retry type="boolean">false</retry>
|
973
|
-
<merchant-account>
|
974
|
-
<id>merchant_account_token</id>
|
975
|
-
<currency-iso-code>USD</currency-iso-code>
|
976
|
-
<sub-merchant-account type="boolean">false</sub-merchant-account>
|
977
|
-
<status>active</status>
|
978
|
-
</merchant-account>
|
979
|
-
<amount>100.00</amount>
|
980
|
-
<disbursement-date type="date">2014-02-10</disbursement-date>
|
981
|
-
<exception-message>bank_rejected</exception-message>
|
982
|
-
<follow-up-action>update_funding_information</follow-up-action>
|
983
|
-
</disbursement>
|
984
|
-
XML
|
985
|
-
end
|
986
|
-
|
987
956
|
def _disbursement_sample_xml(id)
|
988
|
-
|
989
957
|
<<-XML
|
990
958
|
<disbursement>
|
991
959
|
<id>#{id}</id>
|
@@ -1010,7 +978,6 @@ module Braintree
|
|
1010
978
|
end
|
1011
979
|
|
1012
980
|
def _account_updater_daily_report_sample_xml(id)
|
1013
|
-
|
1014
981
|
<<-XML
|
1015
982
|
<account-updater-daily-report>
|
1016
983
|
<report-date type="date">2016-01-14</report-date>
|
data/lib/braintree.rb
CHANGED
@@ -98,9 +98,6 @@ require "braintree/merchant"
|
|
98
98
|
require "braintree/merchant_gateway"
|
99
99
|
require "braintree/merchant_account"
|
100
100
|
require "braintree/merchant_account_gateway"
|
101
|
-
require "braintree/merchant_account/individual_details"
|
102
|
-
require "braintree/merchant_account/business_details"
|
103
|
-
require "braintree/merchant_account/funding_details"
|
104
101
|
require "braintree/merchant_account/address_details"
|
105
102
|
require "braintree/meta_checkout_card"
|
106
103
|
require "braintree/meta_checkout_token"
|
@@ -117,6 +114,8 @@ require "braintree/payment_method_nonce_gateway"
|
|
117
114
|
require "braintree/payment_method_parser"
|
118
115
|
require "braintree/paypal_account"
|
119
116
|
require "braintree/paypal_account_gateway"
|
117
|
+
require "braintree/paypal_payment_resource"
|
118
|
+
require "braintree/paypal_payment_resource_gateway"
|
120
119
|
require "braintree/plan"
|
121
120
|
require "braintree/plan_gateway"
|
122
121
|
require "braintree/processor_response_types"
|
@@ -449,6 +449,18 @@ describe Braintree::CreditCard do
|
|
449
449
|
expect(credit_card.prepaid).to eq(Braintree::CreditCard::Prepaid::Yes)
|
450
450
|
end
|
451
451
|
|
452
|
+
it "sets the prepaid reloadable field if the card is prepaid reloadable" do
|
453
|
+
customer = Braintree::Customer.create!
|
454
|
+
result = Braintree::CreditCard.create(
|
455
|
+
:customer_id => customer.id,
|
456
|
+
:number => Braintree::Test::CreditCardNumbers::CardTypeIndicators::PrepaidReloadable,
|
457
|
+
:expiration_date => "05/2014",
|
458
|
+
:options => {:verify_card => true},
|
459
|
+
)
|
460
|
+
credit_card = result.credit_card
|
461
|
+
expect(credit_card.prepaid_reloadable).to eq(Braintree::CreditCard::PrepaidReloadable::Yes)
|
462
|
+
end
|
463
|
+
|
452
464
|
it "sets the healthcare field if the card is healthcare" do
|
453
465
|
customer = Braintree::Customer.create!
|
454
466
|
result = Braintree::CreditCard.create(
|
@@ -322,6 +322,30 @@ describe Braintree::CreditCardVerification, "search" do
|
|
322
322
|
found_verification = Braintree::CreditCardVerification.find(verification_id)
|
323
323
|
expect(found_verification.credit_card[:prepaid]).to eq(Braintree::CreditCard::Prepaid::Yes)
|
324
324
|
end
|
325
|
+
|
326
|
+
it "returns prepaid_reloadable on a prepaid card" do
|
327
|
+
cardholder_name = "Tom #{rand(1_000_000)} Smith"
|
328
|
+
|
329
|
+
Braintree::Customer.create(
|
330
|
+
:credit_card => {
|
331
|
+
:cardholder_name => cardholder_name,
|
332
|
+
:expiration_date => "05/2012",
|
333
|
+
:number => Braintree::Test::CreditCardNumbers::CardTypeIndicators::PrepaidReloadable,
|
334
|
+
:cvv => "200",
|
335
|
+
:options => {
|
336
|
+
:verify_card => true
|
337
|
+
}
|
338
|
+
})
|
339
|
+
|
340
|
+
search_results = Braintree::CreditCardVerification.search do |search|
|
341
|
+
search.credit_card_cardholder_name.is cardholder_name
|
342
|
+
end
|
343
|
+
|
344
|
+
verification_id = search_results.first.id
|
345
|
+
|
346
|
+
found_verification = Braintree::CreditCardVerification.find(verification_id)
|
347
|
+
expect(found_verification.credit_card[:prepaid_reloadable]).to eq(Braintree::CreditCard::PrepaidReloadable::Yes)
|
348
|
+
end
|
325
349
|
end
|
326
350
|
end
|
327
351
|
|
@@ -991,18 +991,19 @@ describe Braintree::Customer do
|
|
991
991
|
expect(found_customer.apple_pay_cards).not_to be_nil
|
992
992
|
apple_pay_card = found_customer.apple_pay_cards.first
|
993
993
|
expect(apple_pay_card).to be_a Braintree::ApplePayCard
|
994
|
-
expect(apple_pay_card.token).not_to be_nil
|
995
|
-
expect(apple_pay_card.expiration_year).not_to be_nil
|
996
|
-
expect(apple_pay_card.payment_instrument_name).to eq("AmEx 41002")
|
997
994
|
expect(apple_pay_card.commercial).not_to be_nil
|
998
995
|
expect(apple_pay_card.country_of_issuance).not_to be_nil
|
999
996
|
expect(apple_pay_card.debit).not_to be_nil
|
1000
997
|
expect(apple_pay_card.durbin_regulated).not_to be_nil
|
998
|
+
expect(apple_pay_card.expiration_year).not_to be_nil
|
1001
999
|
expect(apple_pay_card.healthcare).not_to be_nil
|
1002
1000
|
expect(apple_pay_card.issuing_bank).not_to be_nil
|
1001
|
+
expect(apple_pay_card.payment_instrument_name).to eq("AmEx 41002")
|
1003
1002
|
expect(apple_pay_card.payroll).not_to be_nil
|
1004
1003
|
expect(apple_pay_card.prepaid).not_to be_nil
|
1004
|
+
expect(apple_pay_card.prepaid_reloadable).not_to be_nil
|
1005
1005
|
expect(apple_pay_card.product_id).not_to be_nil
|
1006
|
+
expect(apple_pay_card.token).not_to be_nil
|
1006
1007
|
end
|
1007
1008
|
|
1008
1009
|
it "returns associated google pay proxy cards" do
|
@@ -1016,18 +1017,19 @@ describe Braintree::Customer do
|
|
1016
1017
|
expect(found_customer.payment_methods.size).to eq(1)
|
1017
1018
|
google_pay_card = found_customer.google_pay_cards.first
|
1018
1019
|
expect(google_pay_card).to be_a Braintree::GooglePayCard
|
1019
|
-
expect(google_pay_card.token).not_to be_nil
|
1020
|
-
expect(google_pay_card.expiration_year).not_to be_nil
|
1021
|
-
expect(google_pay_card.is_network_tokenized?).to eq(false)
|
1022
1020
|
expect(google_pay_card.commercial).not_to be_nil
|
1023
1021
|
expect(google_pay_card.country_of_issuance).not_to be_nil
|
1024
1022
|
expect(google_pay_card.debit).not_to be_nil
|
1025
1023
|
expect(google_pay_card.durbin_regulated).not_to be_nil
|
1024
|
+
expect(google_pay_card.expiration_year).not_to be_nil
|
1026
1025
|
expect(google_pay_card.healthcare).not_to be_nil
|
1026
|
+
expect(google_pay_card.is_network_tokenized?).to eq(false)
|
1027
1027
|
expect(google_pay_card.issuing_bank).not_to be_nil
|
1028
1028
|
expect(google_pay_card.payroll).not_to be_nil
|
1029
1029
|
expect(google_pay_card.prepaid).not_to be_nil
|
1030
|
+
expect(google_pay_card.prepaid_reloadable).not_to be_nil
|
1030
1031
|
expect(google_pay_card.product_id).not_to be_nil
|
1032
|
+
expect(google_pay_card.token).not_to be_nil
|
1031
1033
|
end
|
1032
1034
|
|
1033
1035
|
it "returns associated google pay network tokens" do
|
@@ -1052,6 +1054,7 @@ describe Braintree::Customer do
|
|
1052
1054
|
expect(google_pay_card.issuing_bank).not_to be_nil
|
1053
1055
|
expect(google_pay_card.payroll).not_to be_nil
|
1054
1056
|
expect(google_pay_card.prepaid).not_to be_nil
|
1057
|
+
expect(google_pay_card.prepaid_reloadable).not_to be_nil
|
1055
1058
|
expect(google_pay_card.product_id).not_to be_nil
|
1056
1059
|
end
|
1057
1060
|
|
@@ -1912,4 +1915,17 @@ describe Braintree::Customer do
|
|
1912
1915
|
end
|
1913
1916
|
end
|
1914
1917
|
end
|
1918
|
+
|
1919
|
+
it "returns prepaid_reloadable from VisaCheckoutCard" do
|
1920
|
+
result = Braintree::Customer.create(
|
1921
|
+
:payment_method_nonce => Braintree::Test::Nonce::VisaCheckoutVisa,
|
1922
|
+
)
|
1923
|
+
expect(result.success?).to eq(true)
|
1924
|
+
|
1925
|
+
found_customer = Braintree::Customer.find(result.customer.id)
|
1926
|
+
expect(found_customer.visa_checkout_cards).not_to be_nil
|
1927
|
+
visa_checkout_card = found_customer.visa_checkout_cards.first
|
1928
|
+
expect(visa_checkout_card).to be_a Braintree::VisaCheckoutCard
|
1929
|
+
expect(visa_checkout_card.prepaid_reloadable).not_to be_nil
|
1930
|
+
end
|
1915
1931
|
end
|