solidus_paypal_braintree 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (73) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +9 -1
  3. data/Gemfile +1 -3
  4. data/README.md +96 -5
  5. data/app/assets/config/solidus_paypal_braintree_manifest.js +1 -0
  6. data/app/assets/images/solidus_paypal_braintree/venmo/venmo_active_blue_button_280x48.svg +19 -0
  7. data/app/assets/images/solidus_paypal_braintree/venmo/venmo_active_blue_button_320x48.svg +19 -0
  8. data/app/assets/images/solidus_paypal_braintree/venmo/venmo_active_blue_button_375x48.svg +19 -0
  9. data/app/assets/images/solidus_paypal_braintree/venmo/venmo_active_white_button_280x48.svg +19 -0
  10. data/app/assets/images/solidus_paypal_braintree/venmo/venmo_active_white_button_320x48.svg +19 -0
  11. data/app/assets/images/solidus_paypal_braintree/venmo/venmo_active_white_button_375x48.svg +19 -0
  12. data/app/assets/images/solidus_paypal_braintree/venmo/venmo_blue_acceptance_mark.svg +15 -0
  13. data/app/assets/images/solidus_paypal_braintree/venmo/venmo_blue_button_280x48.svg +19 -0
  14. data/app/assets/images/solidus_paypal_braintree/venmo/venmo_blue_button_320x48.svg +19 -0
  15. data/app/assets/images/solidus_paypal_braintree/venmo/venmo_blue_button_375x48.svg +19 -0
  16. data/app/assets/images/solidus_paypal_braintree/venmo/venmo_blue_logo.svg +18 -0
  17. data/app/assets/images/solidus_paypal_braintree/venmo/venmo_white_acceptance_mark.svg +20 -0
  18. data/app/assets/images/solidus_paypal_braintree/venmo/venmo_white_button_280x48.svg +19 -0
  19. data/app/assets/images/solidus_paypal_braintree/venmo/venmo_white_button_320x48.svg +19 -0
  20. data/app/assets/images/solidus_paypal_braintree/venmo/venmo_white_button_375x48.svg +19 -0
  21. data/app/assets/images/solidus_paypal_braintree/venmo/venmo_white_logo.svg +18 -0
  22. data/app/assets/javascripts/solidus_paypal_braintree/client.js +34 -0
  23. data/app/assets/javascripts/solidus_paypal_braintree/constants.js +8 -0
  24. data/app/assets/javascripts/solidus_paypal_braintree/frontend.js +1 -0
  25. data/app/assets/javascripts/solidus_paypal_braintree/paypal_button.js +26 -3
  26. data/app/assets/javascripts/solidus_paypal_braintree/venmo_button.js +86 -0
  27. data/app/assets/javascripts/spree/backend/solidus_paypal_braintree.js +2 -2
  28. data/app/assets/javascripts/spree/frontend/paypal_button.js +3 -3
  29. data/app/assets/stylesheets/spree/frontend/solidus_paypal_braintree.css +12 -0
  30. data/app/decorators/controllers/solidus_paypal_braintree/checkout_controller_decorator.rb +1 -1
  31. data/app/decorators/controllers/solidus_paypal_braintree/orders_controller_decorator.rb +1 -1
  32. data/app/helpers/solidus_paypal_braintree/braintree_checkout_helper.rb +19 -5
  33. data/app/models/solidus_paypal_braintree/address.rb +43 -9
  34. data/app/models/solidus_paypal_braintree/avs_result.rb +3 -0
  35. data/app/models/solidus_paypal_braintree/configuration.rb +15 -2
  36. data/app/models/solidus_paypal_braintree/gateway.rb +27 -2
  37. data/app/models/solidus_paypal_braintree/source.rb +31 -2
  38. data/app/models/solidus_paypal_braintree/transaction.rb +1 -1
  39. data/app/models/solidus_paypal_braintree/transaction_address.rb +17 -13
  40. data/app/models/solidus_paypal_braintree/transaction_import.rb +2 -1
  41. data/app/overrides/spree/payments/payment/add_paypal_funding_source_to_payment.rb +9 -0
  42. data/app/views/spree/shared/_braintree_errors.html.erb +3 -0
  43. data/app/views/spree/shared/_paypal_braintree_head_scripts.html.erb +10 -6
  44. data/app/views/spree/shared/_paypal_cart_button.html.erb +2 -0
  45. data/app/views/spree/shared/_venmo_button.html.erb +33 -0
  46. data/config/locales/en.yml +34 -0
  47. data/config/locales/it.yml +2 -0
  48. data/db/migrate/20211222170950_add_paypal_funding_source_to_solidus_paypal_braintree_sources.rb +5 -0
  49. data/db/migrate/20220104150301_add_venmo_to_braintree_configuration.rb +5 -0
  50. data/lib/controllers/backend/solidus_paypal_braintree/configurations_controller.rb +4 -1
  51. data/lib/controllers/frontend/solidus_paypal_braintree/transactions_controller.rb +1 -0
  52. data/lib/solidus_paypal_braintree/engine.rb +4 -2
  53. data/lib/solidus_paypal_braintree/factories.rb +32 -1
  54. data/lib/solidus_paypal_braintree/version.rb +1 -1
  55. data/lib/views/backend/solidus_paypal_braintree/configurations/list.html.erb +8 -0
  56. data/lib/views/backend/spree/admin/payments/source_views/_paypal_braintree.html.erb +5 -0
  57. data/lib/views/backend/spree/admin/shared/preference_fields/_preference_select.html.erb +13 -0
  58. data/lib/views/frontend/solidus_paypal_braintree/payments/_payment.html.erb +12 -0
  59. data/lib/views/frontend/spree/checkout/payment/_paypal_braintree.html.erb +4 -0
  60. data/lib/views/frontend/spree/shared/_paypal_checkout_button.html.erb +2 -0
  61. data/solidus_paypal_braintree.gemspec +6 -5
  62. data/spec/controllers/solidus_paypal_braintree/transactions_controller_spec.rb +1 -1
  63. data/spec/features/frontend/braintree_credit_card_checkout_spec.rb +5 -1
  64. data/spec/features/frontend/venmo_checkout_spec.rb +189 -0
  65. data/spec/fixtures/cassettes/checkout/valid_venmo_transaction.yml +599 -0
  66. data/spec/helpers/solidus_paypal_braintree/braintree_checkout_helper_spec.rb +70 -0
  67. data/spec/models/solidus_paypal_braintree/address_spec.rb +20 -0
  68. data/spec/models/solidus_paypal_braintree/gateway_spec.rb +1 -1
  69. data/spec/models/solidus_paypal_braintree/source_spec.rb +139 -0
  70. data/spec/models/solidus_paypal_braintree/transaction_address_spec.rb +8 -26
  71. data/spec/models/solidus_paypal_braintree/transaction_import_spec.rb +17 -0
  72. data/spec/spec_helper.rb +3 -0
  73. metadata +52 -15
@@ -0,0 +1,599 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://api.sandbox.braintreegateway.com/merchants/652zwb86tqk9v5wz/customers
6
+ body:
7
+ encoding: UTF-8
8
+ string: |
9
+ <?xml version="1.0" encoding="UTF-8"?>
10
+ <customer>
11
+ <payment-method-nonce>fake-venmo-account-nonce</payment-method-nonce>
12
+ </customer>
13
+ headers:
14
+ Accept-Encoding:
15
+ - gzip
16
+ Accept:
17
+ - application/xml
18
+ User-Agent:
19
+ - Braintree Ruby Gem 3.4.0
20
+ X-Apiversion:
21
+ - '6'
22
+ Content-Type:
23
+ - application/xml
24
+ Authorization:
25
+ - Basic bnl2eGpncnlid3k1amNtODpjZWMxN2Q3NDM2ODU4MjM3M2ZlMjQyOTJiMjQyNDAwYg==
26
+ response:
27
+ status:
28
+ code: 201
29
+ message: Created
30
+ headers:
31
+ Date:
32
+ - Fri, 14 Jan 2022 15:59:11 GMT
33
+ Content-Type:
34
+ - application/xml; charset=utf-8
35
+ Transfer-Encoding:
36
+ - chunked
37
+ X-Frame-Options:
38
+ - SAMEORIGIN
39
+ X-Xss-Protection:
40
+ - 1; mode=block
41
+ X-Content-Type-Options:
42
+ - nosniff
43
+ X-Download-Options:
44
+ - noopen
45
+ X-Permitted-Cross-Domain-Policies:
46
+ - none
47
+ Referrer-Policy:
48
+ - strict-origin-when-cross-origin
49
+ X-Authentication:
50
+ - basic_auth
51
+ Strict-Transport-Security:
52
+ - max-age=31536000
53
+ X-User:
54
+ - 4b9yb8scv4785hg6
55
+ Vary:
56
+ - Accept-Encoding, Origin
57
+ Content-Encoding:
58
+ - gzip
59
+ Etag:
60
+ - W/"81b0c4f3649de9ac00f31053c20e3880"
61
+ Cache-Control:
62
+ - max-age=0, private, must-revalidate
63
+ X-Runtime:
64
+ - '2.456603'
65
+ X-Request-Id:
66
+ - 9b6be68b-2654-44f6-aba2-3e6d310817d2
67
+ Content-Security-Policy:
68
+ - frame-ancestors 'self'
69
+ X-Broxyid:
70
+ - 9b6be68b-2654-44f6-aba2-3e6d310817d2
71
+ Paypal-Debug-Id:
72
+ - 127618c95ae54
73
+ body:
74
+ encoding: ASCII-8BIT
75
+ string: !binary |-
76
+ H4sIAM+d4WEAA6RUTY/aMBC976+IcjdOAkGAQtBKFUhI9ETZlsvKiQfwktip7RDCr6+TQFg+Km3Vo997M2M/z0wwOaaJdQCpmOBj2+04tgU8FpTx7dj+sZyigT0JX4I4V1qkIMMXywoYDV1n0B/23O4gwOZUgYaMd4RrZM593zsV0aCvf++HB784BfgzW6k3TCqNOEnB4iwZ21rmYOOaSsjfmFikGeHlAw4pYckDmu0Ef8yxIccHrIBIMf2kngSigSKiLV1mMLapOWqWgh16juchx0Vub+n6I384cobrAF8D6vg8o1+Odx0Tfw1o6temow2DhKrmSttERCSpXPzVXZ3obKjXP+ebxfK19/1j7yyWi16Ar5rzIyjTKCaSqvM1iJSkPL+RUCpBKXjGHYCnApE4FjnXt4KKv1c02D/6Vr/71rc6x396V+egsCF5ckkQCZEA4XZY/XCAz2QrZinZAsplEu60ztQIY2Js0aoTScK4lgBbk78gZce0Ic5ImQLX7ynonaDvidgKXJvRyfh2AvzApOCVYqwIp5E4mjlpC1xKarEHHvapVxRcBrg5XkglchkDoqBiyTJtxjNcVQWs18btkVXX+xDmLU+0rY8KZDVM4VXdQhdN84sVXDVNXQXNBSA3wLdUe7c8ais9aZymCc4bA91ui8/wg/Qr3f1EfMlzReLZ1I/eVjmduQmd7Q7r6dBbv/k6cgfe+tu8Sz2/vBsUE48f2vkOUmYT4usq/AMAAP//AwAp1uX9PQUAAA==
77
+ recorded_at: Fri, 14 Jan 2022 15:59:11 GMT
78
+ - request:
79
+ method: get
80
+ uri: https://api.sandbox.braintreegateway.com/merchants/652zwb86tqk9v5wz/payment_methods/any/6d2wwnr
81
+ body:
82
+ encoding: US-ASCII
83
+ string: ''
84
+ headers:
85
+ Accept-Encoding:
86
+ - gzip
87
+ Accept:
88
+ - application/xml
89
+ User-Agent:
90
+ - Braintree Ruby Gem 3.4.0
91
+ X-Apiversion:
92
+ - '6'
93
+ Content-Type:
94
+ - application/xml
95
+ Authorization:
96
+ - Basic bnl2eGpncnlid3k1amNtODpjZWMxN2Q3NDM2ODU4MjM3M2ZlMjQyOTJiMjQyNDAwYg==
97
+ response:
98
+ status:
99
+ code: 200
100
+ message: ''
101
+ headers:
102
+ Date:
103
+ - Fri, 14 Jan 2022 15:59:12 GMT
104
+ Content-Type:
105
+ - application/xml; charset=utf-8
106
+ X-Frame-Options:
107
+ - SAMEORIGIN
108
+ X-Xss-Protection:
109
+ - 1; mode=block
110
+ X-Content-Type-Options:
111
+ - nosniff
112
+ X-Download-Options:
113
+ - noopen
114
+ X-Permitted-Cross-Domain-Policies:
115
+ - none
116
+ Referrer-Policy:
117
+ - strict-origin-when-cross-origin
118
+ X-Authentication:
119
+ - basic_auth
120
+ X-User:
121
+ - 4b9yb8scv4785hg6
122
+ Vary:
123
+ - Accept-Encoding, Origin
124
+ Content-Encoding:
125
+ - gzip
126
+ Etag:
127
+ - W/"ea38a8fb9c23c4e8f500d972070c51c5"
128
+ Cache-Control:
129
+ - max-age=0, private, must-revalidate
130
+ X-Runtime:
131
+ - '0.048795'
132
+ X-Request-Id:
133
+ - 80edaecc-ea2b-4443-9f4b-aa83ccc08b7b
134
+ Content-Security-Policy:
135
+ - frame-ancestors 'self'
136
+ X-Broxyid:
137
+ - 80edaecc-ea2b-4443-9f4b-aa83ccc08b7b
138
+ Strict-Transport-Security:
139
+ - max-age=31536000; includeSubDomains
140
+ Paypal-Debug-Id:
141
+ - 811aa4a2cf924
142
+ Transfer-Encoding:
143
+ - chunked
144
+ body:
145
+ encoding: ASCII-8BIT
146
+ string: !binary |-
147
+ H4sIANCd4WEAA5RSTW/iMBC991dEuRvHgVSATFClCiQk9sTSbi6VE09D2tgT2Q40++s3Hy2h0l56nDfvvRm/MV9/qNI7g7EF6pXPJoHvgc5QFjpf+b8PGzL31/EdP4NWSESWYa1dfOd5PDMgHEginOeaCla+bEtXKPDjMAhDEjDCZgcWLaPFkgUJp6Og19eV/Jl+FPR6Ca+iLr/EKWIJQvuxMzVw+tnsiYUSOZDalPHJucouKRXWgrOT1IhCOwOQt74X0UwyVLQSjQLtXhS4E8qXEnOk/eMnlc7XoM+FQd0xVlZomeIHp+OAbpzDd9DxvQwvF204HcquYbE2GRAJNjNF5dq842Nn7D0MqS69fs4btvv/h9tnZsFooSAemVeo6w9X6iBSyMGd7BAI4/R7q9+nTq/u9jNGYYxofDocuLYO1cBnwfx+MWPTeXvGG/gbLS8xFWUH/5ke/8rtwiXPu9f94WH26+092B/2sxvxSO48xirbbqL06VjLLSvl9nRONosweYpcyuZh8ribyjBqOL1Rf73s+jX/AQAA//8DAGHXMa/SAgAA
148
+ recorded_at: Fri, 14 Jan 2022 15:59:12 GMT
149
+ - request:
150
+ method: post
151
+ uri: https://api.sandbox.braintreegateway.com/merchants/652zwb86tqk9v5wz/transactions
152
+ body:
153
+ encoding: UTF-8
154
+ string: |
155
+ <?xml version="1.0" encoding="UTF-8"?>
156
+ <transaction>
157
+ <amount>20.00</amount>
158
+ <order-id>R300000001</order-id>
159
+ <channel>Solidus</channel>
160
+ <options>
161
+ <store-in-vault-on-success type="boolean">true</store-in-vault-on-success>
162
+ </options>
163
+ <payment-method-token>6d2wwnr</payment-method-token>
164
+ <customer-id>108694138</customer-id>
165
+ <type>sale</type>
166
+ </transaction>
167
+ headers:
168
+ Accept-Encoding:
169
+ - gzip
170
+ Accept:
171
+ - application/xml
172
+ User-Agent:
173
+ - Braintree Ruby Gem 3.4.0
174
+ X-Apiversion:
175
+ - '6'
176
+ Content-Type:
177
+ - application/xml
178
+ Authorization:
179
+ - Basic bnl2eGpncnlid3k1amNtODpjZWMxN2Q3NDM2ODU4MjM3M2ZlMjQyOTJiMjQyNDAwYg==
180
+ response:
181
+ status:
182
+ code: 201
183
+ message: Created
184
+ headers:
185
+ Date:
186
+ - Fri, 14 Jan 2022 15:59:14 GMT
187
+ Content-Type:
188
+ - application/xml; charset=utf-8
189
+ Transfer-Encoding:
190
+ - chunked
191
+ X-Frame-Options:
192
+ - SAMEORIGIN
193
+ X-Xss-Protection:
194
+ - 1; mode=block
195
+ X-Content-Type-Options:
196
+ - nosniff
197
+ X-Download-Options:
198
+ - noopen
199
+ X-Permitted-Cross-Domain-Policies:
200
+ - none
201
+ Referrer-Policy:
202
+ - strict-origin-when-cross-origin
203
+ X-Authentication:
204
+ - basic_auth
205
+ Strict-Transport-Security:
206
+ - max-age=31536000
207
+ X-User:
208
+ - 4b9yb8scv4785hg6
209
+ Vary:
210
+ - Accept-Encoding, Origin
211
+ Content-Encoding:
212
+ - gzip
213
+ Etag:
214
+ - W/"d3c8043832cbd1aff0a8464e72a2f8aa"
215
+ Cache-Control:
216
+ - max-age=0, private, must-revalidate
217
+ X-Runtime:
218
+ - '1.431154'
219
+ X-Request-Id:
220
+ - a337730f-bfd0-4714-9502-2db5a0d9181a
221
+ Content-Security-Policy:
222
+ - frame-ancestors 'self'
223
+ X-Broxyid:
224
+ - a337730f-bfd0-4714-9502-2db5a0d9181a
225
+ Paypal-Debug-Id:
226
+ - 71b80eeedf854
227
+ body:
228
+ encoding: ASCII-8BIT
229
+ string: !binary |-
230
+ H4sIANKd4WEAA+xZy3PbNhO/56/QaHqFqadjZ2SmmS9NvmbGaes4L18yIAGJsEiCAUA9/Nd3QZAUKQKU0smhh/pk7f4ALBb75uLlLokHGyok4+nNcHwxGg5oGnLC0tXN8OP9G3Q1fOk/WyiBU4lDBSj/2WCwYMRPnm9CkuzJwoMfmiYVVrn0ca4iLtgTBU5J0ly1z6gvcUwXXvGvpoW5EHDaHjHJERxK/Y8fXi+8LlmDccLzVPmT0cVotPDKXwcGEvR7TqWipA1p0DU4oSKMMJBxGBZsEP6WE0LJb7ngcuHZAMXt8gBZeIOUxTdDJXI69MwBGM4SZ0G5IICE/e+mI/M3Xng1sVCQoBgkR1gNtNJuhgR+KpbQIVxyMkGjMRrP7sfzF/PrF+PpA6iuXlCszzNy/voZrD8sKB9IKg5X0T/Mq49HV5fXs/H0qnp2IC+ZkAqlOKHHVwRmjN28kCcZTvcWDk0wiy30LQ0kU7a9soinNvoS7yzUVcwDHGs1f51+eiJvr9XDl3fL2/tXs/eP69Ht/e1s4R0wWhVeUxeLgMUxuEitF9vBP18rUglKwaQIEVRKm9p2iqZEv58TEvMQx0zZthd0Bf5t0y0HR44LV7TKC/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AA=
231
+ recorded_at: Fri, 14 Jan 2022 15:59:14 GMT
232
+ - request:
233
+ method: get
234
+ uri: https://api.sandbox.braintreegateway.com/merchants/652zwb86tqk9v5wz/payment_methods/any/6d2wwnr
235
+ body:
236
+ encoding: US-ASCII
237
+ string: ''
238
+ headers:
239
+ Accept-Encoding:
240
+ - gzip
241
+ Accept:
242
+ - application/xml
243
+ User-Agent:
244
+ - Braintree Ruby Gem 3.4.0
245
+ X-Apiversion:
246
+ - '6'
247
+ Content-Type:
248
+ - application/xml
249
+ Authorization:
250
+ - Basic bnl2eGpncnlid3k1amNtODpjZWMxN2Q3NDM2ODU4MjM3M2ZlMjQyOTJiMjQyNDAwYg==
251
+ response:
252
+ status:
253
+ code: 200
254
+ message: ''
255
+ headers:
256
+ Date:
257
+ - Fri, 14 Jan 2022 15:59:15 GMT
258
+ Content-Type:
259
+ - application/xml; charset=utf-8
260
+ X-Frame-Options:
261
+ - SAMEORIGIN
262
+ X-Xss-Protection:
263
+ - 1; mode=block
264
+ X-Content-Type-Options:
265
+ - nosniff
266
+ X-Download-Options:
267
+ - noopen
268
+ X-Permitted-Cross-Domain-Policies:
269
+ - none
270
+ Referrer-Policy:
271
+ - strict-origin-when-cross-origin
272
+ X-Authentication:
273
+ - basic_auth
274
+ X-User:
275
+ - 4b9yb8scv4785hg6
276
+ Vary:
277
+ - Accept-Encoding, Origin
278
+ Content-Encoding:
279
+ - gzip
280
+ Etag:
281
+ - W/"013474601343415776eaa85ef4251c3a"
282
+ Cache-Control:
283
+ - max-age=0, private, must-revalidate
284
+ X-Runtime:
285
+ - '0.042309'
286
+ X-Request-Id:
287
+ - fb468060-a5a5-46ad-af98-4fe155eb1715
288
+ Content-Security-Policy:
289
+ - frame-ancestors 'self'
290
+ X-Broxyid:
291
+ - fb468060-a5a5-46ad-af98-4fe155eb1715
292
+ Strict-Transport-Security:
293
+ - max-age=31536000; includeSubDomains
294
+ Paypal-Debug-Id:
295
+ - 11622960ec834
296
+ Transfer-Encoding:
297
+ - chunked
298
+ body:
299
+ encoding: ASCII-8BIT
300
+ string: !binary |-
301
+ H4sIANOd4WEAA5RSTW/iMBC991dEuRvHgVSATFClCiQk9sTSbi6VE09D2tgT2Q40++s3Hy2h0l56nDfvvRm/MV9/qNI7g7EF6pXPJoHvgc5QFjpf+b8PGzL31/EdP4NWSESWYa1dfOd5PDMgHEginOeaCla+bEtXKPDjMAhDEjDCZgcWLaPFkgUJp6Og19eV/Jl+FPR6Ca+iLr/EKWIJQvuxMzVw+tnsiYUSOZDalPHJucouKRXWgrOT1IhCOwOQt74X0UwyVLQSjQLtXhS4E8qXEnOk/eMnlc7XoM+FQd0xVlZomeIHp+OAbpzDd9DxvQwvF204HcquYbE2GRAJNjNF5dq842Nn7D0MqS69fs4btvv/h9tnZsFooSAemVeo6w9X6iBSyMGd7BAI4/R7q9+nTq/u9jNGYYxofDocuLYO1cBnwfx+MWPTeXvGG/gbLS8xFWUH/5ke/8rtwiXPu9f94WH26+092B/2sxvxSO48xirbbqL06VjLLSvl9nRONosweYpcyuZh8ribyjBqOL1Rf73s+jX/AQAA//8DAGHXMa/SAgAA
302
+ recorded_at: Fri, 14 Jan 2022 15:59:15 GMT
303
+ - request:
304
+ method: get
305
+ uri: https://api.sandbox.braintreegateway.com/merchants/652zwb86tqk9v5wz/payment_methods/any/6d2wwnr
306
+ body:
307
+ encoding: US-ASCII
308
+ string: ''
309
+ headers:
310
+ Accept-Encoding:
311
+ - gzip
312
+ Accept:
313
+ - application/xml
314
+ User-Agent:
315
+ - Braintree Ruby Gem 3.4.0
316
+ X-Apiversion:
317
+ - '6'
318
+ Content-Type:
319
+ - application/xml
320
+ Authorization:
321
+ - Basic bnl2eGpncnlid3k1amNtODpjZWMxN2Q3NDM2ODU4MjM3M2ZlMjQyOTJiMjQyNDAwYg==
322
+ response:
323
+ status:
324
+ code: 200
325
+ message: ''
326
+ headers:
327
+ Date:
328
+ - Fri, 14 Jan 2022 15:59:15 GMT
329
+ Content-Type:
330
+ - application/xml; charset=utf-8
331
+ X-Frame-Options:
332
+ - SAMEORIGIN
333
+ X-Xss-Protection:
334
+ - 1; mode=block
335
+ X-Content-Type-Options:
336
+ - nosniff
337
+ X-Download-Options:
338
+ - noopen
339
+ X-Permitted-Cross-Domain-Policies:
340
+ - none
341
+ Referrer-Policy:
342
+ - strict-origin-when-cross-origin
343
+ X-Authentication:
344
+ - basic_auth
345
+ X-User:
346
+ - 4b9yb8scv4785hg6
347
+ Vary:
348
+ - Accept-Encoding, Origin
349
+ Content-Encoding:
350
+ - gzip
351
+ Etag:
352
+ - W/"013474601343415776eaa85ef4251c3a"
353
+ Cache-Control:
354
+ - max-age=0, private, must-revalidate
355
+ X-Runtime:
356
+ - '0.082385'
357
+ X-Request-Id:
358
+ - 111f0ea5-3826-4019-b543-04e88b1f6ea0
359
+ Content-Security-Policy:
360
+ - frame-ancestors 'self'
361
+ X-Broxyid:
362
+ - 111f0ea5-3826-4019-b543-04e88b1f6ea0
363
+ Strict-Transport-Security:
364
+ - max-age=31536000; includeSubDomains
365
+ Paypal-Debug-Id:
366
+ - 2f411f12f8be4
367
+ Transfer-Encoding:
368
+ - chunked
369
+ body:
370
+ encoding: ASCII-8BIT
371
+ string: !binary |-
372
+ H4sIANOd4WEAA5RSTW/iMBC991dEuRvHgVSATFClCiQk9sTSbi6VE09D2tgT2Q40++s3Hy2h0l56nDfvvRm/MV9/qNI7g7EF6pXPJoHvgc5QFjpf+b8PGzL31/EdP4NWSESWYa1dfOd5PDMgHEginOeaCla+bEtXKPDjMAhDEjDCZgcWLaPFkgUJp6Og19eV/Jl+FPR6Ca+iLr/EKWIJQvuxMzVw+tnsiYUSOZDalPHJucouKRXWgrOT1IhCOwOQt74X0UwyVLQSjQLtXhS4E8qXEnOk/eMnlc7XoM+FQd0xVlZomeIHp+OAbpzDd9DxvQwvF204HcquYbE2GRAJNjNF5dq842Nn7D0MqS69fs4btvv/h9tnZsFooSAemVeo6w9X6iBSyMGd7BAI4/R7q9+nTq/u9jNGYYxofDocuLYO1cBnwfx+MWPTeXvGG/gbLS8xFWUH/5ke/8rtwiXPu9f94WH26+092B/2sxvxSO48xirbbqL06VjLLSvl9nRONosweYpcyuZh8ribyjBqOL1Rf73s+jX/AQAA//8DAGHXMa/SAgAA
373
+ recorded_at: Fri, 14 Jan 2022 15:59:15 GMT
374
+ - request:
375
+ method: get
376
+ uri: https://api.sandbox.braintreegateway.com/merchants/652zwb86tqk9v5wz/payment_methods/any/6d2wwnr
377
+ body:
378
+ encoding: US-ASCII
379
+ string: ''
380
+ headers:
381
+ Accept-Encoding:
382
+ - gzip
383
+ Accept:
384
+ - application/xml
385
+ User-Agent:
386
+ - Braintree Ruby Gem 3.4.0
387
+ X-Apiversion:
388
+ - '6'
389
+ Content-Type:
390
+ - application/xml
391
+ Authorization:
392
+ - Basic bnl2eGpncnlid3k1amNtODpjZWMxN2Q3NDM2ODU4MjM3M2ZlMjQyOTJiMjQyNDAwYg==
393
+ response:
394
+ status:
395
+ code: 200
396
+ message: ''
397
+ headers:
398
+ Date:
399
+ - Fri, 14 Jan 2022 15:59:16 GMT
400
+ Content-Type:
401
+ - application/xml; charset=utf-8
402
+ X-Frame-Options:
403
+ - SAMEORIGIN
404
+ X-Xss-Protection:
405
+ - 1; mode=block
406
+ X-Content-Type-Options:
407
+ - nosniff
408
+ X-Download-Options:
409
+ - noopen
410
+ X-Permitted-Cross-Domain-Policies:
411
+ - none
412
+ Referrer-Policy:
413
+ - strict-origin-when-cross-origin
414
+ X-Authentication:
415
+ - basic_auth
416
+ X-User:
417
+ - 4b9yb8scv4785hg6
418
+ Vary:
419
+ - Accept-Encoding, Origin
420
+ Content-Encoding:
421
+ - gzip
422
+ Etag:
423
+ - W/"c2f2de8e6145fe1f28148ec02d341b3a"
424
+ Cache-Control:
425
+ - max-age=0, private, must-revalidate
426
+ X-Runtime:
427
+ - '0.041208'
428
+ X-Request-Id:
429
+ - 80771f20-d1bb-4b5d-96d5-90101e5e92d6
430
+ Content-Security-Policy:
431
+ - frame-ancestors 'self'
432
+ X-Broxyid:
433
+ - 80771f20-d1bb-4b5d-96d5-90101e5e92d6
434
+ Strict-Transport-Security:
435
+ - max-age=31536000; includeSubDomains
436
+ Paypal-Debug-Id:
437
+ - 450dfccfcd7f4
438
+ Transfer-Encoding:
439
+ - chunked
440
+ body:
441
+ encoding: ASCII-8BIT
442
+ string: !binary |-
443
+ H4sIANSd4WEAA5RSTW/iMBC991dEuRvHgVSATFClCiQk9sTSbi6VE09D2tgT2Q40++s3Hy2h0l56nDfvvRm/MV9/qNI7g7EF6pXPJoHvgc5QFjpf+b8PGzL31/EdP4NWSESWYa1dfOd5PDMgHEginOeaCla+bEtXKPDjMAhDEjDCZgcWLaPFkgUJp6Og19eV/Jl+FPR6Ca+iLr/EKWIJQvuxMzVw+tnsiYUSOZDalPHJucouKRXWgrOT1IhCOwOQt74X0UwyVLQSjQLtXhS4E8qXEnOk/eMnlc7XoM+FQd0xVlZomeIHp+OAbpzDd9DxvQwvF204HcquYbE2GRAJNjNF5dq842Nn7D0MqS69fs4btvv/h9tnZsFooSAemVeo6w9X6iBSyMGd7BAI4/R7q9+nTq/u9jNGYYxofDocuLYO1cBnwfx+MWPTeXvGG/gbLS8xFWUH/5ke/8rtwiXPu9f94WH26+092B/2sxvxSO48xirbbqL06VjLLSvl9nRONosweYpcyuZh8ribyjBqOL1Rf73s+jX/AQAA//8DAGHXMa/SAgAA
444
+ recorded_at: Fri, 14 Jan 2022 15:59:16 GMT
445
+ - request:
446
+ method: post
447
+ uri: https://api.sandbox.braintreegateway.com/merchants/652zwb86tqk9v5wz/transactions
448
+ body:
449
+ encoding: UTF-8
450
+ string: |
451
+ <?xml version="1.0" encoding="UTF-8"?>
452
+ <transaction>
453
+ <amount>20.00</amount>
454
+ <order-id>R300000002</order-id>
455
+ <channel>Solidus</channel>
456
+ <options>
457
+ <store-in-vault-on-success type="boolean">true</store-in-vault-on-success>
458
+ </options>
459
+ <payment-method-token>6d2wwnr</payment-method-token>
460
+ <customer-id>108694138</customer-id>
461
+ <type>sale</type>
462
+ </transaction>
463
+ headers:
464
+ Accept-Encoding:
465
+ - gzip
466
+ Accept:
467
+ - application/xml
468
+ User-Agent:
469
+ - Braintree Ruby Gem 3.4.0
470
+ X-Apiversion:
471
+ - '6'
472
+ Content-Type:
473
+ - application/xml
474
+ Authorization:
475
+ - Basic bnl2eGpncnlid3k1amNtODpjZWMxN2Q3NDM2ODU4MjM3M2ZlMjQyOTJiMjQyNDAwYg==
476
+ response:
477
+ status:
478
+ code: 201
479
+ message: ''
480
+ headers:
481
+ Date:
482
+ - Fri, 14 Jan 2022 15:59:17 GMT
483
+ Content-Type:
484
+ - application/xml; charset=utf-8
485
+ X-Frame-Options:
486
+ - SAMEORIGIN
487
+ X-Xss-Protection:
488
+ - 1; mode=block
489
+ X-Content-Type-Options:
490
+ - nosniff
491
+ X-Download-Options:
492
+ - noopen
493
+ X-Permitted-Cross-Domain-Policies:
494
+ - none
495
+ Referrer-Policy:
496
+ - strict-origin-when-cross-origin
497
+ X-Authentication:
498
+ - basic_auth
499
+ X-User:
500
+ - 4b9yb8scv4785hg6
501
+ Vary:
502
+ - Accept-Encoding, Origin
503
+ Content-Encoding:
504
+ - gzip
505
+ Etag:
506
+ - W/"c184a27dbdf08734c94c8087afc0d6f8"
507
+ Cache-Control:
508
+ - max-age=0, private, must-revalidate
509
+ X-Runtime:
510
+ - '0.339873'
511
+ X-Request-Id:
512
+ - 1a03d7fa-f8b4-4d90-ba57-c23c3caf9894
513
+ Content-Security-Policy:
514
+ - frame-ancestors 'self'
515
+ X-Broxyid:
516
+ - 1a03d7fa-f8b4-4d90-ba57-c23c3caf9894
517
+ Strict-Transport-Security:
518
+ - max-age=31536000; includeSubDomains
519
+ Paypal-Debug-Id:
520
+ - 7ce93c5faced4
521
+ Transfer-Encoding:
522
+ - chunked
523
+ body:
524
+ encoding: ASCII-8BIT
525
+ string: !binary |-
526
+ H4sIANWd4WEAA+xZS3PbOBK+51eoXHOFqadjp2hm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rSdbZ+lnC2hLuhb33VCLu8nvBuYHmWQZ27XRrVcX5QJpbHauqXoahb4iaJGekZcQCFVFRfOVU11NdWSz44UWkixQj1zlWrE1BU1yxzRxa+6s8a0KxiaQmA4Gk1Hs9nV6PXeDg9wXd20cV/c202XDt6MJ3mbRVXfVHzcKE26lhcJylTyXWNELdnxMV8xiqwqMXeY65009q51TjOrFe3JkHs+2b1gX0KSP27jkH+Mv0/u0nA8W8zf3z3jmzs+f5wfVppWb0fkbquvWwqLXgMzH4RASiv7mGA0nkxnF69NtdCJMVuY5ICTxOZTpynXEL2aPoorTJSu1qZcwO1HiH5mYGayJWj7i9M+jtpurQwrHfMdKleM5yo8Bd4Mvu9///zfuz8/3f915wrL+49edtJXtQdHRsW/fg7srDjrH/f2AvoQ2SCsStPmkq5pUw1SVL4hdKplOu2YZ5mIuXLF0zJQQ+1KWVq1tu1vqv/St3o7oxd9dXVH3tMmoB1R++QZ6OAXzXBfZsSdZnyCIfeaco8xHzPnnhbKadIvDgovDgsD5wf9f+dMJziM1/KYRosevPoHAAD//wMAy+GVoMggAAA=
527
+ recorded_at: Fri, 14 Jan 2022 15:59:17 GMT
528
+ - request:
529
+ method: get
530
+ uri: https://api.sandbox.braintreegateway.com/merchants/652zwb86tqk9v5wz/payment_methods/any/6d2wwnr
531
+ body:
532
+ encoding: US-ASCII
533
+ string: ''
534
+ headers:
535
+ Accept-Encoding:
536
+ - gzip
537
+ Accept:
538
+ - application/xml
539
+ User-Agent:
540
+ - Braintree Ruby Gem 3.4.0
541
+ X-Apiversion:
542
+ - '6'
543
+ Content-Type:
544
+ - application/xml
545
+ Authorization:
546
+ - Basic bnl2eGpncnlid3k1amNtODpjZWMxN2Q3NDM2ODU4MjM3M2ZlMjQyOTJiMjQyNDAwYg==
547
+ response:
548
+ status:
549
+ code: 200
550
+ message: ''
551
+ headers:
552
+ Date:
553
+ - Fri, 14 Jan 2022 15:59:17 GMT
554
+ Content-Type:
555
+ - application/xml; charset=utf-8
556
+ X-Frame-Options:
557
+ - SAMEORIGIN
558
+ X-Xss-Protection:
559
+ - 1; mode=block
560
+ X-Content-Type-Options:
561
+ - nosniff
562
+ X-Download-Options:
563
+ - noopen
564
+ X-Permitted-Cross-Domain-Policies:
565
+ - none
566
+ Referrer-Policy:
567
+ - strict-origin-when-cross-origin
568
+ X-Authentication:
569
+ - basic_auth
570
+ X-User:
571
+ - 4b9yb8scv4785hg6
572
+ Vary:
573
+ - Accept-Encoding, Origin
574
+ Content-Encoding:
575
+ - gzip
576
+ Etag:
577
+ - W/"f9c848e2b5dd8437a5e38291b338d437"
578
+ Cache-Control:
579
+ - max-age=0, private, must-revalidate
580
+ X-Runtime:
581
+ - '0.031702'
582
+ X-Request-Id:
583
+ - b28ad837-f50b-4ec8-943b-a9c3b1d7ff66
584
+ Content-Security-Policy:
585
+ - frame-ancestors 'self'
586
+ X-Broxyid:
587
+ - b28ad837-f50b-4ec8-943b-a9c3b1d7ff66
588
+ Strict-Transport-Security:
589
+ - max-age=31536000; includeSubDomains
590
+ Paypal-Debug-Id:
591
+ - 7aeb9e3a70134
592
+ Transfer-Encoding:
593
+ - chunked
594
+ body:
595
+ encoding: ASCII-8BIT
596
+ string: !binary |-
597
+ H4sIANWd4WEAA5RSTW/iMBC991dEuRvHgVSATFClCiQk9sTSbi6VE09D2tgT2Q40++s3Hy2h0l56nDfvvRm/MV9/qNI7g7EF6pXPJoHvgc5QFjpf+b8PGzL31/EdP4NWSESWYa1dfOd5PDMgHEginOeaCla+bEtXKPDjMAhDEjDCZgcWLaPFkgUJp6Og19eV/Jl+FPR6Ca+iLr/EKWIJQvuxMzVw+tnsiYUSOZDalPHJucouKRXWgrOT1IhCOwOQt74X0UwyVLQSjQLtXhS4E8qXEnOk/eMnlc7XoM+FQd0xVlZomeIHp+OAbpzDd9DxvQwvF204HcquYbE2GRAJNjNF5dq842Nn7D0MqS69fs4btvv/h9tnZsFooSAemVeo6w9X6iBSyMGd7BAI4/R7q9+nTq/u9jNGYYxofDocuLYO1cBnwfx+MWPTeXvGG/gbLS8xFWUH/5ke/8rtwiXPu9f94WH26+092B/2sxvxSO48xirbbqL06VjLLSvl9nRONosweYpcyuZh8ribyjBqOL1Rf73s+jX/AQAA//8DAGHXMa/SAgAA
598
+ recorded_at: Fri, 14 Jan 2022 15:59:17 GMT
599
+ recorded_with: VCR 6.0.0
@@ -0,0 +1,70 @@
1
+ require 'spec_helper'
2
+
3
+ RSpec.describe SolidusPaypalBraintree::BraintreeCheckoutHelper do
4
+ let!(:store) { create :store }
5
+ let(:braintree_configuration) { {} }
6
+
7
+ before do
8
+ store.braintree_configuration.update(braintree_configuration)
9
+ end
10
+
11
+ describe '#venmo_button_style' do
12
+ subject { helper.venmo_button_style(store) }
13
+
14
+ context 'when the venmo button is white and has a width of 280' do
15
+ let(:braintree_configuration) { { preferred_venmo_button_width: '280', preferred_venmo_button_color: 'white' } }
16
+
17
+ it 'returns a hash of the width and color' do
18
+ expect(subject).to eq({ width: '280', color: 'white' })
19
+ end
20
+ end
21
+
22
+ context 'when the venmo button is blue and has a width of 375' do
23
+ let(:braintree_configuration) { { preferred_venmo_button_width: '375', preferred_venmo_button_color: 'blue' } }
24
+
25
+ it 'returns a hash of the width and color' do
26
+ expect(subject).to eq({ width: '375', color: 'blue' })
27
+ end
28
+ end
29
+ end
30
+
31
+ describe '#venmo_button_width' do
32
+ subject { helper.venmo_button_asset_url(style, active: active) }
33
+
34
+ context 'when the given style color is white and width is 280, and the given active is false' do
35
+ let(:style) { { width: '280', color: 'white' } }
36
+ let(:active) { false }
37
+
38
+ it 'returns the correct url' do
39
+ expect(subject).to match(%r[\A/assets/solidus_paypal_braintree/venmo/venmo_white_button_280x48-.+\.svg])
40
+ end
41
+ end
42
+
43
+ context 'when the given style color is white and width is 280, and the given active is true' do
44
+ let(:style) { { width: '280', color: 'white' } }
45
+ let(:active) { true }
46
+
47
+ it 'returns the correct url' do
48
+ expect(subject).to match(%r[\A/assets/solidus_paypal_braintree/venmo/venmo_active_white_button_280x48-.+\.svg])
49
+ end
50
+ end
51
+
52
+ context 'when the given style color is blue and width is 320, and the given active is false' do
53
+ let(:style) { { width: '320', color: 'blue' } }
54
+ let(:active) { false }
55
+
56
+ it 'returns the correct url' do
57
+ expect(subject).to match(%r[\A/assets/solidus_paypal_braintree/venmo/venmo_blue_button_320x48-.+\.svg])
58
+ end
59
+ end
60
+
61
+ context 'when the given style color is blue and width is 320, and the given active is true' do
62
+ let(:style) { { width: '320', color: 'blue' } }
63
+ let(:active) { true }
64
+
65
+ it 'returns the correct url' do
66
+ expect(subject).to match(%r[\A/assets/solidus_paypal_braintree/venmo/venmo_active_blue_button_320x48-.+\.svg])
67
+ end
68
+ end
69
+ end
70
+ end
@@ -1,6 +1,26 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  RSpec.describe SolidusPaypalBraintree::Address do
4
+ describe "::split_name" do
5
+ subject { described_class.split_name(name) }
6
+
7
+ context "with a one word name" do
8
+ let(:name) { "Bruce" }
9
+
10
+ it "correctly splits" do
11
+ expect(subject).to eq ["Bruce"]
12
+ end
13
+ end
14
+
15
+ context "with a multi word name" do
16
+ let(:name) { "Bruce Wayne The Batman" }
17
+
18
+ it "correctly splits" do
19
+ expect(subject).to eq ["Bruce", "Wayne The Batman"]
20
+ end
21
+ end
22
+ end
23
+
4
24
  describe '#to_json' do
5
25
  subject(:address_json) { JSON.parse(described_class.new(spree_address).to_json) }
6
26