braintree 2.104.0 → 4.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE +1 -1
- data/braintree.gemspec +7 -4
- data/lib/braintree/account_updater_daily_report.rb +1 -1
- data/lib/braintree/address.rb +2 -23
- data/lib/braintree/apple_pay.rb +1 -1
- data/lib/braintree/apple_pay_card.rb +11 -1
- data/lib/braintree/apple_pay_options.rb +1 -1
- data/lib/braintree/authorization_adjustment.rb +1 -1
- data/lib/braintree/base_module.rb +6 -0
- data/lib/braintree/bin_data.rb +9 -2
- data/lib/braintree/client_token.rb +1 -1
- data/lib/braintree/configuration.rb +12 -12
- data/lib/braintree/connected_merchant_paypal_status_changed.rb +1 -1
- data/lib/braintree/connected_merchant_status_transitioned.rb +1 -1
- data/lib/braintree/credit_card.rb +2 -77
- data/lib/braintree/credit_card_gateway.rb +17 -36
- data/lib/braintree/credit_card_verification.rb +18 -5
- data/lib/braintree/credit_card_verification_search.rb +1 -1
- data/lib/braintree/customer.rb +9 -78
- data/lib/braintree/customer_gateway.rb +2 -23
- data/lib/braintree/customer_search.rb +1 -1
- data/lib/braintree/disbursement.rb +1 -1
- data/lib/braintree/{transaction/coinbase_details.rb → dispute/paypal_message.rb} +5 -6
- data/lib/braintree/dispute/{history_event.rb → status_history.rb} +3 -1
- data/lib/braintree/dispute.rb +32 -8
- data/lib/braintree/dispute_gateway.rb +4 -9
- data/lib/braintree/dispute_search.rb +6 -3
- data/lib/braintree/document_upload.rb +1 -1
- data/lib/braintree/enriched_customer_data.rb +21 -0
- data/lib/braintree/error_codes.rb +150 -171
- data/lib/braintree/exceptions.rb +5 -3
- data/lib/braintree/exchange_rate.rb +13 -0
- data/lib/braintree/exchange_rate_quote.rb +24 -0
- data/lib/braintree/exchange_rate_quote_gateway.rb +35 -0
- data/lib/braintree/exchange_rate_quote_input.rb +21 -0
- data/lib/braintree/exchange_rate_quote_request.rb +18 -0
- data/lib/braintree/exchange_rate_quote_response.rb +18 -0
- data/lib/braintree/gateway.rb +4 -14
- data/lib/braintree/{android_pay_card.rb → google_pay_card.rb} +11 -3
- data/lib/braintree/granted_payment_instrument_update.rb +1 -1
- data/lib/braintree/graphql_client.rb +7 -7
- data/lib/braintree/http.rb +4 -3
- data/lib/braintree/local_payment_completed.rb +2 -2
- data/lib/braintree/local_payment_expired.rb +21 -0
- data/lib/braintree/local_payment_funded.rb +22 -0
- data/lib/braintree/local_payment_reversed.rb +19 -0
- data/lib/braintree/merchant.rb +1 -1
- data/lib/braintree/merchant_account.rb +1 -1
- data/lib/braintree/merchant_account_gateway.rb +3 -1
- data/lib/braintree/merchant_gateway.rb +1 -1
- data/lib/braintree/modification.rb +1 -1
- data/lib/braintree/oauth_credentials.rb +1 -1
- data/lib/braintree/oauth_gateway.rb +5 -5
- data/lib/braintree/payment_instrument_type.rb +10 -14
- data/lib/braintree/payment_method_customer_data_updated_metadata.rb +24 -0
- data/lib/braintree/payment_method_gateway.rb +15 -17
- data/lib/braintree/payment_method_nonce.rb +7 -4
- data/lib/braintree/payment_method_nonce_details.rb +37 -0
- data/lib/braintree/payment_method_nonce_details_payer_info.rb +32 -0
- data/lib/braintree/payment_method_nonce_gateway.rb +1 -1
- data/lib/braintree/payment_method_parser.rb +1 -8
- data/lib/braintree/plan.rb +21 -1
- data/lib/braintree/plan_gateway.rb +100 -0
- data/lib/braintree/processor_response_types.rb +3 -3
- data/lib/braintree/resource_collection.rb +8 -3
- data/lib/braintree/revoked_payment_method_metadata.rb +1 -1
- data/lib/braintree/risk_data/liability_shift.rb +22 -0
- data/lib/braintree/risk_data.rb +5 -1
- data/lib/braintree/samsung_pay_card.rb +1 -1
- data/lib/braintree/settlement_batch_summary.rb +2 -2
- data/lib/braintree/subscription.rb +11 -11
- data/lib/braintree/successful_result.rb +3 -2
- data/lib/braintree/test/credit_card.rb +1 -0
- data/lib/braintree/test/nonce.rb +4 -23
- data/lib/braintree/three_d_secure_info.rb +22 -12
- data/lib/braintree/transaction/disbursement_details.rb +1 -0
- data/lib/braintree/transaction/{android_pay_details.rb → google_pay_details.rb} +1 -1
- data/lib/braintree/transaction/installment/adjustment.rb +33 -0
- data/lib/braintree/transaction/installment.rb +28 -0
- data/lib/braintree/transaction/paypal_details.rb +3 -0
- data/lib/braintree/transaction/subscription_details.rb +2 -0
- data/lib/braintree/transaction.rb +65 -120
- data/lib/braintree/transaction_gateway.rb +39 -27
- data/lib/braintree/transaction_line_item.rb +1 -1
- data/lib/braintree/transaction_review.rb +18 -0
- data/lib/braintree/transaction_search.rb +5 -3
- data/lib/braintree/unknown_payment_method.rb +1 -1
- data/lib/braintree/us_bank_account.rb +3 -3
- data/lib/braintree/us_bank_account_verification.rb +1 -1
- data/lib/braintree/us_bank_account_verification_gateway.rb +1 -1
- data/lib/braintree/util.rb +21 -6
- data/lib/braintree/venmo_account.rb +1 -1
- data/lib/braintree/venmo_profile_data.rb +23 -0
- data/lib/braintree/version.rb +2 -2
- data/lib/braintree/visa_checkout_card.rb +2 -2
- data/lib/braintree/webhook_notification.rb +44 -30
- data/lib/braintree/webhook_notification_gateway.rb +5 -5
- data/lib/braintree/webhook_testing_gateway.rb +104 -43
- data/lib/braintree/xml/generator.rb +5 -4
- data/lib/braintree/xml/parser.rb +22 -35
- data/lib/braintree/xml/rexml.rb +4 -5
- data/lib/braintree.rb +28 -23
- data/spec/integration/braintree/add_on_spec.rb +1 -1
- data/spec/integration/braintree/address_spec.rb +30 -113
- data/spec/integration/braintree/advanced_search_spec.rb +45 -45
- data/spec/integration/braintree/apple_pay_spec.rb +3 -3
- data/spec/integration/braintree/braintree_gateway_spec.rb +2 -1
- data/spec/integration/braintree/client_api/client_token_spec.rb +14 -14
- data/spec/integration/braintree/client_api/spec_helper.rb +5 -31
- data/spec/integration/braintree/credit_card_spec.rb +219 -593
- data/spec/integration/braintree/credit_card_verification_search_spec.rb +2 -2
- data/spec/integration/braintree/credit_card_verification_spec.rb +1 -1
- data/spec/integration/braintree/customer_search_spec.rb +8 -8
- data/spec/integration/braintree/customer_spec.rb +484 -513
- data/spec/integration/braintree/dispute_search_spec.rb +35 -6
- data/spec/integration/braintree/dispute_spec.rb +6 -7
- data/spec/integration/braintree/error_codes_spec.rb +1 -1
- data/spec/integration/braintree/exchange_rate_quote_spec.rb +97 -0
- data/spec/integration/braintree/graphql_client_spec.rb +0 -2
- data/spec/integration/braintree/http_spec.rb +2 -2
- data/spec/integration/braintree/merchant_account_spec.rb +28 -29
- data/spec/integration/braintree/merchant_spec.rb +14 -14
- data/spec/integration/braintree/oauth_spec.rb +11 -11
- data/spec/integration/braintree/payment_method_nonce_spec.rb +29 -35
- data/spec/integration/braintree/payment_method_spec.rb +535 -270
- data/spec/integration/braintree/payment_method_us_bank_account_spec.rb +17 -13
- data/spec/integration/braintree/paypal_account_spec.rb +28 -28
- data/spec/integration/braintree/plan_spec.rb +82 -0
- data/spec/integration/braintree/samsung_pay_card_spec.rb +9 -9
- data/spec/integration/braintree/settlement_batch_summary_spec.rb +8 -8
- data/spec/integration/braintree/subscription_spec.rb +144 -149
- data/spec/integration/braintree/test/transaction_amounts_spec.rb +2 -2
- data/spec/integration/braintree/test_transaction_spec.rb +10 -10
- data/spec/integration/braintree/transaction_search_spec.rb +175 -70
- data/spec/integration/braintree/transaction_spec.rb +955 -894
- data/spec/integration/braintree/transaction_us_bank_account_spec.rb +32 -26
- data/spec/integration/braintree/us_bank_account_spec.rb +6 -6
- data/spec/integration/braintree/us_bank_account_verification_search_spec.rb +7 -7
- data/spec/integration/braintree/us_bank_account_verification_spec.rb +8 -8
- data/spec/integration/braintree/visa_checkout_card_spec.rb +5 -5
- data/spec/integration/spec_helper.rb +16 -7
- data/spec/oauth_test_helper.rb +1 -1
- data/spec/script/httpsd.rb +6 -6
- data/spec/spec_helper.rb +8 -14
- data/spec/unit/braintree/address_spec.rb +1 -9
- data/spec/unit/braintree/apple_pay_card_spec.rb +7 -1
- data/spec/unit/braintree/client_token_spec.rb +2 -2
- data/spec/unit/braintree/configuration_spec.rb +42 -42
- data/spec/unit/braintree/credit_card_spec.rb +13 -32
- data/spec/unit/braintree/credit_card_verification_search_spec.rb +1 -1
- data/spec/unit/braintree/credit_card_verification_spec.rb +8 -4
- data/spec/unit/braintree/customer_spec.rb +21 -22
- data/spec/unit/braintree/disbursement_spec.rb +7 -7
- data/spec/unit/braintree/dispute_search_spec.rb +3 -0
- data/spec/unit/braintree/dispute_spec.rb +75 -21
- data/spec/unit/braintree/enriched_customer_data_spec.rb +32 -0
- data/spec/unit/braintree/error_result_spec.rb +5 -5
- data/spec/unit/braintree/errors_spec.rb +8 -8
- data/spec/unit/braintree/exchange_rate_quote_input_spec.rb +42 -0
- data/spec/unit/braintree/exchange_rate_quote_request_spec.rb +82 -0
- data/spec/unit/braintree/exchange_rate_quote_response_spec.rb +52 -0
- data/spec/unit/braintree/exchange_rate_quote_spec.rb +42 -0
- data/spec/unit/braintree/exchange_rate_spec.rb +23 -0
- data/spec/unit/braintree/http_spec.rb +10 -8
- data/spec/unit/braintree/local_payment_completed_spec.rb +14 -0
- data/spec/unit/braintree/local_payment_expired_spec.rb +24 -0
- data/spec/unit/braintree/local_payment_funded_spec.rb +34 -0
- data/spec/unit/braintree/merchant_account_spec.rb +1 -1
- data/spec/unit/braintree/payment_method_customer_data_updated_metadata_spec.rb +45 -0
- data/spec/unit/braintree/payment_method_nonce_details_payer_info_spec.rb +31 -0
- data/spec/unit/braintree/payment_method_nonce_details_spec.rb +43 -0
- data/spec/unit/braintree/payment_method_nonce_spec.rb +40 -0
- data/spec/unit/braintree/payment_method_spec.rb +1 -1
- data/spec/unit/braintree/paypal_account_spec.rb +2 -2
- data/spec/unit/braintree/resource_collection_spec.rb +30 -1
- data/spec/unit/braintree/risk_data/liability_shift.rb +26 -0
- data/spec/unit/braintree/risk_data_spec.rb +38 -8
- data/spec/unit/braintree/subscription_search_spec.rb +1 -1
- data/spec/unit/braintree/successful_result_spec.rb +1 -1
- data/spec/unit/braintree/three_d_secure_info_spec.rb +32 -14
- data/spec/unit/braintree/transaction/credit_card_details_spec.rb +3 -3
- data/spec/unit/braintree/transaction/customer_details_spec.rb +1 -1
- data/spec/unit/braintree/transaction/deposit_details_spec.rb +2 -2
- data/spec/unit/braintree/transaction/installment_spec.rb +25 -0
- data/spec/unit/braintree/transaction/paypal_details_spec.rb +7 -1
- data/spec/unit/braintree/transaction_search_spec.rb +12 -12
- data/spec/unit/braintree/transaction_spec.rb +36 -54
- data/spec/unit/braintree/util_spec.rb +55 -21
- data/spec/unit/braintree/validation_error_collection_spec.rb +36 -36
- data/spec/unit/braintree/venmo_profile_data_spec.rb +32 -0
- data/spec/unit/braintree/webhook_notification_spec.rb +166 -57
- data/spec/unit/braintree/xml/parser_spec.rb +21 -16
- data/spec/unit/braintree/xml_spec.rb +31 -31
- metadata +62 -30
- data/lib/braintree/amex_express_checkout_card.rb +0 -40
- data/lib/braintree/coinbase_account.rb +0 -34
- data/lib/braintree/europe_bank_account.rb +0 -36
- data/lib/braintree/europe_bank_account_gateway.rb +0 -17
- data/lib/braintree/ideal_payment.rb +0 -61
- data/lib/braintree/ideal_payment_gateway.rb +0 -19
- data/lib/braintree/masterpass_card.rb +0 -83
- data/lib/braintree/settlement_batch.rb +0 -0
- data/lib/braintree/transaction/amex_express_checkout_details.rb +0 -21
- data/lib/braintree/transaction/ideal_payment_details.rb +0 -19
- data/lib/braintree/transaction/masterpass_card_details.rb +0 -49
- data/lib/braintree/transparent_redirect.rb +0 -40
- data/lib/braintree/transparent_redirect_gateway.rb +0 -105
- data/spec/hacks/tcp_socket.rb +0 -18
- data/spec/integration/braintree/coinbase_spec.rb +0 -34
- data/spec/integration/braintree/masterpass_card_spec.rb +0 -97
- data/spec/integration/braintree/transparent_redirect_spec.rb +0 -268
- data/spec/unit/braintree/transparent_redirect_spec.rb +0 -223
@@ -6,7 +6,7 @@ describe Braintree::AdvancedSearch do
|
|
6
6
|
:credit_card => {
|
7
7
|
:number => Braintree::Test::CreditCardNumbers::Visa,
|
8
8
|
:expiration_date => "05/2010"
|
9
|
-
}
|
9
|
+
},
|
10
10
|
).credit_cards[0]
|
11
11
|
end
|
12
12
|
|
@@ -16,13 +16,13 @@ describe Braintree::AdvancedSearch do
|
|
16
16
|
subscription1 = Braintree::Subscription.create(
|
17
17
|
:payment_method_token => @credit_card.token,
|
18
18
|
:plan_id => SpecHelper::TriallessPlan[:id],
|
19
|
-
:id => "subscription1_#{id}"
|
19
|
+
:id => "subscription1_#{id}",
|
20
20
|
).subscription
|
21
21
|
|
22
22
|
subscription2 = Braintree::Subscription.create(
|
23
23
|
:payment_method_token => @credit_card.token,
|
24
24
|
:plan_id => SpecHelper::TriallessPlan[:id],
|
25
|
-
:id => "subscription2_#{id}"
|
25
|
+
:id => "subscription2_#{id}",
|
26
26
|
).subscription
|
27
27
|
|
28
28
|
collection = Braintree::Subscription.search do |search|
|
@@ -39,14 +39,14 @@ describe Braintree::AdvancedSearch do
|
|
39
39
|
:payment_method_token => @credit_card.token,
|
40
40
|
:plan_id => SpecHelper::TriallessPlan[:id],
|
41
41
|
:price => "11",
|
42
|
-
:id => "subscription1_#{id}"
|
42
|
+
:id => "subscription1_#{id}",
|
43
43
|
).subscription
|
44
44
|
|
45
45
|
subscription2 = Braintree::Subscription.create(
|
46
46
|
:payment_method_token => @credit_card.token,
|
47
47
|
:plan_id => SpecHelper::TriallessPlan[:id],
|
48
48
|
:price => "11",
|
49
|
-
:id => "subscription2_#{id}"
|
49
|
+
:id => "subscription2_#{id}",
|
50
50
|
).subscription
|
51
51
|
|
52
52
|
collection = Braintree::Subscription.search do |search|
|
@@ -63,13 +63,13 @@ describe Braintree::AdvancedSearch do
|
|
63
63
|
subscription1 = Braintree::Subscription.create(
|
64
64
|
:payment_method_token => @credit_card.token,
|
65
65
|
:plan_id => SpecHelper::TriallessPlan[:id],
|
66
|
-
:id => "subscription1_#{id}"
|
66
|
+
:id => "subscription1_#{id}",
|
67
67
|
).subscription
|
68
68
|
|
69
69
|
subscription2 = Braintree::Subscription.create(
|
70
70
|
:payment_method_token => @credit_card.token,
|
71
71
|
:plan_id => SpecHelper::TriallessPlan[:id],
|
72
|
-
:id => "subscription2_#{id}"
|
72
|
+
:id => "subscription2_#{id}",
|
73
73
|
).subscription
|
74
74
|
|
75
75
|
collection = Braintree::Subscription.search do |search|
|
@@ -85,13 +85,13 @@ describe Braintree::AdvancedSearch do
|
|
85
85
|
subscription1 = Braintree::Subscription.create(
|
86
86
|
:payment_method_token => @credit_card.token,
|
87
87
|
:plan_id => SpecHelper::TriallessPlan[:id],
|
88
|
-
:id => "subscription1_#{id}"
|
88
|
+
:id => "subscription1_#{id}",
|
89
89
|
).subscription
|
90
90
|
|
91
91
|
subscription2 = Braintree::Subscription.create(
|
92
92
|
:payment_method_token => @credit_card.token,
|
93
93
|
:plan_id => SpecHelper::TriallessPlan[:id],
|
94
|
-
:id => "subscription2_#{id}"
|
94
|
+
:id => "subscription2_#{id}",
|
95
95
|
).subscription
|
96
96
|
|
97
97
|
collection = Braintree::Subscription.search do |search|
|
@@ -107,13 +107,13 @@ describe Braintree::AdvancedSearch do
|
|
107
107
|
subscription1 = Braintree::Subscription.create(
|
108
108
|
:payment_method_token => @credit_card.token,
|
109
109
|
:plan_id => SpecHelper::TriallessPlan[:id],
|
110
|
-
:id => "subscription1_#{id}"
|
110
|
+
:id => "subscription1_#{id}",
|
111
111
|
).subscription
|
112
112
|
|
113
113
|
subscription2 = Braintree::Subscription.create(
|
114
114
|
:payment_method_token => @credit_card.token,
|
115
115
|
:plan_id => SpecHelper::TriallessPlan[:id],
|
116
|
-
:id => "subscription2_#{id}"
|
116
|
+
:id => "subscription2_#{id}",
|
117
117
|
).subscription
|
118
118
|
|
119
119
|
collection = Braintree::Subscription.search do |search|
|
@@ -131,13 +131,13 @@ describe Braintree::AdvancedSearch do
|
|
131
131
|
subscription1 = Braintree::Subscription.create(
|
132
132
|
:payment_method_token => @credit_card.token,
|
133
133
|
:plan_id => SpecHelper::TriallessPlan[:id],
|
134
|
-
:price => "12"
|
134
|
+
:price => "12",
|
135
135
|
).subscription
|
136
136
|
|
137
137
|
subscription2 = Braintree::Subscription.create(
|
138
138
|
:payment_method_token => @credit_card.token,
|
139
139
|
:plan_id => SpecHelper::TriallessPlan[:id],
|
140
|
-
:price => "12"
|
140
|
+
:price => "12",
|
141
141
|
).subscription
|
142
142
|
|
143
143
|
Braintree::Subscription.cancel(subscription2.id)
|
@@ -155,13 +155,13 @@ describe Braintree::AdvancedSearch do
|
|
155
155
|
subscription1 = Braintree::Subscription.create(
|
156
156
|
:payment_method_token => @credit_card.token,
|
157
157
|
:plan_id => SpecHelper::TriallessPlan[:id],
|
158
|
-
:price => "13"
|
158
|
+
:price => "13",
|
159
159
|
).subscription
|
160
160
|
|
161
161
|
subscription2 = Braintree::Subscription.create(
|
162
162
|
:payment_method_token => @credit_card.token,
|
163
163
|
:plan_id => SpecHelper::TriallessPlan[:id],
|
164
|
-
:price => "13"
|
164
|
+
:price => "13",
|
165
165
|
).subscription
|
166
166
|
|
167
167
|
Braintree::Subscription.cancel(subscription2.id)
|
@@ -179,13 +179,13 @@ describe Braintree::AdvancedSearch do
|
|
179
179
|
subscription1 = Braintree::Subscription.create(
|
180
180
|
:payment_method_token => @credit_card.token,
|
181
181
|
:plan_id => SpecHelper::TriallessPlan[:id],
|
182
|
-
:price => "14"
|
182
|
+
:price => "14",
|
183
183
|
).subscription
|
184
184
|
|
185
185
|
subscription2 = Braintree::Subscription.create(
|
186
186
|
:payment_method_token => @credit_card.token,
|
187
187
|
:plan_id => SpecHelper::TriallessPlan[:id],
|
188
|
-
:price => "14"
|
188
|
+
:price => "14",
|
189
189
|
).subscription
|
190
190
|
|
191
191
|
Braintree::Subscription.cancel(subscription2.id)
|
@@ -204,13 +204,13 @@ describe Braintree::AdvancedSearch do
|
|
204
204
|
subscription1 = Braintree::Subscription.create(
|
205
205
|
:payment_method_token => @credit_card.token,
|
206
206
|
:plan_id => SpecHelper::TriallessPlan[:id],
|
207
|
-
:price => "15"
|
207
|
+
:price => "15",
|
208
208
|
).subscription
|
209
209
|
|
210
210
|
subscription2 = Braintree::Subscription.create(
|
211
211
|
:payment_method_token => @credit_card.token,
|
212
212
|
:plan_id => SpecHelper::TriallessPlan[:id],
|
213
|
-
:price => "15"
|
213
|
+
:price => "15",
|
214
214
|
).subscription
|
215
215
|
|
216
216
|
Braintree::Subscription.cancel(subscription2.id)
|
@@ -229,13 +229,13 @@ describe Braintree::AdvancedSearch do
|
|
229
229
|
subscription1 = Braintree::Subscription.create(
|
230
230
|
:payment_method_token => @credit_card.token,
|
231
231
|
:plan_id => SpecHelper::TriallessPlan[:id],
|
232
|
-
:price => "16"
|
232
|
+
:price => "16",
|
233
233
|
).subscription
|
234
234
|
|
235
235
|
subscription2 = Braintree::Subscription.create(
|
236
236
|
:payment_method_token => @credit_card.token,
|
237
237
|
:plan_id => SpecHelper::TriallessPlan[:id],
|
238
|
-
:price => "16"
|
238
|
+
:price => "16",
|
239
239
|
).subscription
|
240
240
|
|
241
241
|
Braintree::Subscription.cancel(subscription2.id)
|
@@ -266,19 +266,19 @@ describe Braintree::AdvancedSearch do
|
|
266
266
|
subscription1 = Braintree::Subscription.create(
|
267
267
|
:payment_method_token => @credit_card.token,
|
268
268
|
:plan_id => SpecHelper::TriallessPlan[:id],
|
269
|
-
:price => "17"
|
269
|
+
:price => "17",
|
270
270
|
).subscription
|
271
271
|
|
272
272
|
subscription2 = Braintree::Subscription.create(
|
273
273
|
:payment_method_token => @credit_card.token,
|
274
274
|
:plan_id => SpecHelper::TrialPlan[:id],
|
275
|
-
:price => "17"
|
275
|
+
:price => "17",
|
276
276
|
).subscription
|
277
277
|
|
278
278
|
subscription3 = Braintree::Subscription.create(
|
279
279
|
:payment_method_token => @credit_card.token,
|
280
280
|
:plan_id => SpecHelper::AddOnDiscountPlan[:id],
|
281
|
-
:price => "17"
|
281
|
+
:price => "17",
|
282
282
|
).subscription
|
283
283
|
|
284
284
|
plan_ids = [SpecHelper::TriallessPlan[:id], SpecHelper::TrialPlan[:id]]
|
@@ -307,13 +307,13 @@ describe Braintree::AdvancedSearch do
|
|
307
307
|
trialless_subscription = Braintree::Subscription.create(
|
308
308
|
:payment_method_token => @credit_card.token,
|
309
309
|
:plan_id => SpecHelper::TriallessPlan[:id],
|
310
|
-
:price => "18"
|
310
|
+
:price => "18",
|
311
311
|
).subscription
|
312
312
|
|
313
313
|
trial_subscription = Braintree::Subscription.create(
|
314
314
|
:payment_method_token => @credit_card.token,
|
315
315
|
:plan_id => SpecHelper::TrialPlan[:id],
|
316
|
-
:price => "18"
|
316
|
+
:price => "18",
|
317
317
|
).subscription
|
318
318
|
|
319
319
|
collection = Braintree::Subscription.search do |search|
|
@@ -331,13 +331,13 @@ describe Braintree::AdvancedSearch do
|
|
331
331
|
trialless_subscription = Braintree::Subscription.create(
|
332
332
|
:payment_method_token => @credit_card.token,
|
333
333
|
:plan_id => SpecHelper::TriallessPlan[:id],
|
334
|
-
:price => "19"
|
334
|
+
:price => "19",
|
335
335
|
).subscription
|
336
336
|
|
337
337
|
trial_subscription = Braintree::Subscription.create(
|
338
338
|
:payment_method_token => @credit_card.token,
|
339
339
|
:plan_id => SpecHelper::TrialPlan[:id],
|
340
|
-
:price => "19"
|
340
|
+
:price => "19",
|
341
341
|
).subscription
|
342
342
|
|
343
343
|
collection = Braintree::Subscription.search do |search|
|
@@ -355,13 +355,13 @@ describe Braintree::AdvancedSearch do
|
|
355
355
|
trialless_subscription = Braintree::Subscription.create(
|
356
356
|
:payment_method_token => @credit_card.token,
|
357
357
|
:plan_id => SpecHelper::TriallessPlan[:id],
|
358
|
-
:price => "20"
|
358
|
+
:price => "20",
|
359
359
|
).subscription
|
360
360
|
|
361
361
|
trial_subscription = Braintree::Subscription.create(
|
362
362
|
:payment_method_token => @credit_card.token,
|
363
363
|
:plan_id => SpecHelper::TrialPlan[:id],
|
364
|
-
:price => "20"
|
364
|
+
:price => "20",
|
365
365
|
).subscription
|
366
366
|
|
367
367
|
collection = Braintree::Subscription.search do |search|
|
@@ -379,13 +379,13 @@ describe Braintree::AdvancedSearch do
|
|
379
379
|
trialless_subscription = Braintree::Subscription.create(
|
380
380
|
:payment_method_token => @credit_card.token,
|
381
381
|
:plan_id => SpecHelper::TriallessPlan[:id],
|
382
|
-
:price => "21"
|
382
|
+
:price => "21",
|
383
383
|
).subscription
|
384
384
|
|
385
385
|
trial_subscription = Braintree::Subscription.create(
|
386
386
|
:payment_method_token => @credit_card.token,
|
387
387
|
:plan_id => SpecHelper::TrialPlan[:id],
|
388
|
-
:price => "21"
|
388
|
+
:price => "21",
|
389
389
|
).subscription
|
390
390
|
|
391
391
|
collection = Braintree::Subscription.search do |search|
|
@@ -403,13 +403,13 @@ describe Braintree::AdvancedSearch do
|
|
403
403
|
trialless_subscription = Braintree::Subscription.create(
|
404
404
|
:payment_method_token => @credit_card.token,
|
405
405
|
:plan_id => SpecHelper::TriallessPlan[:id],
|
406
|
-
:price => "22"
|
406
|
+
:price => "22",
|
407
407
|
).subscription
|
408
408
|
|
409
409
|
trial_subscription = Braintree::Subscription.create(
|
410
410
|
:payment_method_token => @credit_card.token,
|
411
411
|
:plan_id => SpecHelper::TrialPlan[:id],
|
412
|
-
:price => "22"
|
412
|
+
:price => "22",
|
413
413
|
).subscription
|
414
414
|
|
415
415
|
collection = Braintree::Subscription.search do |search|
|
@@ -428,13 +428,13 @@ describe Braintree::AdvancedSearch do
|
|
428
428
|
subscription_500 = Braintree::Subscription.create(
|
429
429
|
:payment_method_token => @credit_card.token,
|
430
430
|
:plan_id => SpecHelper::TriallessPlan[:id],
|
431
|
-
:price => "5.00"
|
431
|
+
:price => "5.00",
|
432
432
|
).subscription
|
433
433
|
|
434
434
|
subscription_501 = Braintree::Subscription.create(
|
435
435
|
:payment_method_token => @credit_card.token,
|
436
436
|
:plan_id => SpecHelper::TrialPlan[:id],
|
437
|
-
:price => "5.01"
|
437
|
+
:price => "5.01",
|
438
438
|
).subscription
|
439
439
|
|
440
440
|
collection = Braintree::Subscription.search do |search|
|
@@ -449,19 +449,19 @@ describe Braintree::AdvancedSearch do
|
|
449
449
|
subscription_499 = Braintree::Subscription.create(
|
450
450
|
:payment_method_token => @credit_card.token,
|
451
451
|
:plan_id => SpecHelper::TrialPlan[:id],
|
452
|
-
:price => "4.99"
|
452
|
+
:price => "4.99",
|
453
453
|
).subscription
|
454
454
|
|
455
455
|
subscription_500 = Braintree::Subscription.create(
|
456
456
|
:payment_method_token => @credit_card.token,
|
457
457
|
:plan_id => SpecHelper::TriallessPlan[:id],
|
458
|
-
:price => "5.00"
|
458
|
+
:price => "5.00",
|
459
459
|
).subscription
|
460
460
|
|
461
461
|
subscription_501 = Braintree::Subscription.create(
|
462
462
|
:payment_method_token => @credit_card.token,
|
463
463
|
:plan_id => SpecHelper::TrialPlan[:id],
|
464
|
-
:price => "5.01"
|
464
|
+
:price => "5.01",
|
465
465
|
).subscription
|
466
466
|
|
467
467
|
collection = Braintree::Subscription.search do |search|
|
@@ -477,19 +477,19 @@ describe Braintree::AdvancedSearch do
|
|
477
477
|
subscription_499 = Braintree::Subscription.create(
|
478
478
|
:payment_method_token => @credit_card.token,
|
479
479
|
:plan_id => SpecHelper::TrialPlan[:id],
|
480
|
-
:price => "999.99"
|
480
|
+
:price => "999.99",
|
481
481
|
).subscription
|
482
482
|
|
483
483
|
subscription_500 = Braintree::Subscription.create(
|
484
484
|
:payment_method_token => @credit_card.token,
|
485
485
|
:plan_id => SpecHelper::TriallessPlan[:id],
|
486
|
-
:price => "1000.00"
|
486
|
+
:price => "1000.00",
|
487
487
|
).subscription
|
488
488
|
|
489
489
|
subscription_501 = Braintree::Subscription.create(
|
490
490
|
:payment_method_token => @credit_card.token,
|
491
491
|
:plan_id => SpecHelper::TrialPlan[:id],
|
492
|
-
:price => "1000.01"
|
492
|
+
:price => "1000.01",
|
493
493
|
).subscription
|
494
494
|
|
495
495
|
collection = Braintree::Subscription.search do |search|
|
@@ -505,19 +505,19 @@ describe Braintree::AdvancedSearch do
|
|
505
505
|
subscription_499 = Braintree::Subscription.create(
|
506
506
|
:payment_method_token => @credit_card.token,
|
507
507
|
:plan_id => SpecHelper::TrialPlan[:id],
|
508
|
-
:price => "4.99"
|
508
|
+
:price => "4.99",
|
509
509
|
).subscription
|
510
510
|
|
511
511
|
subscription_500 = Braintree::Subscription.create(
|
512
512
|
:payment_method_token => @credit_card.token,
|
513
513
|
:plan_id => SpecHelper::TriallessPlan[:id],
|
514
|
-
:price => "5.00"
|
514
|
+
:price => "5.00",
|
515
515
|
).subscription
|
516
516
|
|
517
517
|
subscription_502 = Braintree::Subscription.create(
|
518
518
|
:payment_method_token => @credit_card.token,
|
519
519
|
:plan_id => SpecHelper::TrialPlan[:id],
|
520
|
-
:price => "5.02"
|
520
|
+
:price => "5.02",
|
521
521
|
).subscription
|
522
522
|
|
523
523
|
collection = Braintree::Subscription.search do |search|
|
@@ -5,18 +5,18 @@ describe Braintree::ApplePayGateway do
|
|
5
5
|
gateway = Braintree::Gateway.new(
|
6
6
|
:client_id => "client_id$#{Braintree::Configuration.environment}$integration_client_id",
|
7
7
|
:client_secret => "client_secret$#{Braintree::Configuration.environment}$integration_client_secret",
|
8
|
-
:logger => Logger.new("/dev/null")
|
8
|
+
:logger => Logger.new("/dev/null"),
|
9
9
|
)
|
10
10
|
|
11
11
|
result = gateway.merchant.create(
|
12
12
|
:email => "name@email.com",
|
13
13
|
:country_code_alpha3 => "USA",
|
14
|
-
:payment_methods => ["credit_card", "paypal"]
|
14
|
+
:payment_methods => ["credit_card", "paypal"],
|
15
15
|
)
|
16
16
|
|
17
17
|
@gateway = Braintree::Gateway.new(
|
18
18
|
:access_token => result.credentials.access_token,
|
19
|
-
:logger => Logger.new("/dev/null")
|
19
|
+
:logger => Logger.new("/dev/null"),
|
20
20
|
)
|
21
21
|
end
|
22
22
|
|
@@ -12,7 +12,8 @@ describe Braintree::Gateway do
|
|
12
12
|
end
|
13
13
|
|
14
14
|
describe "query" do
|
15
|
-
|
15
|
+
# we are temporarily skipping this test until we have a more stable CI env
|
16
|
+
xit "makes valid GraphQL queries when given a definition" do
|
16
17
|
definition = <<-GRAPHQL
|
17
18
|
mutation ExampleServerSideSingleUseToken($input: TokenizeCreditCardInput!) {
|
18
19
|
tokenizeCreditCard(input: $input) {
|
@@ -12,7 +12,7 @@ describe Braintree::ClientToken do
|
|
12
12
|
config,
|
13
13
|
:authorization_fingerprint => client_token["authorizationFingerprint"],
|
14
14
|
:shared_customer_identifier => "fake_identifier",
|
15
|
-
:shared_customer_identifier_type => "testing"
|
15
|
+
:shared_customer_identifier_type => "testing",
|
16
16
|
)
|
17
17
|
|
18
18
|
response = http.get_payment_methods
|
@@ -49,7 +49,7 @@ describe Braintree::ClientToken do
|
|
49
49
|
:customer_id => result.customer.id,
|
50
50
|
:options => {
|
51
51
|
:verify_card => true
|
52
|
-
}
|
52
|
+
},
|
53
53
|
)
|
54
54
|
client_token = decode_client_token(raw_client_token)
|
55
55
|
|
@@ -57,7 +57,7 @@ describe Braintree::ClientToken do
|
|
57
57
|
config,
|
58
58
|
:authorization_fingerprint => client_token["authorizationFingerprint"],
|
59
59
|
:shared_customer_identifier => "fake_identifier",
|
60
|
-
:shared_customer_identifier_type => "testing"
|
60
|
+
:shared_customer_identifier_type => "testing",
|
61
61
|
)
|
62
62
|
|
63
63
|
response = http.add_payment_method(
|
@@ -65,7 +65,7 @@ describe Braintree::ClientToken do
|
|
65
65
|
:number => "4000111111111115",
|
66
66
|
:expiration_month => "11",
|
67
67
|
:expiration_year => "2099"
|
68
|
-
}
|
68
|
+
},
|
69
69
|
)
|
70
70
|
|
71
71
|
response.code.should == "422"
|
@@ -79,7 +79,7 @@ describe Braintree::ClientToken do
|
|
79
79
|
:customer_id => customer_id,
|
80
80
|
:options => {
|
81
81
|
:make_default => true
|
82
|
-
}
|
82
|
+
},
|
83
83
|
)
|
84
84
|
client_token = decode_client_token(raw_client_token)
|
85
85
|
|
@@ -87,7 +87,7 @@ describe Braintree::ClientToken do
|
|
87
87
|
config,
|
88
88
|
:authorization_fingerprint => client_token["authorizationFingerprint"],
|
89
89
|
:shared_customer_identifier => "fake_identifier",
|
90
|
-
:shared_customer_identifier_type => "testing"
|
90
|
+
:shared_customer_identifier_type => "testing",
|
91
91
|
)
|
92
92
|
|
93
93
|
response = http.add_payment_method(
|
@@ -95,7 +95,7 @@ describe Braintree::ClientToken do
|
|
95
95
|
:number => "4111111111111111",
|
96
96
|
:expiration_month => "11",
|
97
97
|
:expiration_year => "2099"
|
98
|
-
}
|
98
|
+
},
|
99
99
|
)
|
100
100
|
|
101
101
|
response.code.should == "201"
|
@@ -105,7 +105,7 @@ describe Braintree::ClientToken do
|
|
105
105
|
:number => "4005519200000004",
|
106
106
|
:expiration_month => "11",
|
107
107
|
:expiration_year => "2099"
|
108
|
-
}
|
108
|
+
},
|
109
109
|
)
|
110
110
|
|
111
111
|
response.code.should == "201"
|
@@ -119,7 +119,7 @@ describe Braintree::ClientToken do
|
|
119
119
|
result = Braintree::Customer.create
|
120
120
|
customer_id = result.customer.id
|
121
121
|
raw_client_token = Braintree::ClientToken.generate(
|
122
|
-
:customer_id => customer_id
|
122
|
+
:customer_id => customer_id,
|
123
123
|
)
|
124
124
|
client_token = decode_client_token(raw_client_token)
|
125
125
|
|
@@ -127,7 +127,7 @@ describe Braintree::ClientToken do
|
|
127
127
|
config,
|
128
128
|
:authorization_fingerprint => client_token["authorizationFingerprint"],
|
129
129
|
:shared_customer_identifier => "fake_identifier",
|
130
|
-
:shared_customer_identifier_type => "testing"
|
130
|
+
:shared_customer_identifier_type => "testing",
|
131
131
|
)
|
132
132
|
|
133
133
|
response = http.add_payment_method(
|
@@ -135,7 +135,7 @@ describe Braintree::ClientToken do
|
|
135
135
|
:number => "4111111111111111",
|
136
136
|
:expiration_month => "11",
|
137
137
|
:expiration_year => "2099"
|
138
|
-
}
|
138
|
+
},
|
139
139
|
)
|
140
140
|
|
141
141
|
response.code.should == "201"
|
@@ -144,7 +144,7 @@ describe Braintree::ClientToken do
|
|
144
144
|
:customer_id => customer_id,
|
145
145
|
:options => {
|
146
146
|
:fail_on_duplicate_payment_method => true
|
147
|
-
}
|
147
|
+
},
|
148
148
|
)
|
149
149
|
second_client_token = decode_client_token(second_raw_client_token)
|
150
150
|
|
@@ -155,7 +155,7 @@ describe Braintree::ClientToken do
|
|
155
155
|
:number => "4111111111111111",
|
156
156
|
:expiration_month => "11",
|
157
157
|
:expiration_year => "2099"
|
158
|
-
}
|
158
|
+
},
|
159
159
|
)
|
160
160
|
|
161
161
|
response.code.should == "422"
|
@@ -165,7 +165,7 @@ describe Braintree::ClientToken do
|
|
165
165
|
merchant_account_id = SpecHelper::NonDefaultMerchantAccountId
|
166
166
|
|
167
167
|
raw_client_token = Braintree::ClientToken.generate(
|
168
|
-
:merchant_account_id => merchant_account_id
|
168
|
+
:merchant_account_id => merchant_account_id,
|
169
169
|
)
|
170
170
|
client_token = decode_client_token(raw_client_token)
|
171
171
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require
|
1
|
+
require "json"
|
2
2
|
|
3
3
|
def decode_client_token(raw_client_token)
|
4
4
|
decoded_client_token_string = Base64.decode64(raw_client_token)
|
@@ -20,7 +20,7 @@ def _initialize_client(options)
|
|
20
20
|
ClientApiHttp.new(Braintree::Configuration.instantiate,
|
21
21
|
:authorization_fingerprint => client_token["authorizationFingerprint"],
|
22
22
|
:shared_customer_identifier => "fake_identifier",
|
23
|
-
:shared_customer_identifier_type => "testing"
|
23
|
+
:shared_customer_identifier_type => "testing",
|
24
24
|
)
|
25
25
|
end
|
26
26
|
|
@@ -42,7 +42,7 @@ def nonce_for_paypal_account(paypal_account_details)
|
|
42
42
|
raw_client_token = Braintree::ClientToken.generate
|
43
43
|
client_token = decode_client_token(raw_client_token)
|
44
44
|
client = ClientApiHttp.new(Braintree::Configuration.instantiate,
|
45
|
-
:authorization_fingerprint => client_token["authorizationFingerprint"]
|
45
|
+
:authorization_fingerprint => client_token["authorizationFingerprint"],
|
46
46
|
)
|
47
47
|
|
48
48
|
response = client.create_paypal_account(paypal_account_details)
|
@@ -136,32 +136,6 @@ def generate_valid_plaid_us_bank_account_nonce
|
|
136
136
|
json["data"]["tokenizeUsBankLogin"]["paymentMethod"]["id"]
|
137
137
|
end
|
138
138
|
|
139
|
-
def generate_valid_ideal_payment_nonce(amount = Braintree::Test::TransactionAmounts::Authorize)
|
140
|
-
raw_client_token = Braintree::ClientToken.generate(:merchant_account_id => "ideal_merchant_account")
|
141
|
-
client_token = decode_client_token(raw_client_token)
|
142
|
-
client = ClientApiHttp.new(
|
143
|
-
Braintree::Configuration.instantiate,
|
144
|
-
:authorization_fingerprint => client_token["authorizationFingerprint"],
|
145
|
-
)
|
146
|
-
config = JSON.parse(client.get_configuration.body)
|
147
|
-
|
148
|
-
braintree_api = client_token["braintree_api"]
|
149
|
-
url = braintree_api["url"] + "/ideal-payments"
|
150
|
-
|
151
|
-
token = braintree_api["access_token"]
|
152
|
-
payload = {
|
153
|
-
:issuer => "RABONL2U",
|
154
|
-
:order_id => SpecHelper::DefaultOrderId,
|
155
|
-
:amount => amount,
|
156
|
-
:currency => "EUR",
|
157
|
-
:redirect_url => "https://braintree-api.com",
|
158
|
-
:route_id => config["ideal"]["routeId"]
|
159
|
-
}
|
160
|
-
|
161
|
-
json = _cosmos_post(token, url, payload)
|
162
|
-
json["data"]["id"]
|
163
|
-
end
|
164
|
-
|
165
139
|
def sample(arr)
|
166
140
|
6.times.map { arr[rand(arr.length)] }.join
|
167
141
|
end
|
@@ -309,7 +283,7 @@ class ClientApiHttp
|
|
309
283
|
params.merge!(
|
310
284
|
:authorization_fingerprint => @options[:authorization_fingerprint],
|
311
285
|
:shared_customer_identifier => "fake_identifier",
|
312
|
-
:shared_customer_identifier_type => "testing"
|
286
|
+
:shared_customer_identifier_type => "testing",
|
313
287
|
)
|
314
288
|
|
315
289
|
post("/merchants/#{config.merchant_id}/client_api/v1/payment_methods/credit_cards", params)
|
@@ -318,7 +292,7 @@ class ClientApiHttp
|
|
318
292
|
def create_paypal_account(params)
|
319
293
|
params = {:paypal_account => params}
|
320
294
|
params.merge!(
|
321
|
-
:authorization_fingerprint => @options[:authorization_fingerprint]
|
295
|
+
:authorization_fingerprint => @options[:authorization_fingerprint],
|
322
296
|
)
|
323
297
|
|
324
298
|
post("/merchants/#{config.merchant_id}/client_api/v1/payment_methods/paypal_accounts", params)
|