solidus_braintree 1.2.0 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (213) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +78 -0
  3. data/.gem_release.yml +5 -0
  4. data/.github/stale.yml +1 -0
  5. data/.github_changelog_generator +2 -0
  6. data/.gitignore +21 -10
  7. data/.rspec +1 -1
  8. data/.rubocop.yml +86 -0
  9. data/CHANGELOG.md +186 -18
  10. data/Gemfile +35 -17
  11. data/LICENSE +26 -0
  12. data/README.md +389 -24
  13. data/Rakefile +6 -16
  14. data/app/assets/config/solidus_braintree_manifest.js +0 -0
  15. data/app/assets/javascripts/spree/backend/solidus_braintree/client.js +239 -0
  16. data/app/assets/javascripts/spree/backend/solidus_braintree/constants.js +89 -0
  17. data/app/assets/javascripts/spree/backend/solidus_braintree/hosted_form.js +46 -0
  18. data/app/assets/javascripts/spree/backend/solidus_braintree/promise.js +20 -0
  19. data/app/assets/javascripts/spree/backend/solidus_braintree.js +96 -0
  20. data/app/assets/stylesheets/spree/backend/solidus_braintree.scss +28 -0
  21. data/app/decorators/controllers/solidus_braintree/admin_payments_controller_decorator.rb +11 -0
  22. data/app/decorators/controllers/solidus_braintree/client_tokens_controller.rb +41 -0
  23. data/app/decorators/models/solidus_braintree/spree/store_decorator.rb +20 -0
  24. data/app/decorators/models/solidus_braintree/spree/user_decorator.rb +13 -0
  25. data/app/helpers/solidus_braintree/braintree_admin_helper.rb +23 -0
  26. data/app/models/application_record.rb +5 -0
  27. data/app/models/solidus_braintree/address.rb +64 -0
  28. data/app/models/solidus_braintree/avs_result.rb +69 -0
  29. data/app/models/solidus_braintree/configuration.rb +39 -0
  30. data/app/models/solidus_braintree/customer.rb +8 -0
  31. data/app/models/solidus_braintree/gateway.rb +437 -0
  32. data/app/models/solidus_braintree/response.rb +80 -0
  33. data/app/models/solidus_braintree/source.rb +140 -0
  34. data/app/models/solidus_braintree/transaction.rb +31 -0
  35. data/app/models/solidus_braintree/transaction_address.rb +88 -0
  36. data/app/models/solidus_braintree/transaction_import.rb +98 -0
  37. data/app/views/spree/api/payments/source_views/_braintree.json.jbuilder +3 -0
  38. data/bin/console +4 -1
  39. data/bin/dummy-app +37 -0
  40. data/bin/rails +5 -5
  41. data/bin/rails-dummy-app +17 -0
  42. data/bin/rails-engine +13 -0
  43. data/bin/rails-sandbox +16 -0
  44. data/bin/rake +7 -0
  45. data/bin/rspec +11 -0
  46. data/bin/sandbox +61 -0
  47. data/bin/setup +5 -4
  48. data/config/locales/en.yml +94 -2
  49. data/config/locales/it.yml +56 -0
  50. data/config/routes.rb +12 -3
  51. data/db/migrate/20160830061749_create_solidus_paypal_braintree_sources.rb +16 -0
  52. data/db/migrate/20160906201711_create_solidus_paypal_braintree_customers.rb +13 -0
  53. data/db/migrate/20161114231422_create_solidus_paypal_braintree_configurations.rb +11 -0
  54. data/db/migrate/20161125172005_add_braintree_configuration_to_stores.rb +7 -0
  55. data/db/migrate/20170203191030_add_credit_card_to_braintree_configuration.rb +6 -0
  56. data/db/migrate/20170505193712_add_null_constraint_to_sources.rb +38 -0
  57. data/db/migrate/20170508085402_add_not_null_constraint_to_sources_payment_type.rb +14 -0
  58. data/db/migrate/20190705115327_add_paypal_button_preferences_to_braintree_configurations.rb +5 -0
  59. data/db/migrate/20190911141712_add_3d_secure_to_braintree_configuration.rb +5 -0
  60. data/db/migrate/20211222170950_add_paypal_funding_source_to_solidus_paypal_braintree_sources.rb +5 -0
  61. data/db/migrate/20220104150301_add_venmo_to_braintree_configuration.rb +5 -0
  62. data/db/migrate/20230109080950_rename_solidus_paypal_braintree_source_type.rb +31 -0
  63. data/db/migrate/20230210104310_add_device_data_to_braintree_sources.rb +5 -0
  64. data/lib/controllers/backend/solidus_braintree/configurations_controller.rb +48 -0
  65. data/lib/generators/solidus_braintree/install/install_generator.rb +155 -19
  66. data/lib/generators/solidus_braintree/install/templates/app/assets/images/solidus_braintree/venmo/venmo_active_blue_button_280x48.svg +19 -0
  67. data/lib/generators/solidus_braintree/install/templates/app/assets/images/solidus_braintree/venmo/venmo_active_blue_button_320x48.svg +19 -0
  68. data/lib/generators/solidus_braintree/install/templates/app/assets/images/solidus_braintree/venmo/venmo_active_blue_button_375x48.svg +19 -0
  69. data/lib/generators/solidus_braintree/install/templates/app/assets/images/solidus_braintree/venmo/venmo_active_white_button_280x48.svg +19 -0
  70. data/lib/generators/solidus_braintree/install/templates/app/assets/images/solidus_braintree/venmo/venmo_active_white_button_320x48.svg +19 -0
  71. data/lib/generators/solidus_braintree/install/templates/app/assets/images/solidus_braintree/venmo/venmo_active_white_button_375x48.svg +19 -0
  72. data/lib/generators/solidus_braintree/install/templates/app/assets/images/solidus_braintree/venmo/venmo_blue_acceptance_mark.svg +15 -0
  73. data/lib/generators/solidus_braintree/install/templates/app/assets/images/solidus_braintree/venmo/venmo_blue_button_280x48.svg +19 -0
  74. data/lib/generators/solidus_braintree/install/templates/app/assets/images/solidus_braintree/venmo/venmo_blue_button_320x48.svg +19 -0
  75. data/lib/generators/solidus_braintree/install/templates/app/assets/images/solidus_braintree/venmo/venmo_blue_button_375x48.svg +19 -0
  76. data/lib/generators/solidus_braintree/install/templates/app/assets/images/solidus_braintree/venmo/venmo_blue_logo.svg +18 -0
  77. data/lib/generators/solidus_braintree/install/templates/app/assets/images/solidus_braintree/venmo/venmo_white_acceptance_mark.svg +20 -0
  78. data/lib/generators/solidus_braintree/install/templates/app/assets/images/solidus_braintree/venmo/venmo_white_button_280x48.svg +19 -0
  79. data/lib/generators/solidus_braintree/install/templates/app/assets/images/solidus_braintree/venmo/venmo_white_button_320x48.svg +19 -0
  80. data/lib/generators/solidus_braintree/install/templates/app/assets/images/solidus_braintree/venmo/venmo_white_button_375x48.svg +19 -0
  81. data/lib/generators/solidus_braintree/install/templates/app/assets/images/solidus_braintree/venmo/venmo_white_logo.svg +18 -0
  82. data/lib/generators/solidus_braintree/install/templates/app/assets/javascripts/spree/frontend/paypal_button.js +34 -0
  83. data/lib/generators/solidus_braintree/install/templates/app/assets/javascripts/spree/frontend/solidus_braintree/ajax.js +13 -0
  84. data/lib/generators/solidus_braintree/install/templates/app/assets/javascripts/spree/frontend/solidus_braintree/apple_pay_button.js +179 -0
  85. data/lib/generators/solidus_braintree/install/templates/app/assets/javascripts/spree/frontend/solidus_braintree/checkout.js +113 -0
  86. data/lib/generators/solidus_braintree/install/templates/app/assets/javascripts/spree/frontend/solidus_braintree/client.js +239 -0
  87. data/lib/generators/solidus_braintree/install/templates/app/assets/javascripts/spree/frontend/solidus_braintree/constants.js +89 -0
  88. data/lib/generators/solidus_braintree/install/templates/app/assets/javascripts/spree/frontend/solidus_braintree/frontend.js +15 -0
  89. data/lib/generators/solidus_braintree/install/templates/app/assets/javascripts/spree/frontend/solidus_braintree/hosted_form.js +48 -0
  90. data/lib/generators/solidus_braintree/install/templates/app/assets/javascripts/spree/frontend/solidus_braintree/paypal_button.js +178 -0
  91. data/lib/generators/solidus_braintree/install/templates/app/assets/javascripts/spree/frontend/solidus_braintree/paypal_messaging.js +22 -0
  92. data/lib/generators/solidus_braintree/install/templates/app/assets/javascripts/spree/frontend/solidus_braintree/promise.js +20 -0
  93. data/lib/generators/solidus_braintree/install/templates/app/assets/javascripts/spree/frontend/solidus_braintree/venmo_button.js +86 -0
  94. data/lib/generators/solidus_braintree/install/templates/app/assets/javascripts/spree/frontend/solidus_braintree.js +1 -0
  95. data/lib/generators/solidus_braintree/install/templates/app/assets/stylesheets/spree/frontend/solidus_braintree.scss +62 -0
  96. data/lib/generators/solidus_braintree/install/templates/app/controllers/solidus_braintree/checkouts_controller.rb +31 -0
  97. data/lib/generators/solidus_braintree/install/templates/app/controllers/solidus_braintree/transactions_controller.rb +67 -0
  98. data/lib/generators/solidus_braintree/install/templates/app/helpers/solidus_braintree/braintree_checkout_helper.rb +60 -0
  99. data/lib/generators/solidus_braintree/install/templates/app/views/checkouts/existing_payment/_braintree.html.erb +2 -0
  100. data/lib/generators/solidus_braintree/install/templates/app/views/checkouts/payment/_braintree.html.erb +23 -0
  101. data/lib/generators/solidus_braintree/install/templates/app/views/payments/_braintree_payment_details.html.erb +9 -0
  102. data/lib/generators/solidus_braintree/install/templates/app/views/spree/shared/_apple_pay_button.html.erb +27 -0
  103. data/lib/generators/solidus_braintree/install/templates/app/views/spree/shared/_braintree_errors.html.erb +16 -0
  104. data/lib/generators/solidus_braintree/install/templates/app/views/spree/shared/_braintree_head_scripts.html.erb +26 -0
  105. data/lib/generators/solidus_braintree/install/templates/app/views/spree/shared/_braintree_hosted_fields.html.erb +40 -0
  106. data/lib/generators/solidus_braintree/install/templates/app/views/spree/shared/_paypal_cart_button.html.erb +38 -0
  107. data/lib/generators/solidus_braintree/install/templates/app/views/spree/shared/_paypal_checkout_button.html.erb +32 -0
  108. data/lib/generators/solidus_braintree/install/templates/app/views/spree/shared/_paypal_messaging.html.erb +13 -0
  109. data/lib/generators/solidus_braintree/install/templates/app/views/spree/shared/_venmo_button.html.erb +33 -0
  110. data/lib/generators/solidus_braintree/install/templates/config/initializers/solidus_braintree.rb +6 -0
  111. data/lib/solidus_braintree/country_mapper.rb +37 -0
  112. data/lib/solidus_braintree/engine.rb +61 -11
  113. data/lib/solidus_braintree/extension_configuration.rb +23 -0
  114. data/lib/solidus_braintree/request_protection.rb +21 -0
  115. data/lib/solidus_braintree/version.rb +3 -1
  116. data/lib/solidus_braintree.rb +14 -2
  117. data/lib/solidus_paypal_braintree.rb +6 -0
  118. data/lib/views/backend/solidus_braintree/configurations/list.html.erb +63 -0
  119. data/lib/views/backend/spree/admin/payments/source_forms/_braintree.html.erb +16 -0
  120. data/lib/views/backend/spree/admin/payments/source_views/_braintree.html.erb +39 -0
  121. data/lib/views/backend/spree/admin/shared/preference_fields/_preference_select.html.erb +13 -0
  122. data/lib/views/backend_v1.2/spree/admin/payments/source_forms/_braintree.html.erb +16 -0
  123. data/lib/views/backend_v2.4/spree/admin/shared/preference_fields/_hash.html.erb +12 -0
  124. data/solidus_braintree.gemspec +37 -38
  125. data/spec/controllers/solidus_braintree/checkouts_controller_spec.rb +99 -0
  126. data/spec/controllers/solidus_braintree/client_tokens_controller_spec.rb +55 -0
  127. data/spec/controllers/solidus_braintree/configurations_controller_spec.rb +73 -0
  128. data/spec/controllers/solidus_braintree/transactions_controller_spec.rb +183 -0
  129. data/spec/fixtures/cassettes/admin/invalid_credit_card.yml +63 -0
  130. data/spec/fixtures/cassettes/admin/resubmit_credit_card.yml +352 -0
  131. data/spec/fixtures/cassettes/admin/valid_credit_card.yml +412 -0
  132. data/spec/fixtures/cassettes/braintree/create_profile.yml +71 -0
  133. data/spec/fixtures/cassettes/braintree/generate_token.yml +63 -0
  134. data/spec/fixtures/cassettes/braintree/token.yml +63 -0
  135. data/spec/fixtures/cassettes/checkout/invalid_credit_card.yml +63 -0
  136. data/spec/fixtures/cassettes/checkout/resubmit_credit_card.yml +216 -0
  137. data/spec/fixtures/cassettes/checkout/update.yml +71 -0
  138. data/spec/fixtures/cassettes/checkout/valid_credit_card.yml +171 -0
  139. data/spec/fixtures/cassettes/checkout/valid_venmo_transaction.yml +599 -0
  140. data/spec/fixtures/cassettes/gateway/authorize/credit_card/address.yml +86 -0
  141. data/spec/fixtures/cassettes/gateway/authorize/merchant_account/EUR.yml +154 -0
  142. data/spec/fixtures/cassettes/gateway/authorize/paypal/EUR.yml +90 -0
  143. data/spec/fixtures/cassettes/gateway/authorize/paypal/address.yml +90 -0
  144. data/spec/fixtures/cassettes/gateway/authorize.yml +86 -0
  145. data/spec/fixtures/cassettes/gateway/authorized_transaction.yml +73 -0
  146. data/spec/fixtures/cassettes/gateway/cancel/missing.yml +63 -0
  147. data/spec/fixtures/cassettes/gateway/cancel/refunds.yml +272 -0
  148. data/spec/fixtures/cassettes/gateway/cancel/void.yml +201 -0
  149. data/spec/fixtures/cassettes/gateway/capture.yml +141 -0
  150. data/spec/fixtures/cassettes/gateway/complete.yml +157 -0
  151. data/spec/fixtures/cassettes/gateway/credit.yml +208 -0
  152. data/spec/fixtures/cassettes/gateway/customer.yml +79 -0
  153. data/spec/fixtures/cassettes/gateway/purchase.yml +87 -0
  154. data/spec/fixtures/cassettes/gateway/settled_transaction.yml +140 -0
  155. data/spec/fixtures/cassettes/gateway/void.yml +137 -0
  156. data/spec/fixtures/cassettes/source/bin.yml +295 -0
  157. data/spec/fixtures/cassettes/source/card_type.yml +267 -0
  158. data/spec/fixtures/cassettes/source/last4.yml +267 -0
  159. data/spec/fixtures/cassettes/transaction/import/valid/capture.yml +224 -0
  160. data/spec/fixtures/cassettes/transaction/import/valid.yml +71 -0
  161. data/spec/fixtures/views/carts/_cart_footer.html.erb +18 -0
  162. data/spec/helpers/solidus_braintree/braintree_admin_helper_spec.rb +17 -0
  163. data/spec/helpers/solidus_braintree/braintree_checkout_helper_spec.rb +70 -0
  164. data/spec/models/solidus_braintree/address_spec.rb +71 -0
  165. data/spec/models/solidus_braintree/avs_result_spec.rb +317 -0
  166. data/spec/models/solidus_braintree/gateway_spec.rb +774 -0
  167. data/spec/models/solidus_braintree/response_spec.rb +280 -0
  168. data/spec/models/solidus_braintree/source_spec.rb +555 -0
  169. data/spec/models/solidus_braintree/transaction_address_spec.rb +235 -0
  170. data/spec/models/solidus_braintree/transaction_import_spec.rb +302 -0
  171. data/spec/models/solidus_braintree/transaction_spec.rb +86 -0
  172. data/spec/models/spree/store_spec.rb +14 -0
  173. data/spec/requests/spree/api/orders_controller_spec.rb +36 -0
  174. data/spec/solidus_braintree_helper.rb +7 -0
  175. data/spec/support/solidus_braintree/capybara.rb +7 -0
  176. data/spec/support/solidus_braintree/factories.rb +55 -0
  177. data/spec/support/solidus_braintree/gateway_helpers.rb +29 -0
  178. data/spec/support/solidus_braintree/order_ready_for_payment.rb +44 -0
  179. data/spec/support/solidus_braintree/order_walkthrough.rb +87 -0
  180. data/spec/support/solidus_braintree/vcr.rb +42 -0
  181. data/spec/support/solidus_braintree/with_prepended_view_fixtures.rb +19 -0
  182. data/spec/system/backend/configuration_spec.rb +23 -0
  183. data/spec/system/backend/new_payment_spec.rb +136 -0
  184. data/spec/system/frontend/braintree_credit_card_checkout_spec.rb +199 -0
  185. data/spec/system/frontend/paypal_checkout_spec.rb +169 -0
  186. data/spec/system/frontend/venmo_checkout_spec.rb +193 -0
  187. metadata +289 -255
  188. data/.travis.yml +0 -41
  189. data/LICENSE.txt +0 -21
  190. data/app/controllers/spree/api/braintree_client_token_controller.rb +0 -13
  191. data/app/helpers/braintree_view_helpers.rb +0 -20
  192. data/app/models/concerns/solidus_braintree/add_name_validation_concern.rb +0 -8
  193. data/app/models/concerns/solidus_braintree/inject_device_data_concern.rb +0 -18
  194. data/app/models/concerns/solidus_braintree/payment_braintree_nonce_concern.rb +0 -8
  195. data/app/models/concerns/solidus_braintree/permitted_attributes_concern.rb +0 -11
  196. data/app/models/concerns/solidus_braintree/skip_require_card_numbers_concern.rb +0 -14
  197. data/app/models/concerns/solidus_braintree/use_data_field_concern.rb +0 -23
  198. data/app/models/credit_card_decorator.rb +0 -3
  199. data/app/models/payment_decorator.rb +0 -2
  200. data/app/models/permitted_attributes_decorator.rb +0 -1
  201. data/app/models/solidus/gateway/braintree_gateway.rb +0 -306
  202. data/app/overrides/spree/checkout/_confirm/braintree_security.html.erb.deface +0 -9
  203. data/app/views/spree/admin/payments/source_forms/_braintree.html.erb +0 -38
  204. data/app/views/spree/admin/payments/source_views/_braintree.html.erb +0 -30
  205. data/app/views/spree/checkout/payment/_braintree.html.erb +0 -55
  206. data/app/views/spree/checkout/payment/_braintree_initialization.html.erb +0 -12
  207. data/config/initializers/braintree.rb +0 -1
  208. data/db/migrate/20150910170527_add_data_to_credit_card.rb +0 -5
  209. data/db/migrate/20160426221931_add_braintree_device_data_to_order.rb +0 -5
  210. data/lib/assets/javascripts/spree/backend/braintree/solidus_braintree.js +0 -59
  211. data/lib/assets/javascripts/spree/frontend/braintree/solidus_braintree.js +0 -144
  212. data/lib/assets/javascripts/vendor/braintree.js +0 -8
  213. data/lib/assets/stylesheets/spree/frontend/solidus_braintree.scss +0 -26
@@ -0,0 +1,56 @@
1
+ it:
2
+ activerecord:
3
+ models:
4
+ solidus_braintree/gateway: Braintree
5
+ spree:
6
+ admin:
7
+ tab:
8
+ braintree: Braintree
9
+ client_sdk_enabled: Client SDK abilitato?
10
+ environment: Environment
11
+ merchant_currency_map: Associazioni tra merchant Braintree e valute
12
+ merchant_id: Merchant ID
13
+ paypal_payee_email_map: Associazioni tra email beneficiari PayPal e valute
14
+ private_key: Private key
15
+ public_key: Public key
16
+ token_generation_enabled: Generazione dei Token abilitata?
17
+ paypal_flow: Flusso PayPal
18
+ solidus_braintree:
19
+ braintree: Braintree
20
+ nonce: Nonce
21
+ token: Token
22
+ errors:
23
+ default_error: Qualcosa è andato storto!
24
+ paypal_popup_closed: La finestra di PayPal è stata chiusa prima di completare il pagamento.
25
+ empty_fields: I campi non possono essere vuoti!
26
+ invalid_fields: Alcuni campi non sono corretti.
27
+ invalid_card: I dati della carta di credito non sono corretti.
28
+ network_error: Si è verificato un errore di rete.
29
+ duplicate_iframe: Ci sono due iframe di Braintree.
30
+ fail_on_duplicate: Questo metodo di pagamento esiste già.
31
+ cvv_verification_failed: Il codice CVV non è corretto.
32
+ threeds:
33
+ authentication_failed: "Autenticazione 3D Secure fallita. Riprova usando un altro metodo di pagamento."
34
+ payment_type:
35
+ label: Metodo di Pagamento
36
+ apple_pay_card: Apple Pay
37
+ credit_card: Carta di credito
38
+ pay_pal_account: PayPal
39
+ configurations:
40
+ title: Configurazioni di Braintree
41
+ tab: Braintree
42
+ update_success: Configurazioni di Braintree aggiornate con successo.
43
+ update_error: Si è verificato un errore durante l'aggiornamento delle configurazioni di Braintree.
44
+ gateway_rejection_reasons:
45
+ avs: Controllo AVS fallito.
46
+ avs_and_cvv: Controlli AVS e CVV falliti.
47
+ cvv: Controllo CVV fallito.
48
+ duplicate: Transazione duplicata.
49
+ fraud: La carta di credito è stata rifiutata a seguito di un potenziale uso fraudolento.
50
+ three_d_secure: Controllo '3D Secure' fallito.
51
+ transaction_statuses:
52
+ authorization_expired: L'autorizzazione di pagamento è scaduta.
53
+ failed: Si è verificato un errore durante l'invio della transazione al sistema di pagamento.
54
+ gateway_rejected: Il gateway di pagamento ha rifiutato questa transazione.
55
+ processor_declined: Il sistema di pagamento ha rifiutato questa transazione.
56
+ settlement_declined: Il saldo di questa transazione è stato rifiutato dal sistema di pagamento.
data/config/routes.rb CHANGED
@@ -1,5 +1,14 @@
1
- Spree::Core::Engine.routes.draw do
2
- namespace :api, defaults: { format: 'json' } do
3
- resource :payment_client_token, only: [:create], controller: 'braintree_client_token'
1
+ # frozen_string_literal: true
2
+
3
+ SolidusBraintree::Engine.routes.draw do
4
+ resource :checkout, only: [:update, :edit]
5
+ resource :client_token, only: [:create], format: :json
6
+ resource :transactions, only: [:create]
7
+
8
+ resources :configurations do
9
+ collection do
10
+ get :list
11
+ post :update
12
+ end
4
13
  end
5
14
  end
@@ -0,0 +1,16 @@
1
+ class CreateSolidusPaypalBraintreeSources < SolidusSupport::Migration[4.2]
2
+ def change
3
+ create_table :solidus_paypal_braintree_sources do |t|
4
+ t.string :nonce
5
+ t.string :token
6
+ t.string :payment_type
7
+ t.integer :user_id, index: true
8
+ t.references :customer, index: true
9
+ t.references :payment_method, index: true
10
+
11
+ t.timestamps null: false
12
+ end
13
+
14
+ add_foreign_key :solidus_paypal_braintree_sources, :spree_payment_methods, column: :payment_method_id
15
+ end
16
+ end
@@ -0,0 +1,13 @@
1
+ class CreateSolidusPaypalBraintreeCustomers < SolidusSupport::Migration[4.2]
2
+ def change
3
+ create_table :solidus_paypal_braintree_customers do |t|
4
+ t.references :user
5
+ t.string :braintree_customer_id
6
+
7
+ t.timestamps
8
+ end
9
+
10
+ add_index :solidus_paypal_braintree_customers, :user_id, unique: true, name: "index_braintree_customers_on_user_id"
11
+ add_index :solidus_paypal_braintree_customers, :braintree_customer_id, unique: true, name: "index_braintree_customers_on_braintree_customer_id" # rubocop:disable Layout/LineLength
12
+ end
13
+ end
@@ -0,0 +1,11 @@
1
+ class CreateSolidusPaypalBraintreeConfigurations < SolidusSupport::Migration[4.2]
2
+ def change
3
+ create_table :solidus_paypal_braintree_configurations do |t|
4
+ t.boolean :paypal, null: false, default: false
5
+ t.boolean :apple_pay, null: false, default: false
6
+ t.integer :store_id, null: false, index: true, foreign_key: { references: :spree_stores }
7
+
8
+ t.timestamps null: false
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,7 @@
1
+ class AddBraintreeConfigurationToStores < SolidusSupport::Migration[4.2]
2
+ # The content of this migration has been removed because store's Braintree
3
+ # configuration doesn't already have paypal_button_preferences fields, so
4
+ # their validations will break this migration.
5
+ #
6
+ # Ref here for more info https://github.com/solidusio/solidus_paypal_braintree/pull/249
7
+ end
@@ -0,0 +1,6 @@
1
+ class AddCreditCardToBraintreeConfiguration < SolidusSupport::Migration[4.2]
2
+ def change
3
+ add_column :solidus_paypal_braintree_configurations, :credit_card,
4
+ :boolean, null: false, default: false
5
+ end
6
+ end
@@ -0,0 +1,38 @@
1
+ class AddNullConstraintToSources < SolidusSupport::Migration[4.2]
2
+ class SpreePayment < ActiveRecord::Base
3
+ end
4
+
5
+ class SolidusPaypalBraintreeSource < ActiveRecord::Base
6
+ end
7
+
8
+ def up
9
+ payments = SpreePayment.arel_table
10
+ sources = SolidusPaypalBraintreeSource.arel_table
11
+ join_sources = payments.join(sources).on(
12
+ payments[:source_id].eq(sources[:id]).and(
13
+ payments[:source_type].eq("SolidusPaypalBraintree::Source")
14
+ ).and(
15
+ sources[:payment_method_id].eq(nil)
16
+ )
17
+ ).join_sources
18
+
19
+ count = SpreePayment.joins(join_sources).count
20
+ Rails.logger.info("Updating #{count} problematic sources")
21
+
22
+ SpreePayment.joins(join_sources).find_each do |payment|
23
+ Rails.logger.info("Updating source #{payment.source_id} with payment method id #{payment.payment_method_id}")
24
+ SolidusPaypalBraintreeSource.where(id: payment.source_id).update_all(
25
+ payment_method_id: payment.payment_method_id
26
+ )
27
+ end
28
+
29
+ # We use a foreign key constraint on the model,
30
+ # but it doesnt make sense to have this model exist without a payment method
31
+ # as two of its methods delegate to the payment method.
32
+ change_column_null(:solidus_paypal_braintree_sources, :payment_method_id, false)
33
+ end
34
+
35
+ def down
36
+ change_column_null(:solidus_paypal_braintree_sources, :payment_method_id, true)
37
+ end
38
+ end
@@ -0,0 +1,14 @@
1
+ class AddNotNullConstraintToSourcesPaymentType < SolidusSupport::Migration[4.2]
2
+ class SolidusPaypalBraintreeSource < ActiveRecord::Base
3
+ end
4
+
5
+ def change
6
+ reversible do |dir|
7
+ dir.up do
8
+ SolidusPaypalBraintreeSource.where(payment_type: nil).
9
+ update_all(payment_type: 'CreditCard')
10
+ end
11
+ end
12
+ change_column_null(:solidus_paypal_braintree_sources, :payment_type, false)
13
+ end
14
+ end
@@ -0,0 +1,5 @@
1
+ class AddPaypalButtonPreferencesToBraintreeConfigurations < ActiveRecord::Migration[5.1]
2
+ def change
3
+ add_column :solidus_paypal_braintree_configurations, :preferences, :text
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ class Add3dSecureToBraintreeConfiguration < SolidusSupport::Migration[4.2]
2
+ def change
3
+ add_column :solidus_paypal_braintree_configurations, :three_d_secure, :boolean, null: false, default: false
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ class AddPaypalFundingSourceToSolidusPaypalBraintreeSources < ActiveRecord::Migration[5.0]
2
+ def change
3
+ add_column :solidus_paypal_braintree_sources, :paypal_funding_source, :integer
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ class AddVenmoToBraintreeConfiguration < ActiveRecord::Migration[5.0]
2
+ def change
3
+ add_column :solidus_paypal_braintree_configurations, :venmo, :boolean, null: false, default: false
4
+ end
5
+ end
@@ -0,0 +1,31 @@
1
+ class RenameSolidusPaypalBraintreeSourceType < ActiveRecord::Migration[6.1]
2
+ # This is based on the best practices recommended in
3
+ # https://github.com/ankane/strong_migrations#backfilling-data on how to
4
+ # safely update a table.
5
+
6
+ disable_ddl_transaction!
7
+
8
+ def up
9
+ Spree::Payment.unscoped
10
+ .where(source_type: 'SolidusPaypalBraintree::Source').in_batches do |relation|
11
+ relation.update_all("source_type = 'SolidusBraintree::Source'")
12
+ sleep(0.01)
13
+ end
14
+
15
+ Spree::WalletPaymentSource.unscoped
16
+ .where(payment_source_type: 'SolidusPaypalBraintree::Source').in_batches do |relation|
17
+ relation.update_all("payment_source_type = 'SolidusBraintree::Source'")
18
+ sleep(0.01)
19
+ end
20
+
21
+ Spree::PaymentMethod.unscoped
22
+ .where('type = ?', 'SolidusPaypalBraintree::Gateway').in_batches do |relation|
23
+ relation.update_all("type = 'SolidusBraintree::Gateway'")
24
+ sleep(0.01)
25
+ end
26
+ end
27
+
28
+ def down
29
+ raise ActiveRecord::IrreversibleMigration
30
+ end
31
+ end
@@ -0,0 +1,5 @@
1
+ class AddDeviceDataToBraintreeSources < ActiveRecord::Migration[5.1]
2
+ def change
3
+ add_column :solidus_paypal_braintree_sources, :device_data, :string
4
+ end
5
+ end
@@ -0,0 +1,48 @@
1
+ # frozen_string_literal: true
2
+
3
+ module SolidusBraintree
4
+ class ConfigurationsController < ::Spree::Admin::BaseController
5
+ helper ::Spree::Core::Engine.routes.url_helpers
6
+
7
+ def list
8
+ authorize! :list, SolidusBraintree::Configuration
9
+
10
+ @configurations = ::Spree::Store.all.map { |s| s.braintree_configuration || s.create_braintree_configuration }
11
+ end
12
+
13
+ def update
14
+ authorize! :update, SolidusBraintree::Configuration
15
+
16
+ params = configurations_params[:configuration_fields]
17
+ results = SolidusBraintree::Configuration.update(params.keys, params.values)
18
+ if results.all?(&:valid?)
19
+ flash[:success] = t('update_success', scope: 'solidus_braintree.configurations')
20
+ else
21
+ flash[:error] = t('update_error', scope: 'solidus_braintree.configurations')
22
+ end
23
+ redirect_to action: :list
24
+ end
25
+
26
+ private
27
+
28
+ def configurations_params
29
+ params.require(:configurations).
30
+ permit(configuration_fields: [
31
+ :paypal,
32
+ :apple_pay,
33
+ :venmo,
34
+ :credit_card,
35
+ :three_d_secure,
36
+ :preferred_paypal_button_locale,
37
+ :preferred_paypal_button_color,
38
+ :preferred_paypal_button_shape,
39
+ :preferred_paypal_button_label,
40
+ :preferred_paypal_button_tagline,
41
+ :preferred_paypal_button_layout,
42
+ :preferred_paypal_button_messaging,
43
+ :preferred_venmo_button_color,
44
+ :preferred_venmo_button_width
45
+ ])
46
+ end
47
+ end
48
+ end
@@ -1,36 +1,172 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'rails/generators/app_base'
4
+
1
5
  module SolidusBraintree
2
6
  module Generators
3
- class InstallGenerator < Rails::Generators::Base
4
- class_option :auto_run_migrations, type: :boolean, default: false
7
+ class InstallGenerator < Rails::Generators::AppBase
8
+ argument :app_path, type: :string, default: Rails.root
9
+
10
+ class_option :migrate, type: :boolean, default: true
11
+ class_option :backend, type: :boolean, default: true
12
+ class_option :frontend, type: :string, default: 'starter'
13
+
14
+ # This is only used to run all-specs during development and CI, regular installation limits
15
+ # installed specs to frontend, which are the ones related to code copied to the target application.
16
+ class_option :specs, type: :string, enum: %w[all frontend], default: 'frontend', hide: true
17
+
18
+ source_root File.expand_path('templates', __dir__)
5
19
 
6
- def add_javascripts
7
- append_file "vendor/assets/javascripts/spree/frontend/all.js", "//= require spree/frontend/braintree/solidus_braintree\n"
8
- append_file "vendor/assets/javascripts/spree/backend/all.js", "//= require spree/backend/braintree/solidus_braintree\n"
20
+ def normalize_components_options
21
+ @components = {
22
+ backend: options[:backend],
23
+ starter_frontend: options[:frontend] == 'starter',
24
+ classic_frontend: options[:frontend] == 'classic',
25
+ }
9
26
  end
10
27
 
11
- def add_stylesheets
12
- inject_into_file "vendor/assets/stylesheets/spree/frontend/all.css", " *= require spree/frontend/solidus_braintree\n", before: '*/', verbose: true
28
+ def add_test_gems
29
+ gem_group :test do
30
+ ['vcr', 'webmock'].each do |gem_name|
31
+ gem gem_name unless Bundler.locked_gems.dependencies[gem_name]
32
+ end
33
+ end
34
+
35
+ bundle_command 'install'
13
36
  end
14
37
 
15
- def add_migrations
16
- run 'bundle exec rake railties:install:migrations FROM=solidus_braintree'
38
+ def setup_initializers
39
+ legacy_initializer_pathname =
40
+ Pathname.new(destination_root).join('config/initializers/solidus_paypal_braintree.rb')
41
+
42
+ if legacy_initializer_pathname.exist?
43
+ legacy_initializer_pathname.rename('config/initializers/solidus_braintree.rb')
44
+
45
+ gsub_file 'config/initializers/solidus_braintree.rb',
46
+ "SolidusPaypalBraintree.configure do |config|\n",
47
+ "SolidusBraintree.configure do |config|\n"
48
+ else
49
+ directory 'config/initializers', 'config/initializers'
50
+ end
17
51
  end
18
52
 
19
53
  def run_migrations
20
- if running_migrations?
21
- run 'bundle exec rake db:migrate'
22
- else
23
- puts "Skiping rake db:migrate, don't forget to run it!"
24
- end
54
+ rake 'railties:install:migrations FROM=solidus_braintree'
55
+ run 'bin/rails db:migrate' if options[:migrate]
56
+ end
57
+
58
+ def mount_engine
59
+ gsub_file 'config/routes.rb',
60
+ "mount SolidusPaypalBraintree::Engine, at: '/solidus_paypal_braintree'\n", ''
61
+
62
+ route "mount SolidusBraintree::Engine, at: '/solidus_braintree'"
63
+ end
64
+
65
+ def install_solidus_backend_support
66
+ support_code_for(:backend) do
67
+ gsub_file 'vendor/assets/javascripts/spree/backend/all.js',
68
+ "//= require spree/backend/solidus_paypal_braintree\n", ''
69
+
70
+ append_file 'vendor/assets/javascripts/spree/backend/all.js',
71
+ "//= require spree/backend/solidus_braintree\n"
72
+
73
+ gsub_file 'vendor/assets/stylesheets/spree/backend/all.css',
74
+ " *= require spree/backend/solidus_paypal_braintree\n", ''
75
+
76
+ inject_into_file 'vendor/assets/stylesheets/spree/backend/all.css',
77
+ " *= require spree/backend/solidus_braintree\n", before: %r{\*/}, verbose: true
78
+ end
79
+ end
80
+
81
+ def install_solidus_starter_frontend_support
82
+ support_code_for(:starter_frontend) do
83
+ directory 'app', 'app'
84
+
85
+ inject_into_file 'vendor/assets/javascripts/spree/frontend/all.js',
86
+ "//= require jquery3\n",
87
+ before: '//= require rails-ujs',
88
+ verbose: true
89
+
90
+ gsub_file 'vendor/assets/javascripts/spree/frontend/all.js',
91
+ "//= require spree/frontend/solidus_paypal_braintree\n", ''
92
+
93
+ append_file 'app/assets/javascripts/solidus_starter_frontend.js',
94
+ "//= require spree/frontend/solidus_braintree\n"
95
+
96
+ gsub_file 'vendor/assets/stylesheets/spree/frontend/all.css',
97
+ " *= require spree/frontend/solidus_paypal_braintree\n", ''
98
+
99
+ inject_into_file 'app/assets/stylesheets/solidus_starter_frontend.css',
100
+ " *= require spree/frontend/solidus_braintree\n", before: %r{\*/}, verbose: true
101
+
102
+ inject_into_class 'app/controllers/checkouts_controller.rb',
103
+ 'CheckoutsController',
104
+ " helper SolidusBraintree::BraintreeCheckoutHelper\n\n",
105
+ verbose: true
106
+
107
+ inject_into_class 'app/controllers/carts_controller.rb',
108
+ 'CartsController',
109
+ " helper SolidusBraintree::BraintreeCheckoutHelper\n\n",
110
+ verbose: true
111
+
112
+ inject_into_file 'app/views/orders/_payment_info.html.erb',
113
+ " <li><%= render 'payments/braintree_payment_details', payment: payment %></li>\n",
114
+ after: "<li><%= payment.payment_method.name %></li>\n",
115
+ verbose: true
116
+
117
+ spec_paths =
118
+ case options[:specs]
119
+ when 'all' then %w[spec]
120
+ when 'frontend'
121
+ %w[
122
+ spec/solidus_braintree_helper.rb
123
+ spec/system/frontend
124
+ spec/support
125
+ spec/fixtures
126
+ ]
127
+ end
128
+
129
+ spec_paths.each do |path|
130
+ if engine.root.join(path).directory?
131
+ directory engine.root.join(path), path
132
+ else
133
+ template engine.root.join(path), path
134
+ end
135
+ end
136
+ end
137
+ end
138
+
139
+ def alert_no_classic_frontend_support
140
+ support_code_for(:classic_frontend) do
141
+ message = <<~TEXT
142
+ For solidus_frontend compatibility, please use version 2.x.
143
+ The new version of this extension only supports Solidus Starter Frontend.
144
+ No frontend code has been copied to your application.
145
+ TEXT
146
+ say_status :error, set_color(message.tr("\n", ' '), :red), :red
147
+ end
25
148
  end
26
149
 
27
150
  private
28
151
 
29
- def running_migrations?
30
- options.auto_run_migrations? || begin
31
- response = ask 'Would you like to run the migrations now? [Y/n]'
32
- ['', 'y'].include? response.downcase
33
- end
152
+ def support_code_for(component_name, &block)
153
+ if @components[component_name]
154
+ say_status :install, "[#{engine.engine_name}] solidus_#{component_name}", :blue
155
+ shell.indent(&block)
156
+ else
157
+ say_status :skip, "[#{engine.engine_name}] solidus_#{component_name}", :blue
158
+ end
159
+ end
160
+
161
+ def engine
162
+ SolidusBraintree::Engine
163
+ end
164
+
165
+ def bundle_command(command, env = {})
166
+ # Make `bundle install` less verbose by skipping the "Using ..." messages
167
+ super(command, env.reverse_merge('BUNDLE_SUPPRESS_INSTALL_USING_MESSAGES' => 'true'))
168
+ ensure
169
+ Bundler.reset_paths!
34
170
  end
35
171
  end
36
172
  end
@@ -0,0 +1,19 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg width="280px" height="48px" viewBox="0 0 280 48" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
3
+ <!-- Generator: Sketch 46.1 (44463) - http://www.bohemiancoding.com/sketch -->
4
+ <title>svg/blue_venmo_button_active_280x48</title>
5
+ <desc>Created with Sketch.</desc>
6
+ <defs></defs>
7
+ <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
8
+ <g id="blue_venmo_button_active_280x48">
9
+ <rect id="Rectangle" fill="#1B74AE" x="0" y="0" width="280" height="48" rx="4"></rect>
10
+ <g id="Group" transform="translate(98.000000, 16.000000)" fill="#FFFFFF">
11
+ <path d="M14.1355722,0.0643062201 C14.6997229,0.996022242 14.9540614,1.95569119 14.9540614,3.16795034 C14.9540614,7.03443424 11.6533091,12.0572714 8.97435371,15.5842648 L2.85545503,15.5842648 L0.401435711,0.910859951 L5.75920168,0.402203543 L7.05667586,10.8432743 C8.26898429,8.86832019 9.76503373,5.76467606 9.76503373,3.64865382 C9.76503373,2.49041769 9.56660332,1.70150782 9.25650148,1.0519281 L14.1355722,0.0643062201 L14.1355722,0.0643062201 Z" id="Shape"></path>
12
+ <path d="M21.0794779,6.525633 C22.0654018,6.525633 24.5475201,6.07462046 24.5475201,4.66393896 C24.5475201,3.98655114 24.0685351,3.64865382 23.5040948,3.64865382 C22.5165776,3.64865382 21.2206966,4.83281521 21.0794779,6.525633 L21.0794779,6.525633 Z M20.9665029,9.31947756 C20.9665029,11.0419863 21.924328,11.7177809 23.1941378,11.7177809 C24.5769225,11.7177809 25.9009024,11.3798836 27.6217431,10.505377 L26.9735853,14.9065874 C25.7611321,15.4989577 23.8715531,15.8942092 22.0374478,15.8942092 C17.3850512,15.8942092 15.7199738,13.0728462 15.7199738,9.545708 C15.7199738,4.97417302 18.4284766,0.120067244 24.0124822,0.120067244 C27.08685,0.120067244 28.8059526,1.84243114 28.8059526,4.24073451 C28.8062423,8.10707358 23.8437439,9.29152463 20.9665029,9.31947756 L20.9665029,9.31947756 Z" id="Shape"></path>
13
+ <path d="M44.2677372,3.50758567 C44.2677372,4.07185827 44.1821369,4.89031424 44.0969712,5.42518557 L42.4892503,15.58412 L37.2722686,15.58412 L38.7387707,6.27159447 C38.7665799,6.01900427 38.8520354,5.51049269 38.8520354,5.22835639 C38.8520354,4.55096858 38.4288137,4.3819475 37.9199918,4.3819475 C37.2441697,4.3819475 36.5667543,4.69203673 36.1155786,4.918412 L34.4522393,15.5842648 L29.2058551,15.5842648 L31.6026627,0.374540282 L36.1433878,0.374540282 L36.2008892,1.58853744 C37.2721237,0.88319669 38.6827177,0.120356912 40.6841129,0.120356912 C43.3356936,0.120067244 44.2677372,1.47498771 44.2677372,3.50758567 L44.2677372,3.50758567 Z" id="Shape"></path>
14
+ <path d="M59.7554481,1.78507694 C61.2496147,0.713885943 62.6604983,0.120067244 64.6058406,0.120067244 C67.2846511,0.120067244 68.216405,1.47498771 68.216405,3.50758567 C68.216405,4.07185827 68.1310944,4.89031424 68.0459287,5.42518557 L66.4400908,15.58412 L61.2216606,15.58412 L62.7161168,6.07476529 C62.7436363,5.82058192 62.8014274,5.51049269 62.8014274,5.31380835 C62.8014274,4.55111341 62.3780609,4.3819475 61.8693838,4.3819475 C61.2213709,4.3819475 60.5736477,4.6640838 60.0927798,4.918412 L58.4297302,15.5842648 L53.2126036,15.5842648 L54.7070598,6.07491013 C54.7345794,5.82072676 54.7906323,5.51063753 54.7906323,5.31395319 C54.7906323,4.55125824 54.367121,4.38209233 53.860182,4.38209233 C53.1829115,4.38209233 52.5069445,4.69218156 52.0557688,4.91855683 L50.3911259,15.5844097 L45.1464798,15.5844097 L47.5429977,0.374685116 L52.0282492,0.374685116 L52.1691783,1.64444329 C53.2126036,0.883486357 54.6220389,0.12064658 56.511473,0.12064658 C58.1474376,0.120067244 59.2185273,0.825552826 59.7554481,1.78507694 L59.7554481,1.78507694 Z" id="Shape"></path>
15
+ <path d="M78.5990953,6.21583344 C78.5990953,4.97417302 78.288559,4.12761929 77.358688,4.12761929 C75.2997914,4.12761929 74.8770043,7.76743825 74.8770043,9.62942196 C74.8770043,11.0419863 75.2722719,11.9162033 76.2018532,11.9162033 C78.1479196,11.9162033 78.5990953,8.07767231 78.5990953,6.21583344 L78.5990953,6.21583344 Z M69.5751464,9.40463986 C69.5751464,4.60817794 72.1127383,0.120067244 77.9512273,0.120067244 C82.3505888,0.120067244 83.9587442,2.71679297 83.9587442,6.30099573 C83.9587442,11.0418415 81.4485271,15.9514186 75.4692539,15.9514186 C71.0415037,15.9514186 69.5751464,13.0446036 69.5751464,9.40463986 L69.5751464,9.40463986 Z" id="Shape"></path>
16
+ </g>
17
+ </g>
18
+ </g>
19
+ </svg>
@@ -0,0 +1,19 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg width="320px" height="48px" viewBox="0 0 320 48" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
3
+ <!-- Generator: Sketch 46.1 (44463) - http://www.bohemiancoding.com/sketch -->
4
+ <title>svg/blue_venmo_button_active_320x48</title>
5
+ <desc>Created with Sketch.</desc>
6
+ <defs></defs>
7
+ <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
8
+ <g id="blue_venmo_button_active_320x48">
9
+ <rect id="Rectangle" fill="#1B74AE" x="0" y="0" width="320" height="48" rx="4"></rect>
10
+ <g id="Group" transform="translate(118.000000, 16.000000)" fill="#FFFFFF">
11
+ <path d="M14.1355722,0.0643062201 C14.6997229,0.996022242 14.9540614,1.95569119 14.9540614,3.16795034 C14.9540614,7.03443424 11.6533091,12.0572714 8.97435371,15.5842648 L2.85545503,15.5842648 L0.401435711,0.910859951 L5.75920168,0.402203543 L7.05667586,10.8432743 C8.26898429,8.86832019 9.76503373,5.76467606 9.76503373,3.64865382 C9.76503373,2.49041769 9.56660332,1.70150782 9.25650148,1.0519281 L14.1355722,0.0643062201 L14.1355722,0.0643062201 Z" id="Shape"></path>
12
+ <path d="M21.0794779,6.525633 C22.0654018,6.525633 24.5475201,6.07462046 24.5475201,4.66393896 C24.5475201,3.98655114 24.0685351,3.64865382 23.5040948,3.64865382 C22.5165776,3.64865382 21.2206966,4.83281521 21.0794779,6.525633 L21.0794779,6.525633 Z M20.9665029,9.31947756 C20.9665029,11.0419863 21.924328,11.7177809 23.1941378,11.7177809 C24.5769225,11.7177809 25.9009024,11.3798836 27.6217431,10.505377 L26.9735853,14.9065874 C25.7611321,15.4989577 23.8715531,15.8942092 22.0374478,15.8942092 C17.3850512,15.8942092 15.7199738,13.0728462 15.7199738,9.545708 C15.7199738,4.97417302 18.4284766,0.120067244 24.0124822,0.120067244 C27.08685,0.120067244 28.8059526,1.84243114 28.8059526,4.24073451 C28.8062423,8.10707358 23.8437439,9.29152463 20.9665029,9.31947756 L20.9665029,9.31947756 Z" id="Shape"></path>
13
+ <path d="M44.2677372,3.50758567 C44.2677372,4.07185827 44.1821369,4.89031424 44.0969712,5.42518557 L42.4892503,15.58412 L37.2722686,15.58412 L38.7387707,6.27159447 C38.7665799,6.01900427 38.8520354,5.51049269 38.8520354,5.22835639 C38.8520354,4.55096858 38.4288137,4.3819475 37.9199918,4.3819475 C37.2441697,4.3819475 36.5667543,4.69203673 36.1155786,4.918412 L34.4522393,15.5842648 L29.2058551,15.5842648 L31.6026627,0.374540282 L36.1433878,0.374540282 L36.2008892,1.58853744 C37.2721237,0.88319669 38.6827177,0.120356912 40.6841129,0.120356912 C43.3356936,0.120067244 44.2677372,1.47498771 44.2677372,3.50758567 L44.2677372,3.50758567 Z" id="Shape"></path>
14
+ <path d="M59.7554481,1.78507694 C61.2496147,0.713885943 62.6604983,0.120067244 64.6058406,0.120067244 C67.2846511,0.120067244 68.216405,1.47498771 68.216405,3.50758567 C68.216405,4.07185827 68.1310944,4.89031424 68.0459287,5.42518557 L66.4400908,15.58412 L61.2216606,15.58412 L62.7161168,6.07476529 C62.7436363,5.82058192 62.8014274,5.51049269 62.8014274,5.31380835 C62.8014274,4.55111341 62.3780609,4.3819475 61.8693838,4.3819475 C61.2213709,4.3819475 60.5736477,4.6640838 60.0927798,4.918412 L58.4297302,15.5842648 L53.2126036,15.5842648 L54.7070598,6.07491013 C54.7345794,5.82072676 54.7906323,5.51063753 54.7906323,5.31395319 C54.7906323,4.55125824 54.367121,4.38209233 53.860182,4.38209233 C53.1829115,4.38209233 52.5069445,4.69218156 52.0557688,4.91855683 L50.3911259,15.5844097 L45.1464798,15.5844097 L47.5429977,0.374685116 L52.0282492,0.374685116 L52.1691783,1.64444329 C53.2126036,0.883486357 54.6220389,0.12064658 56.511473,0.12064658 C58.1474376,0.120067244 59.2185273,0.825552826 59.7554481,1.78507694 L59.7554481,1.78507694 Z" id="Shape"></path>
15
+ <path d="M78.5990953,6.21583344 C78.5990953,4.97417302 78.288559,4.12761929 77.358688,4.12761929 C75.2997914,4.12761929 74.8770043,7.76743825 74.8770043,9.62942196 C74.8770043,11.0419863 75.2722719,11.9162033 76.2018532,11.9162033 C78.1479196,11.9162033 78.5990953,8.07767231 78.5990953,6.21583344 L78.5990953,6.21583344 Z M69.5751464,9.40463986 C69.5751464,4.60817794 72.1127383,0.120067244 77.9512273,0.120067244 C82.3505888,0.120067244 83.9587442,2.71679297 83.9587442,6.30099573 C83.9587442,11.0418415 81.4485271,15.9514186 75.4692539,15.9514186 C71.0415037,15.9514186 69.5751464,13.0446036 69.5751464,9.40463986 L69.5751464,9.40463986 Z" id="Shape"></path>
16
+ </g>
17
+ </g>
18
+ </g>
19
+ </svg>
@@ -0,0 +1,19 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg width="375px" height="48px" viewBox="0 0 375 48" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
3
+ <!-- Generator: Sketch 46.1 (44463) - http://www.bohemiancoding.com/sketch -->
4
+ <title>svg/blue_venmo_button_active_375x48</title>
5
+ <desc>Created with Sketch.</desc>
6
+ <defs></defs>
7
+ <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
8
+ <g id="blue_venmo_button_active_375x48">
9
+ <rect id="Rectangle" fill="#1B74AE" x="0" y="0" width="375" height="48" rx="4"></rect>
10
+ <g id="Group" transform="translate(146.000000, 16.000000)" fill="#FFFFFF">
11
+ <path d="M14.1355722,0.0643062201 C14.6997229,0.996022242 14.9540614,1.95569119 14.9540614,3.16795034 C14.9540614,7.03443424 11.6533091,12.0572714 8.97435371,15.5842648 L2.85545503,15.5842648 L0.401435711,0.910859951 L5.75920168,0.402203543 L7.05667586,10.8432743 C8.26898429,8.86832019 9.76503373,5.76467606 9.76503373,3.64865382 C9.76503373,2.49041769 9.56660332,1.70150782 9.25650148,1.0519281 L14.1355722,0.0643062201 L14.1355722,0.0643062201 Z" id="Shape"></path>
12
+ <path d="M21.0794779,6.525633 C22.0654018,6.525633 24.5475201,6.07462046 24.5475201,4.66393896 C24.5475201,3.98655114 24.0685351,3.64865382 23.5040948,3.64865382 C22.5165776,3.64865382 21.2206966,4.83281521 21.0794779,6.525633 L21.0794779,6.525633 Z M20.9665029,9.31947756 C20.9665029,11.0419863 21.924328,11.7177809 23.1941378,11.7177809 C24.5769225,11.7177809 25.9009024,11.3798836 27.6217431,10.505377 L26.9735853,14.9065874 C25.7611321,15.4989577 23.8715531,15.8942092 22.0374478,15.8942092 C17.3850512,15.8942092 15.7199738,13.0728462 15.7199738,9.545708 C15.7199738,4.97417302 18.4284766,0.120067244 24.0124822,0.120067244 C27.08685,0.120067244 28.8059526,1.84243114 28.8059526,4.24073451 C28.8062423,8.10707358 23.8437439,9.29152463 20.9665029,9.31947756 L20.9665029,9.31947756 Z" id="Shape"></path>
13
+ <path d="M44.2677372,3.50758567 C44.2677372,4.07185827 44.1821369,4.89031424 44.0969712,5.42518557 L42.4892503,15.58412 L37.2722686,15.58412 L38.7387707,6.27159447 C38.7665799,6.01900427 38.8520354,5.51049269 38.8520354,5.22835639 C38.8520354,4.55096858 38.4288137,4.3819475 37.9199918,4.3819475 C37.2441697,4.3819475 36.5667543,4.69203673 36.1155786,4.918412 L34.4522393,15.5842648 L29.2058551,15.5842648 L31.6026627,0.374540282 L36.1433878,0.374540282 L36.2008892,1.58853744 C37.2721237,0.88319669 38.6827177,0.120356912 40.6841129,0.120356912 C43.3356936,0.120067244 44.2677372,1.47498771 44.2677372,3.50758567 L44.2677372,3.50758567 Z" id="Shape"></path>
14
+ <path d="M59.7554481,1.78507694 C61.2496147,0.713885943 62.6604983,0.120067244 64.6058406,0.120067244 C67.2846511,0.120067244 68.216405,1.47498771 68.216405,3.50758567 C68.216405,4.07185827 68.1310944,4.89031424 68.0459287,5.42518557 L66.4400908,15.58412 L61.2216606,15.58412 L62.7161168,6.07476529 C62.7436363,5.82058192 62.8014274,5.51049269 62.8014274,5.31380835 C62.8014274,4.55111341 62.3780609,4.3819475 61.8693838,4.3819475 C61.2213709,4.3819475 60.5736477,4.6640838 60.0927798,4.918412 L58.4297302,15.5842648 L53.2126036,15.5842648 L54.7070598,6.07491013 C54.7345794,5.82072676 54.7906323,5.51063753 54.7906323,5.31395319 C54.7906323,4.55125824 54.367121,4.38209233 53.860182,4.38209233 C53.1829115,4.38209233 52.5069445,4.69218156 52.0557688,4.91855683 L50.3911259,15.5844097 L45.1464798,15.5844097 L47.5429977,0.374685116 L52.0282492,0.374685116 L52.1691783,1.64444329 C53.2126036,0.883486357 54.6220389,0.12064658 56.511473,0.12064658 C58.1474376,0.120067244 59.2185273,0.825552826 59.7554481,1.78507694 L59.7554481,1.78507694 Z" id="Shape"></path>
15
+ <path d="M78.5990953,6.21583344 C78.5990953,4.97417302 78.288559,4.12761929 77.358688,4.12761929 C75.2997914,4.12761929 74.8770043,7.76743825 74.8770043,9.62942196 C74.8770043,11.0419863 75.2722719,11.9162033 76.2018532,11.9162033 C78.1479196,11.9162033 78.5990953,8.07767231 78.5990953,6.21583344 L78.5990953,6.21583344 Z M69.5751464,9.40463986 C69.5751464,4.60817794 72.1127383,0.120067244 77.9512273,0.120067244 C82.3505888,0.120067244 83.9587442,2.71679297 83.9587442,6.30099573 C83.9587442,11.0418415 81.4485271,15.9514186 75.4692539,15.9514186 C71.0415037,15.9514186 69.5751464,13.0446036 69.5751464,9.40463986 L69.5751464,9.40463986 Z" id="Shape"></path>
16
+ </g>
17
+ </g>
18
+ </g>
19
+ </svg>
@@ -0,0 +1,19 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg width="280px" height="48px" viewBox="0 0 280 48" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
3
+ <!-- Generator: Sketch 46.1 (44463) - http://www.bohemiancoding.com/sketch -->
4
+ <title>svg/white_venmo_button_active_280x48</title>
5
+ <desc>Created with Sketch.</desc>
6
+ <defs></defs>
7
+ <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
8
+ <g id="white_venmo_button_active_280x48">
9
+ <rect id="Rectangle" fill="#F7F7F7" x="0" y="0" width="280" height="48" rx="4"></rect>
10
+ <g id="Group" transform="translate(98.000000, 16.000000)" fill="#3D95CE">
11
+ <path d="M14.1355722,0.0643062201 C14.6997229,0.996022242 14.9540614,1.95569119 14.9540614,3.16795034 C14.9540614,7.03443424 11.6533091,12.0572714 8.97435371,15.5842648 L2.85545503,15.5842648 L0.401435711,0.910859951 L5.75920168,0.402203543 L7.05667586,10.8432743 C8.26898429,8.86832019 9.76503373,5.76467606 9.76503373,3.64865382 C9.76503373,2.49041769 9.56660332,1.70150782 9.25650148,1.0519281 L14.1355722,0.0643062201 L14.1355722,0.0643062201 Z" id="Shape"></path>
12
+ <path d="M21.0794779,6.525633 C22.0654018,6.525633 24.5475201,6.07462046 24.5475201,4.66393896 C24.5475201,3.98655114 24.0685351,3.64865382 23.5040948,3.64865382 C22.5165776,3.64865382 21.2206966,4.83281521 21.0794779,6.525633 L21.0794779,6.525633 Z M20.9665029,9.31947756 C20.9665029,11.0419863 21.924328,11.7177809 23.1941378,11.7177809 C24.5769225,11.7177809 25.9009024,11.3798836 27.6217431,10.505377 L26.9735853,14.9065874 C25.7611321,15.4989577 23.8715531,15.8942092 22.0374478,15.8942092 C17.3850512,15.8942092 15.7199738,13.0728462 15.7199738,9.545708 C15.7199738,4.97417302 18.4284766,0.120067244 24.0124822,0.120067244 C27.08685,0.120067244 28.8059526,1.84243114 28.8059526,4.24073451 C28.8062423,8.10707358 23.8437439,9.29152463 20.9665029,9.31947756 L20.9665029,9.31947756 Z" id="Shape"></path>
13
+ <path d="M44.2677372,3.50758567 C44.2677372,4.07185827 44.1821369,4.89031424 44.0969712,5.42518557 L42.4892503,15.58412 L37.2722686,15.58412 L38.7387707,6.27159447 C38.7665799,6.01900427 38.8520354,5.51049269 38.8520354,5.22835639 C38.8520354,4.55096858 38.4288137,4.3819475 37.9199918,4.3819475 C37.2441697,4.3819475 36.5667543,4.69203673 36.1155786,4.918412 L34.4522393,15.5842648 L29.2058551,15.5842648 L31.6026627,0.374540282 L36.1433878,0.374540282 L36.2008892,1.58853744 C37.2721237,0.88319669 38.6827177,0.120356912 40.6841129,0.120356912 C43.3356936,0.120067244 44.2677372,1.47498771 44.2677372,3.50758567 L44.2677372,3.50758567 Z" id="Shape"></path>
14
+ <path d="M59.7554481,1.78507694 C61.2496147,0.713885943 62.6604983,0.120067244 64.6058406,0.120067244 C67.2846511,0.120067244 68.216405,1.47498771 68.216405,3.50758567 C68.216405,4.07185827 68.1310944,4.89031424 68.0459287,5.42518557 L66.4400908,15.58412 L61.2216606,15.58412 L62.7161168,6.07476529 C62.7436363,5.82058192 62.8014274,5.51049269 62.8014274,5.31380835 C62.8014274,4.55111341 62.3780609,4.3819475 61.8693838,4.3819475 C61.2213709,4.3819475 60.5736477,4.6640838 60.0927798,4.918412 L58.4297302,15.5842648 L53.2126036,15.5842648 L54.7070598,6.07491013 C54.7345794,5.82072676 54.7906323,5.51063753 54.7906323,5.31395319 C54.7906323,4.55125824 54.367121,4.38209233 53.860182,4.38209233 C53.1829115,4.38209233 52.5069445,4.69218156 52.0557688,4.91855683 L50.3911259,15.5844097 L45.1464798,15.5844097 L47.5429977,0.374685116 L52.0282492,0.374685116 L52.1691783,1.64444329 C53.2126036,0.883486357 54.6220389,0.12064658 56.511473,0.12064658 C58.1474376,0.120067244 59.2185273,0.825552826 59.7554481,1.78507694 L59.7554481,1.78507694 Z" id="Shape"></path>
15
+ <path d="M78.5990953,6.21583344 C78.5990953,4.97417302 78.288559,4.12761929 77.358688,4.12761929 C75.2997914,4.12761929 74.8770043,7.76743825 74.8770043,9.62942196 C74.8770043,11.0419863 75.2722719,11.9162033 76.2018532,11.9162033 C78.1479196,11.9162033 78.5990953,8.07767231 78.5990953,6.21583344 L78.5990953,6.21583344 Z M69.5751464,9.40463986 C69.5751464,4.60817794 72.1127383,0.120067244 77.9512273,0.120067244 C82.3505888,0.120067244 83.9587442,2.71679297 83.9587442,6.30099573 C83.9587442,11.0418415 81.4485271,15.9514186 75.4692539,15.9514186 C71.0415037,15.9514186 69.5751464,13.0446036 69.5751464,9.40463986 L69.5751464,9.40463986 Z" id="Shape"></path>
16
+ </g>
17
+ </g>
18
+ </g>
19
+ </svg>
@@ -0,0 +1,19 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg width="320px" height="48px" viewBox="0 0 320 48" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
3
+ <!-- Generator: Sketch 46.1 (44463) - http://www.bohemiancoding.com/sketch -->
4
+ <title>svg/white_venmo_button_active_320x48</title>
5
+ <desc>Created with Sketch.</desc>
6
+ <defs></defs>
7
+ <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
8
+ <g id="white_venmo_button_active_320x48">
9
+ <rect id="Rectangle" fill="#F7F7F7" x="0" y="0" width="320" height="48" rx="4"></rect>
10
+ <g id="Group" transform="translate(118.000000, 16.000000)" fill="#3D95CE">
11
+ <path d="M14.1355722,0.0643062201 C14.6997229,0.996022242 14.9540614,1.95569119 14.9540614,3.16795034 C14.9540614,7.03443424 11.6533091,12.0572714 8.97435371,15.5842648 L2.85545503,15.5842648 L0.401435711,0.910859951 L5.75920168,0.402203543 L7.05667586,10.8432743 C8.26898429,8.86832019 9.76503373,5.76467606 9.76503373,3.64865382 C9.76503373,2.49041769 9.56660332,1.70150782 9.25650148,1.0519281 L14.1355722,0.0643062201 L14.1355722,0.0643062201 Z" id="Shape"></path>
12
+ <path d="M21.0794779,6.525633 C22.0654018,6.525633 24.5475201,6.07462046 24.5475201,4.66393896 C24.5475201,3.98655114 24.0685351,3.64865382 23.5040948,3.64865382 C22.5165776,3.64865382 21.2206966,4.83281521 21.0794779,6.525633 L21.0794779,6.525633 Z M20.9665029,9.31947756 C20.9665029,11.0419863 21.924328,11.7177809 23.1941378,11.7177809 C24.5769225,11.7177809 25.9009024,11.3798836 27.6217431,10.505377 L26.9735853,14.9065874 C25.7611321,15.4989577 23.8715531,15.8942092 22.0374478,15.8942092 C17.3850512,15.8942092 15.7199738,13.0728462 15.7199738,9.545708 C15.7199738,4.97417302 18.4284766,0.120067244 24.0124822,0.120067244 C27.08685,0.120067244 28.8059526,1.84243114 28.8059526,4.24073451 C28.8062423,8.10707358 23.8437439,9.29152463 20.9665029,9.31947756 L20.9665029,9.31947756 Z" id="Shape"></path>
13
+ <path d="M44.2677372,3.50758567 C44.2677372,4.07185827 44.1821369,4.89031424 44.0969712,5.42518557 L42.4892503,15.58412 L37.2722686,15.58412 L38.7387707,6.27159447 C38.7665799,6.01900427 38.8520354,5.51049269 38.8520354,5.22835639 C38.8520354,4.55096858 38.4288137,4.3819475 37.9199918,4.3819475 C37.2441697,4.3819475 36.5667543,4.69203673 36.1155786,4.918412 L34.4522393,15.5842648 L29.2058551,15.5842648 L31.6026627,0.374540282 L36.1433878,0.374540282 L36.2008892,1.58853744 C37.2721237,0.88319669 38.6827177,0.120356912 40.6841129,0.120356912 C43.3356936,0.120067244 44.2677372,1.47498771 44.2677372,3.50758567 L44.2677372,3.50758567 Z" id="Shape"></path>
14
+ <path d="M59.7554481,1.78507694 C61.2496147,0.713885943 62.6604983,0.120067244 64.6058406,0.120067244 C67.2846511,0.120067244 68.216405,1.47498771 68.216405,3.50758567 C68.216405,4.07185827 68.1310944,4.89031424 68.0459287,5.42518557 L66.4400908,15.58412 L61.2216606,15.58412 L62.7161168,6.07476529 C62.7436363,5.82058192 62.8014274,5.51049269 62.8014274,5.31380835 C62.8014274,4.55111341 62.3780609,4.3819475 61.8693838,4.3819475 C61.2213709,4.3819475 60.5736477,4.6640838 60.0927798,4.918412 L58.4297302,15.5842648 L53.2126036,15.5842648 L54.7070598,6.07491013 C54.7345794,5.82072676 54.7906323,5.51063753 54.7906323,5.31395319 C54.7906323,4.55125824 54.367121,4.38209233 53.860182,4.38209233 C53.1829115,4.38209233 52.5069445,4.69218156 52.0557688,4.91855683 L50.3911259,15.5844097 L45.1464798,15.5844097 L47.5429977,0.374685116 L52.0282492,0.374685116 L52.1691783,1.64444329 C53.2126036,0.883486357 54.6220389,0.12064658 56.511473,0.12064658 C58.1474376,0.120067244 59.2185273,0.825552826 59.7554481,1.78507694 L59.7554481,1.78507694 Z" id="Shape"></path>
15
+ <path d="M78.5990953,6.21583344 C78.5990953,4.97417302 78.288559,4.12761929 77.358688,4.12761929 C75.2997914,4.12761929 74.8770043,7.76743825 74.8770043,9.62942196 C74.8770043,11.0419863 75.2722719,11.9162033 76.2018532,11.9162033 C78.1479196,11.9162033 78.5990953,8.07767231 78.5990953,6.21583344 L78.5990953,6.21583344 Z M69.5751464,9.40463986 C69.5751464,4.60817794 72.1127383,0.120067244 77.9512273,0.120067244 C82.3505888,0.120067244 83.9587442,2.71679297 83.9587442,6.30099573 C83.9587442,11.0418415 81.4485271,15.9514186 75.4692539,15.9514186 C71.0415037,15.9514186 69.5751464,13.0446036 69.5751464,9.40463986 L69.5751464,9.40463986 Z" id="Shape"></path>
16
+ </g>
17
+ </g>
18
+ </g>
19
+ </svg>