solidus_paypal_commerce_platform 0.7.1 → 1.0.0.beta1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (66) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +21 -9
  3. data/.gem_release.yml +1 -1
  4. data/.gitignore +1 -0
  5. data/.rspec +0 -1
  6. data/.rubocop.yml +3 -2
  7. data/CHANGELOG.md +270 -1
  8. data/Gemfile +0 -41
  9. data/README.md +10 -14
  10. data/Rakefile +6 -2
  11. data/app/models/solidus_paypal_commerce_platform/payment_method.rb +1 -18
  12. data/bin/dummy-app +37 -0
  13. data/bin/rails-dummy-app +17 -0
  14. data/bin/rspec +11 -0
  15. data/bin/sandbox +3 -8
  16. data/config/locales/en.yml +0 -1
  17. data/lib/generators/solidus_paypal_commerce_platform/install/install_generator.rb +35 -21
  18. data/lib/generators/solidus_paypal_commerce_platform/install/templates/app/assets/javascripts/spree/frontend/solidus_paypal_commerce_platform/button_actions.js +272 -0
  19. data/{app → lib/generators/solidus_paypal_commerce_platform/install/templates/app}/assets/javascripts/spree/frontend/solidus_paypal_commerce_platform.js +7 -0
  20. data/{app → lib/generators/solidus_paypal_commerce_platform/install/templates/app}/controllers/solidus_paypal_commerce_platform/paypal_orders_controller.rb +1 -1
  21. data/lib/{views/frontend/spree/checkout → generators/solidus_paypal_commerce_platform/install/templates/app/views/checkouts}/payment/_paypal_commerce_platform.html.erb +5 -4
  22. data/lib/{views/frontend/spree → generators/solidus_paypal_commerce_platform/install/templates/app/views}/orders/payment/_paypal_commerce_platform.html.erb +4 -3
  23. data/lib/{views/frontend/spree → generators/solidus_paypal_commerce_platform/install/templates/app/views}/products/payment/_paypal_commerce_platform.html.erb +1 -1
  24. data/lib/{views/frontend → generators/solidus_paypal_commerce_platform/install/templates/app/views}/solidus_paypal_commerce_platform/shared/_javascript_sdk_tag.html.erb +4 -2
  25. data/lib/solidus_paypal_commerce_platform/version.rb +1 -1
  26. data/solidus_paypal_commerce_platform.gemspec +2 -3
  27. data/spec/jobs/solidus_paypal_commerce_platform/fixtures/CHECKOUT.ORDER.COMPLETED.v2.json +121 -0
  28. data/spec/jobs/solidus_paypal_commerce_platform/fixtures/CHECKOUT.ORDER.PROCESSED.v2.json +121 -0
  29. data/spec/jobs/solidus_paypal_commerce_platform/fixtures/PAYMENT.CAPTURE.COMPLETED.v1.json +50 -0
  30. data/spec/jobs/solidus_paypal_commerce_platform/fixtures/PAYMENT.CAPTURE.COMPLETED.v2.json +72 -0
  31. data/spec/jobs/solidus_paypal_commerce_platform/fixtures/PAYMENT.CAPTURE.DENIED.v1.json +50 -0
  32. data/spec/jobs/solidus_paypal_commerce_platform/fixtures/PAYMENT.CAPTURE.DENIED.v2.json +68 -0
  33. data/spec/jobs/solidus_paypal_commerce_platform/fixtures/PAYMENT.CAPTURE.REFUNDED.v1.json +51 -0
  34. data/spec/jobs/solidus_paypal_commerce_platform/fixtures/PAYMENT.CAPTURE.REFUNDED.v2.json +63 -0
  35. data/spec/jobs/solidus_paypal_commerce_platform/webhook_job_spec.rb +44 -0
  36. data/spec/lib/solidus_paypal_commerce_platform/client_spec.rb +21 -0
  37. data/spec/lib/solidus_paypal_commerce_platform/configuration_spec.rb +91 -0
  38. data/spec/models/solidus_paypal_commerce_platform/payment_method_spec.rb +200 -0
  39. data/spec/models/solidus_paypal_commerce_platform/payment_source_spec.rb +119 -0
  40. data/spec/models/solidus_paypal_commerce_platform/paypal_address_spec.rb +67 -0
  41. data/spec/models/solidus_paypal_commerce_platform/paypal_order_spec.rb +80 -0
  42. data/spec/models/solidus_paypal_commerce_platform/state_guesser_spec.rb +38 -0
  43. data/spec/models/solidus_paypal_commerce_platform/wizard_spec.rb +9 -0
  44. data/spec/requests/solidus_paypal_commerce_platform/orders_controller_spec.rb +36 -0
  45. data/spec/requests/solidus_paypal_commerce_platform/shipping_rates_controller_spec.rb +44 -0
  46. data/spec/requests/solidus_paypal_commerce_platform/wizard_controller_spec.rb +59 -0
  47. data/spec/solidus_paypal_commerce_platform_spec_helper.rb +5 -0
  48. data/spec/support/solidus_paypal_commerce_platform/factories.rb +5 -0
  49. data/spec/support/solidus_paypal_commerce_platform/paypal_sdk_script_tag_helper.rb +13 -0
  50. data/spec/system/backend/new_payment_method_spec.rb +40 -0
  51. data/spec/system/frontend/cart_spec.rb +53 -0
  52. data/spec/system/frontend/checkout_spec.rb +104 -0
  53. data/spec/system/frontend/product_spec.rb +98 -0
  54. metadata +54 -44
  55. data/app/assets/javascripts/spree/frontend/solidus_paypal_commerce_platform/button_actions.js +0 -206
  56. /data/{app → lib/generators/solidus_paypal_commerce_platform/install/templates/app}/assets/javascripts/spree/frontend/solidus_paypal_commerce_platform/buttons.js +0 -0
  57. /data/{app → lib/generators/solidus_paypal_commerce_platform/install/templates/app}/assets/javascripts/spree/frontend/solidus_paypal_commerce_platform/namespace.js +0 -0
  58. /data/{app → lib/generators/solidus_paypal_commerce_platform/install/templates/app}/assets/stylesheets/spree/frontend/solidus_paypal_commerce_platform.css +0 -0
  59. /data/{app → lib/generators/solidus_paypal_commerce_platform/install/templates/app}/controllers/solidus_paypal_commerce_platform/orders_controller.rb +0 -0
  60. /data/{app → lib/generators/solidus_paypal_commerce_platform/install/templates/app}/controllers/solidus_paypal_commerce_platform/payments_controller.rb +0 -0
  61. /data/{app → lib/generators/solidus_paypal_commerce_platform/install/templates/app}/controllers/solidus_paypal_commerce_platform/shipping_rates_controller.rb +0 -0
  62. /data/{app → lib/generators/solidus_paypal_commerce_platform/install/templates/app}/controllers/solidus_paypal_commerce_platform/wizard_controller.rb +0 -0
  63. /data/lib/{views/frontend → generators/solidus_paypal_commerce_platform/install/templates/app/views}/solidus_paypal_commerce_platform/cart/_cart_buttons.html.erb +0 -0
  64. /data/lib/{views/frontend → generators/solidus_paypal_commerce_platform/install/templates/app/views}/solidus_paypal_commerce_platform/payments/_payment.html.erb +0 -0
  65. /data/lib/{views/frontend → generators/solidus_paypal_commerce_platform/install/templates/app/views}/solidus_paypal_commerce_platform/product/_product_buttons.html.erb +0 -0
  66. /data/lib/generators/solidus_paypal_commerce_platform/install/templates/{initializer.rb → config/initializers/solidus_paypal_commerce_platform.rb} +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 29add15e206aaa63909c687def2a858e2adbd186064e2c3d51363d8eebfeb7f3
4
- data.tar.gz: 27086acdc52aa4924ae97952b6a6bf5f3a1f475722c55497c7b8b2364fd9ff43
3
+ metadata.gz: bd0c77c30a42db324d623a2bd37e7ca2d80d107d06c11e5c9c5829bf06e793cf
4
+ data.tar.gz: 33336091ab82d3af94df502291cbfbe0be94d8d5c839e3c73082210a8b4813b8
5
5
  SHA512:
6
- metadata.gz: 665803ae011ffc354a36689544dc6b847f46505f4b9c3bd00a9c27454545e8d58ade9633b94689052c3eb8a7f8a84e4414e5aecd2a0d0f44d0b96546493136c6
7
- data.tar.gz: b24779e70e76e0697dd57fab19c92bf994b6b30f23d3d1471ff8ea55cc2caee08b20c6f9bc6dbf715f431653189b838891922c8ece69bb88fef8cb4db8842c5f
6
+ metadata.gz: 90f698b25df4994cd5037eba1ae264769c1a3667e57f73f415bc38c9d1004bf0e5a4f9404caf57dfba81d65a31340dbe1966d0ef464e673f8ef84b95689ca6b2
7
+ data.tar.gz: f42016a399a1d7d38d942589df248419f0a5395a62891cda436daa0725c377e4c4518076337a1354553fc9e9a9124424e47f27bfd50f4ebf32ee2863673091dd
data/.circleci/config.yml CHANGED
@@ -9,33 +9,45 @@ orbs:
9
9
  # or goes EOL.
10
10
  solidusio_extensions: solidusio/extensions@volatile
11
11
 
12
+ commands:
13
+ test-with-starter-frontend:
14
+ steps:
15
+ - checkout
16
+ - browser-tools/install-chrome
17
+ - run:
18
+ name: Install libvips
19
+ command: sudo apt-get install -y libvips
20
+ - solidusio_extensions/test-branch:
21
+ branch: master
22
+ command: |
23
+ export FRONTEND=starter
24
+ sudo gem update --system
25
+ gem install bundler
26
+ bin/dummy-app
27
+ bin/rspec
28
+ - solidusio_extensions/store-test-results
29
+
12
30
  jobs:
13
31
  run-specs-with-postgres:
14
32
  executor:
15
33
  name: solidusio_extensions/postgres
16
34
  ruby_version: '3.1'
17
35
  steps:
18
- - checkout
19
- - browser-tools/install-chrome
20
- - solidusio_extensions/run-tests
36
+ - test-with-starter-frontend
21
37
 
22
38
  run-specs-with-mysql:
23
39
  executor:
24
40
  name: solidusio_extensions/mysql
25
41
  ruby_version: '3.0'
26
42
  steps:
27
- - checkout
28
- - browser-tools/install-chrome
29
- - solidusio_extensions/run-tests
43
+ - test-with-starter-frontend
30
44
 
31
45
  run-specs-with-sqlite:
32
46
  executor:
33
47
  name: solidusio_extensions/sqlite
34
48
  ruby_version: '2.7'
35
49
  steps:
36
- - checkout
37
- - browser-tools/install-chrome
38
- - solidusio_extensions/run-tests
50
+ - test-with-starter-frontend
39
51
 
40
52
  lint-code:
41
53
  executor: solidusio_extensions/sqlite-memory
data/.gem_release.yml CHANGED
@@ -2,4 +2,4 @@ bump:
2
2
  recurse: false
3
3
  file: 'lib/solidus_paypal_commerce_platform/version.rb'
4
4
  message: Bump SolidusPaypalCommercePlatform to %{version}
5
- tag: false
5
+ tag: true
data/.gitignore CHANGED
@@ -15,6 +15,7 @@ pkg
15
15
  spec/dummy
16
16
  spec/examples.txt
17
17
  /sandbox
18
+ /dummy-app
18
19
  .rvmrc
19
20
  .ruby-version
20
21
  .ruby-gemset
data/.rspec CHANGED
@@ -1,2 +1 @@
1
1
  --color
2
- --require spec_helper
data/.rubocop.yml CHANGED
@@ -6,6 +6,7 @@ AllCops:
6
6
  TargetRubyVersion: '2.7'
7
7
  Exclude:
8
8
  - sandbox/**/*
9
+ - dummy-app/**/*
9
10
  - spec/dummy/**/*
10
11
  - vendor/bundle/**/*
11
12
 
@@ -23,10 +24,10 @@ Naming/VariableNumber:
23
24
  RSpec/AnyInstance:
24
25
  Enabled: false
25
26
 
26
- # Feature specs are not describing any class or module.
27
+ # System specs are not describing any class or module.
27
28
  RSpec/DescribeClass:
28
29
  Exclude:
29
- - spec/features/**/*
30
+ - spec/system/**/*
30
31
 
31
32
  # No need to make the code more complex for no real gain.
32
33
  RSpec/MessageSpies:
data/CHANGELOG.md CHANGED
@@ -1,3 +1,272 @@
1
1
  # Changelog
2
2
 
3
- See https://github.com/solidusio/solidus_paypal_commerce_platform/releases.
3
+ ## [v1.0.0.beta1](https://github.com/solidusio/solidus_paypal_commerce_platform/tree/v1.0.0.beta1) (2022-12-05)
4
+
5
+ [Full Changelog](https://github.com/solidusio/solidus_paypal_commerce_platform/compare/v0.6.0...v1.0.0.beta1)
6
+
7
+ **Closed issues:**
8
+
9
+ - Release 0.6 and attach that version to a different branch [\#169](https://github.com/solidusio/solidus_paypal_commerce_platform/issues/169)
10
+
11
+ **Merged pull requests:**
12
+
13
+ - Bugfixes and improvements \(extracted from the SSF support branch\) [\#168](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/168) ([elia](https://github.com/elia))
14
+ - Reorganize the install generator and deprecate `--skip-migrations` [\#167](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/167) ([elia](https://github.com/elia))
15
+ - Setup compatibility with the starter frontend [\#166](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/166) ([elia](https://github.com/elia))
16
+ - Move 'shipping\_preference' preference under PaypalOrder\#to\_json [\#152](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/152) ([retsef](https://github.com/retsef))
17
+ - Truncate the product name to 127 characters [\#139](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/139) ([DanielePalombo](https://github.com/DanielePalombo))
18
+ - Fix issue on international transactions [\#129](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/129) ([jtapia](https://github.com/jtapia))
19
+
20
+ ## [v0.6.0](https://github.com/solidusio/solidus_paypal_commerce_platform/tree/v0.6.0) (2022-11-25)
21
+
22
+ [Full Changelog](https://github.com/solidusio/solidus_paypal_commerce_platform/compare/v0.5.0...v0.6.0)
23
+
24
+ **Fixed bugs:**
25
+
26
+ - Gem does not support Ruby 3.0 [\#145](https://github.com/solidusio/solidus_paypal_commerce_platform/issues/145)
27
+
28
+ **Closed issues:**
29
+
30
+ - Invalid string length error [\#135](https://github.com/solidusio/solidus_paypal_commerce_platform/issues/135)
31
+ - PayPal SDK JS Error: Disallowed query param: shipping\_preference [\#133](https://github.com/solidusio/solidus_paypal_commerce_platform/issues/133)
32
+
33
+ ## [v0.5.0](https://github.com/solidusio/solidus_paypal_commerce_platform/tree/v0.5.0) (2022-10-07)
34
+
35
+ [Full Changelog](https://github.com/solidusio/solidus_paypal_commerce_platform/compare/v0.4.0...v0.5.0)
36
+
37
+ **Merged pull requests:**
38
+
39
+ - Update links after moving to @solidusio [\#164](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/164) ([elia](https://github.com/elia))
40
+ - Assign created orders to users / Require Solidus 3 & Ruby 2.7 [\#163](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/163) ([elia](https://github.com/elia))
41
+ - Fix master, import paypal-checkout-sdk [\#161](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/161) ([cpfergus1](https://github.com/cpfergus1))
42
+ - Update to use forked solidus\_frontend when needed [\#160](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/160) ([waiting-for-dev](https://github.com/waiting-for-dev))
43
+ - Fix paypal\_order name address bug [\#153](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/153) ([RyanofWoods](https://github.com/RyanofWoods))
44
+
45
+ ## [v0.4.0](https://github.com/solidusio/solidus_paypal_commerce_platform/tree/v0.4.0) (2022-06-03)
46
+
47
+ [Full Changelog](https://github.com/solidusio/solidus_paypal_commerce_platform/compare/v0.3.2...v0.4.0)
48
+
49
+ **Closed issues:**
50
+
51
+ - Gem has RuboCop warnings [\#144](https://github.com/solidusio/solidus_paypal_commerce_platform/issues/144)
52
+ - Silent Failure In JS [\#130](https://github.com/solidusio/solidus_paypal_commerce_platform/issues/130)
53
+ - Not Applying Sales Tax [\#126](https://github.com/solidusio/solidus_paypal_commerce_platform/issues/126)
54
+
55
+ **Merged pull requests:**
56
+
57
+ - Bump SolidusPaypalCommercePlatform to 0.4.0 [\#158](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/158) ([gsmendoza](https://github.com/gsmendoza))
58
+ - Fix Rails 7 autoloading issues with SolidusPaypalCommercePlatform [\#156](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/156) ([gsmendoza](https://github.com/gsmendoza))
59
+ - Block \#capture on Pending Payments" [\#155](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/155) ([Naokimi](https://github.com/Naokimi))
60
+ - Block \#capture on PayPal PENDING Payments [\#154](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/154) ([Naokimi](https://github.com/Naokimi))
61
+ - Change Venmo integration to use Venmo standalone [\#151](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/151) ([RyanofWoods](https://github.com/RyanofWoods))
62
+ - Allow enable\_venmo preference to have default Venmo behaviour [\#148](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/148) ([RyanofWoods](https://github.com/RyanofWoods))
63
+ - Fix RuboCop warnings [\#147](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/147) ([RyanofWoods](https://github.com/RyanofWoods))
64
+ - Revert "Allow Ruby 3" [\#146](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/146) ([RyanofWoods](https://github.com/RyanofWoods))
65
+ - Add Venmo as payment option [\#138](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/138) ([RyanofWoods](https://github.com/RyanofWoods))
66
+ - Wizard\#logo use `image_path` over `image_url`. [\#131](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/131) ([essn](https://github.com/essn))
67
+
68
+ ## [v0.3.2](https://github.com/solidusio/solidus_paypal_commerce_platform/tree/v0.3.2) (2021-05-11)
69
+
70
+ [Full Changelog](https://github.com/solidusio/solidus_paypal_commerce_platform/compare/v0.3.1...v0.3.2)
71
+
72
+ **Closed issues:**
73
+
74
+ - Unable To Cancel An Order [\#120](https://github.com/solidusio/solidus_paypal_commerce_platform/issues/120)
75
+
76
+ **Merged pull requests:**
77
+
78
+ - Update solidus using solidus\_dev\_support [\#124](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/124) ([DanielePalombo](https://github.com/DanielePalombo))
79
+ - Add NO\_SHIPPING to shipping preference [\#123](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/123) ([DanielePalombo](https://github.com/DanielePalombo))
80
+ - Support solidus 3.0 [\#122](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/122) ([DanielePalombo](https://github.com/DanielePalombo))
81
+
82
+ ## [v0.3.1](https://github.com/solidusio/solidus_paypal_commerce_platform/tree/v0.3.1) (2021-04-20)
83
+
84
+ [Full Changelog](https://github.com/solidusio/solidus_paypal_commerce_platform/compare/v0.3.0...v0.3.1)
85
+
86
+ **Merged pull requests:**
87
+
88
+ - Allow Solidus 3 [\#121](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/121) ([kennyadsl](https://github.com/kennyadsl))
89
+
90
+ ## [v0.3.0](https://github.com/solidusio/solidus_paypal_commerce_platform/tree/v0.3.0) (2021-03-16)
91
+
92
+ [Full Changelog](https://github.com/solidusio/solidus_paypal_commerce_platform/compare/v0.2.2...v0.3.0)
93
+
94
+ **Closed issues:**
95
+
96
+ - Prepare Solidus Paypal Commerce Platform for Solidus 3.0 [\#115](https://github.com/solidusio/solidus_paypal_commerce_platform/issues/115)
97
+
98
+ **Merged pull requests:**
99
+
100
+ - Use new factories loading method [\#118](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/118) ([kennyadsl](https://github.com/kennyadsl))
101
+ - Update extension for Solidus 3.0 [\#117](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/117) ([seand7565](https://github.com/seand7565))
102
+
103
+ ## [v0.2.2](https://github.com/solidusio/solidus_paypal_commerce_platform/tree/v0.2.2) (2020-11-20)
104
+
105
+ [Full Changelog](https://github.com/solidusio/solidus_paypal_commerce_platform/compare/v0.2.1...v0.2.2)
106
+
107
+ **Implemented enhancements:**
108
+
109
+ - Make the PayPal messaging component a bit more modular [\#112](https://github.com/solidusio/solidus_paypal_commerce_platform/issues/112)
110
+ - Implement and QA Paypal credit solutions [\#99](https://github.com/solidusio/solidus_paypal_commerce_platform/issues/99)
111
+
112
+ **Closed issues:**
113
+
114
+ - Simulated Address Info in Live Order [\#104](https://github.com/solidusio/solidus_paypal_commerce_platform/issues/104)
115
+
116
+ **Merged pull requests:**
117
+
118
+ - Relax SolidusWebhooks dependency [\#114](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/114) ([kennyadsl](https://github.com/kennyadsl))
119
+ - Add information about paypal credit messaging to readme [\#113](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/113) ([seand7565](https://github.com/seand7565))
120
+
121
+ ## [v0.2.1](https://github.com/solidusio/solidus_paypal_commerce_platform/tree/v0.2.1) (2020-11-09)
122
+
123
+ [Full Changelog](https://github.com/solidusio/solidus_paypal_commerce_platform/compare/v0.2.0...v0.2.1)
124
+
125
+ **Closed issues:**
126
+
127
+ - There was a problem connecting with paypal. [\#107](https://github.com/solidusio/solidus_paypal_commerce_platform/issues/107)
128
+ - Bad Request \(400\) when opening PayPal Payment Popup \(eg clicking Pay with PayPal during checkout\) [\#103](https://github.com/solidusio/solidus_paypal_commerce_platform/issues/103)
129
+
130
+ **Merged pull requests:**
131
+
132
+ - Move and rename address decorator [\#111](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/111) ([seand7565](https://github.com/seand7565))
133
+ - Constrain solidus\_support to 0.5.1 or greater [\#110](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/110) ([seand7565](https://github.com/seand7565))
134
+ - Add currency to PayPal SDK URL [\#108](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/108) ([seand7565](https://github.com/seand7565))
135
+ - Update specs to comply with new rubocop regulations [\#106](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/106) ([seand7565](https://github.com/seand7565))
136
+ - Add address only to initial PayPal request [\#105](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/105) ([seand7565](https://github.com/seand7565))
137
+
138
+ ## [v0.2.0](https://github.com/solidusio/solidus_paypal_commerce_platform/tree/v0.2.0) (2020-10-13)
139
+
140
+ [Full Changelog](https://github.com/solidusio/solidus_paypal_commerce_platform/compare/v0.2.0.alpha.1...v0.2.0)
141
+
142
+ **Merged pull requests:**
143
+
144
+ - Add PayPal messaging component [\#102](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/102) ([seand7565](https://github.com/seand7565))
145
+ - Add partner ID attribute to SDK javascript tag [\#101](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/101) ([seand7565](https://github.com/seand7565))
146
+ - Set current\_order\_id and token during payment step [\#100](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/100) ([MFRWDesign](https://github.com/MFRWDesign))
147
+ - Remove incorrect/unclear info from README [\#98](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/98) ([seand7565](https://github.com/seand7565))
148
+ - Update the extension with the latest solidus\_dev\_support defaults [\#95](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/95) ([elia](https://github.com/elia))
149
+ - Add skip migration option to installer [\#94](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/94) ([seand7565](https://github.com/seand7565))
150
+ - Update README to reflect referral fee [\#93](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/93) ([seand7565](https://github.com/seand7565))
151
+
152
+ ## [v0.2.0.alpha.1](https://github.com/solidusio/solidus_paypal_commerce_platform/tree/v0.2.0.alpha.1) (2020-10-07)
153
+
154
+ [Full Changelog](https://github.com/solidusio/solidus_paypal_commerce_platform/compare/v0.1.0...v0.2.0.alpha.1)
155
+
156
+ **Closed issues:**
157
+
158
+ - README lists two different types of PayPal credentials [\#97](https://github.com/solidusio/solidus_paypal_commerce_platform/issues/97)
159
+ - `paypal_email_confirmed` is not an actual preference [\#96](https://github.com/solidusio/solidus_paypal_commerce_platform/issues/96)
160
+ - Make this extension the default option for Solidus [\#88](https://github.com/solidusio/solidus_paypal_commerce_platform/issues/88)
161
+
162
+ ## [v0.1.0](https://github.com/solidusio/solidus_paypal_commerce_platform/tree/v0.1.0) (2020-09-03)
163
+
164
+ [Full Changelog](https://github.com/solidusio/solidus_paypal_commerce_platform/compare/v0.0.1...v0.1.0)
165
+
166
+ **Merged pull requests:**
167
+
168
+ - Temporarily switch from apparition to cuprite [\#92](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/92) ([elia](https://github.com/elia))
169
+ - Update links after moving the repo to solidusio-contrib [\#91](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/91) ([elia](https://github.com/elia))
170
+ - Add a configurable state\_guesser class to guess states [\#90](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/90) ([seand7565](https://github.com/seand7565))
171
+ - Add better error handling to button\_actions.js [\#89](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/89) ([seand7565](https://github.com/seand7565))
172
+
173
+ ## [v0.0.1](https://github.com/solidusio/solidus_paypal_commerce_platform/tree/v0.0.1) (2020-08-10)
174
+
175
+ [Full Changelog](https://github.com/solidusio/solidus_paypal_commerce_platform/compare/11111204cc53e8bcfd365ae70506c07940446b0c...v0.0.1)
176
+
177
+ **Implemented enhancements:**
178
+
179
+ - Frontend users should be able to check out using PayPal [\#6](https://github.com/solidusio/solidus_paypal_commerce_platform/issues/6)
180
+ - Admin users should be able to style the PayPal buttons on the payment\_method show page [\#5](https://github.com/solidusio/solidus_paypal_commerce_platform/issues/5)
181
+ - Webhooks [\#83](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/83) ([elia](https://github.com/elia))
182
+ - Display paypal email to customer on confirmation [\#54](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/54) ([seand7565](https://github.com/seand7565))
183
+ - Use an env accessor to control live/sandbox urls and classes [\#31](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/31) ([elia](https://github.com/elia))
184
+ - Add response object to API calls to PayPal [\#30](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/30) ([seand7565](https://github.com/seand7565))
185
+
186
+ **Fixed bugs:**
187
+
188
+ - Users can check out with invalid payment [\#19](https://github.com/solidusio/solidus_paypal_commerce_platform/issues/19)
189
+ - Have different nonce for every click of the wizard button [\#87](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/87) ([elia](https://github.com/elia))
190
+ - Correctly communicate errors when updating shipping rates [\#86](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/86) ([elia](https://github.com/elia))
191
+ - Add deface to deps [\#57](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/57) ([elia](https://github.com/elia))
192
+
193
+ **Closed issues:**
194
+
195
+ - Add something to the README about backend payments [\#75](https://github.com/solidusio/solidus_paypal_commerce_platform/issues/75)
196
+ - Explore enabling the payment method by default [\#71](https://github.com/solidusio/solidus_paypal_commerce_platform/issues/71)
197
+ - Explore subscribing to webhooks [\#70](https://github.com/solidusio/solidus_paypal_commerce_platform/issues/70)
198
+ - We're using the wrong ID for paypal\_order\_id [\#69](https://github.com/solidusio/solidus_paypal_commerce_platform/issues/69)
199
+ - Handle instrument declined errors [\#68](https://github.com/solidusio/solidus_paypal_commerce_platform/issues/68)
200
+ - Extend lightbox during customer payment [\#63](https://github.com/solidusio/solidus_paypal_commerce_platform/issues/63)
201
+ - Add this extension to demo store for integration team walkthrough [\#49](https://github.com/solidusio/solidus_paypal_commerce_platform/issues/49)
202
+ - Store PayPal Debug ID [\#48](https://github.com/solidusio/solidus_paypal_commerce_platform/issues/48)
203
+ - PayPal email address needs to be included on the confirm step [\#47](https://github.com/solidusio/solidus_paypal_commerce_platform/issues/47)
204
+ - Digital goods should be set as not requiring shipment [\#46](https://github.com/solidusio/solidus_paypal_commerce_platform/issues/46)
205
+ - Allow checkout on product/cart page to complete the order [\#44](https://github.com/solidusio/solidus_paypal_commerce_platform/issues/44)
206
+ - PayPal uses different states than Solidus for some countries [\#38](https://github.com/solidusio/solidus_paypal_commerce_platform/issues/38)
207
+ - Validate amount charged with PayPal [\#37](https://github.com/solidusio/solidus_paypal_commerce_platform/issues/37)
208
+ - Allow order simulator to be a configurable class [\#36](https://github.com/solidusio/solidus_paypal_commerce_platform/issues/36)
209
+ - Admin users have the option to edit payment amount [\#29](https://github.com/solidusio/solidus_paypal_commerce_platform/issues/29)
210
+ - Add PayPal button to product page [\#27](https://github.com/solidusio/solidus_paypal_commerce_platform/issues/27)
211
+ - Add PayPal button to cart page [\#26](https://github.com/solidusio/solidus_paypal_commerce_platform/issues/26)
212
+ - Add `commit=false` to javascript SDK URL [\#18](https://github.com/solidusio/solidus_paypal_commerce_platform/issues/18)
213
+ - Explore using Rails secrets to encode and decrypt PayPal client id and secret [\#17](https://github.com/solidusio/solidus_paypal_commerce_platform/issues/17)
214
+ - Backend users should be able to checkout & admin payments [\#15](https://github.com/solidusio/solidus_paypal_commerce_platform/issues/15)
215
+ - Change static sandbox URL and objects to dynamic [\#14](https://github.com/solidusio/solidus_paypal_commerce_platform/issues/14)
216
+ - PayPal response address change [\#13](https://github.com/solidusio/solidus_paypal_commerce_platform/issues/13)
217
+ - Ensure the email is verified before activating the payment method [\#9](https://github.com/solidusio/solidus_paypal_commerce_platform/issues/9)
218
+ - Add a URL generator for the PayPal JS SDK [\#8](https://github.com/solidusio/solidus_paypal_commerce_platform/issues/8)
219
+ - Allow users to onboard with PayPal [\#1](https://github.com/solidusio/solidus_paypal_commerce_platform/issues/1)
220
+
221
+ **Merged pull requests:**
222
+
223
+ - Use live partner ids [\#85](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/85) ([elia](https://github.com/elia))
224
+ - Update README to account for checkouts without a confirmation step [\#84](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/84) ([seand7565](https://github.com/seand7565))
225
+ - Replace order simulator with something simpler [\#82](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/82) ([seand7565](https://github.com/seand7565))
226
+ - Cleanup [\#81](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/81) ([elia](https://github.com/elia))
227
+ - Send line\_item and shipping promotions to PayPal [\#80](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/80) ([seand7565](https://github.com/seand7565))
228
+ - Change outstanding\_balance to total in order total checker [\#79](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/79) ([seand7565](https://github.com/seand7565))
229
+ - Add overlay to ease transition to confirmation page [\#78](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/78) ([seand7565](https://github.com/seand7565))
230
+ - Default available\_to\_users to true [\#77](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/77) ([seand7565](https://github.com/seand7565))
231
+ - Add info about PayPal Terminal to README [\#76](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/76) ([seand7565](https://github.com/seand7565))
232
+ - Return a payment declined error on the frontend [\#74](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/74) ([seand7565](https://github.com/seand7565))
233
+ - Only use the necessary data to let the spec pass [\#73](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/73) ([elia](https://github.com/elia))
234
+ - Display capture\_id instead of order\_id to admin user [\#72](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/72) ([seand7565](https://github.com/seand7565))
235
+ - Use options instead of preferences [\#67](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/67) ([seand7565](https://github.com/seand7565))
236
+ - Update README to reflect new preferences [\#66](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/66) ([seand7565](https://github.com/seand7565))
237
+ - Add version to cache\_key [\#65](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/65) ([seand7565](https://github.com/seand7565))
238
+ - Include payment method information in pricing options cache key [\#62](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/62) ([seand7565](https://github.com/seand7565))
239
+ - Only use available payment\_methods [\#61](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/61) ([seand7565](https://github.com/seand7565))
240
+ - Explicitly require deface [\#60](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/60) ([elia](https://github.com/elia))
241
+ - Verify email address is verified before allowing payment method to be available [\#59](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/59) ([seand7565](https://github.com/seand7565))
242
+ - Use the ORB definition of lint-code [\#58](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/58) ([elia](https://github.com/elia))
243
+ - Send amount of payment to PayPal on capture [\#56](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/56) ([seand7565](https://github.com/seand7565))
244
+ - Verify amount to charge with order total [\#55](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/55) ([seand7565](https://github.com/seand7565))
245
+ - Linting the project with rubocop [\#53](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/53) ([elia](https://github.com/elia))
246
+ - Add PayPal Debug ID to log entries [\#52](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/52) ([seand7565](https://github.com/seand7565))
247
+ - Fix PayPal request success message en.yml paths [\#51](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/51) ([seand7565](https://github.com/seand7565))
248
+ - Add configuration options to SolidusPaypalCommercePlatform [\#50](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/50) ([seand7565](https://github.com/seand7565))
249
+ - Add PayPal button to product page [\#45](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/45) ([seand7565](https://github.com/seand7565))
250
+ - Add PayPal Button To Cart Page [\#43](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/43) ([seand7565](https://github.com/seand7565))
251
+ - Add ability to change address on PayPal [\#42](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/42) ([seand7565](https://github.com/seand7565))
252
+ - Add a basic codecov config to show commit status [\#41](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/41) ([elia](https://github.com/elia))
253
+ - Add CI & Coverage badges to the readme [\#40](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/40) ([elia](https://github.com/elia))
254
+ - Rely on sdk request classes [\#39](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/39) ([elia](https://github.com/elia))
255
+ - Use "commit=false" in the JS SDK url when "confirm" step is present [\#33](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/33) ([elia](https://github.com/elia))
256
+ - Renames: Gateway → PaymentMethod / Requests → Gateway [\#32](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/32) ([elia](https://github.com/elia))
257
+ - Add PayPal Virtual Terminal notice to backend [\#25](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/25) ([seand7565](https://github.com/seand7565))
258
+ - Add missing partials necessary for backend [\#24](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/24) ([seand7565](https://github.com/seand7565))
259
+ - Add the ability to void authorized payments [\#23](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/23) ([seand7565](https://github.com/seand7565))
260
+ - Fix order controller response [\#22](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/22) ([seand7565](https://github.com/seand7565))
261
+ - Add refund ability to admin payment management [\#21](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/21) ([seand7565](https://github.com/seand7565))
262
+ - Fixes and refactoring [\#20](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/20) ([elia](https://github.com/elia))
263
+ - Add ability for admin users to customize paypal button [\#16](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/16) ([seand7565](https://github.com/seand7565))
264
+ - Restore the generic bin/rails command [\#11](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/11) ([elia](https://github.com/elia))
265
+ - Add PayPal buttons to frontend checkout flow [\#10](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/10) ([seand7565](https://github.com/seand7565))
266
+ - Update readme to reflect onboarding and wizards 🧙 [\#4](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/4) ([seand7565](https://github.com/seand7565))
267
+ - Add setup wizard for paypal commerce platform [\#3](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/3) ([seand7565](https://github.com/seand7565))
268
+ - Add paypal\_commerce\_platform as a payment method [\#2](https://github.com/solidusio/solidus_paypal_commerce_platform/pull/2) ([seand7565](https://github.com/seand7565))
269
+
270
+
271
+
272
+ \* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)*
data/Gemfile CHANGED
@@ -1,46 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  source 'https://rubygems.org'
4
- git_source(:github) { |repo| "https://github.com/#{repo}.git" }
5
-
6
- branch = ENV.fetch('SOLIDUS_BRANCH', 'master')
7
- solidus_git, solidus_frontend_git = if (branch == 'master') || (branch >= 'v3.2')
8
- %w[solidusio/solidus solidusio/solidus_frontend]
9
- else
10
- %w[solidusio/solidus] * 2
11
- end
12
- gem 'solidus', github: solidus_git, branch: branch
13
- gem 'solidus_frontend', github: solidus_frontend_git, branch: branch
14
-
15
- # Needed to help Bundler figure out how to resolve dependencies,
16
- # otherwise it takes forever to resolve them.
17
- # See https://github.com/bundler/bundler/issues/6677
18
- gem 'rails', ENV.fetch('RAILS_VERSION', '>0.a')
19
-
20
- # Provides basic authentication functionality for testing parts of your engine
21
- gem 'solidus_auth_devise'
22
-
23
- case ENV.fetch('DB', nil)
24
- when 'mysql'
25
- gem 'mysql2'
26
- when 'postgresql'
27
- gem 'pg'
28
- else
29
- gem 'sqlite3'
30
- end
31
-
32
- if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3')
33
- # 'net/smtp' is required by 'mail', see:
34
- # - https://github.com/ruby/net-protocol/issues/10
35
- # - https://stackoverflow.com/a/72474475
36
- gem 'net-smtp', require: false
37
- end
38
4
 
39
5
  gemspec
40
-
41
- # Use a local Gemfile to include development dependencies that might not be
42
- # relevant for the project or for other contributors, e.g. pry-byebug.
43
- #
44
- # We use `send` instead of calling `eval_gemfile` to work around an issue with
45
- # how Dependabot parses projects: https://github.com/dependabot/dependabot-core/issues/1658.
46
- send(:eval_gemfile, 'Gemfile-local') if File.exist? 'Gemfile-local'
data/README.md CHANGED
@@ -31,7 +31,7 @@ Since PayPal is being used as the checkout if the user checks out on the product
31
31
 
32
32
  A) Turn off cart and product page checkout - configurable on the admin payment method page for PayPal Commerce Platform.
33
33
  -OR-
34
- B) Collect the users phone number seperately
34
+ B) Collect the users phone number separately
35
35
 
36
36
  and then override the `Spree::Address` method `require_phone?` to return `true`.
37
37
 
@@ -93,6 +93,7 @@ end
93
93
  The instances of your wizard class should respond to `#name` and `#partial_name`, where `partial_name` will return the path to the partial you'd like to display on the wizard setup section. In our case, we just display a button to direct the user to PayPal.
94
94
 
95
95
  ## State Guesser
96
+
96
97
  PayPal users can change their shipping address directly on PayPal, which will
97
98
  update their address on Solidus as well. However, in some instances, Solidus
98
99
  uses the incorrect subregion level for states, which causes validation problems
@@ -101,7 +102,7 @@ with the addresses that PayPal sends to us.
101
102
  For instance, if your user lives in Pescara, Italy, then PayPal will return
102
103
  "Pescara" as the state. However on older version of Solidus, the region
103
104
  "Abruzzo" is used, so the address will not be able to validate. To solve this
104
- issue, we've implented a class that attempts to guess the state of the user
105
+ issue, we've implemented a class that attempts to guess the state of the user
105
106
  using Carmen subregions if the state cannot be initially found. You can, of
106
107
  course, implement your own state guesser and set it like this:
107
108
 
@@ -121,6 +122,7 @@ With product and cart page checkout, the user is directed to the checkout confir
121
122
  PayPals API does not allow for admin-side payments. Instead, backend users taking payments for customers will need to use the PayPal Virtual Terminal to take payments. [More info is available on the PayPal website.](https://www.paypal.com/merchantapps/appcenter/acceptpayments/virtualterminal?locale.x=en_US)
122
123
 
123
124
  ## Venmo
125
+
124
126
  Venmo is currently available to US merchants and buyers. There are also other [prequisites](https://developer.paypal.com/docs/business/checkout/pay-with-venmo/#eligibility).
125
127
 
126
128
  If the transaction supports Venmo and it is enabled by the following, then a button should appear for it on checkout payment page. Note, Venmo cannot currently be rendered on the product or cart pages.
@@ -135,6 +137,7 @@ See more about preferences([Configuration](#configuration)) below.
135
137
  [_As Venmo is only available in the US, you may want to mock your location for testing_](#mocking-your-buyer-country)
136
138
 
137
139
  ## Configuration
140
+
138
141
  The easiest way to change the `Payment Method`'s preferences is through admin: `Settings > Payments > "PayPal Commerce Platform" > Edit`.
139
142
 
140
143
  See more about preferences [here](https://guides.solidus.io/developers/preferences/add-model-preferences.html#access-your-preferences)/
@@ -145,10 +148,10 @@ See more about preferences [here](https://guides.solidus.io/developers/preferenc
145
148
 
146
149
  First bundle your dependencies, then run `bin/rake`. `bin/rake` will default to building the dummy
147
150
  app if it does not exist, then it will run specs. The dummy app can be regenerated by using
148
- `bin/rake extension:test_app`.
151
+ `bin/dummy-app`.
149
152
 
150
153
  ```shell
151
- bundle
154
+ bin/setup
152
155
  bin/rake
153
156
  ```
154
157
 
@@ -158,13 +161,6 @@ To run [Rubocop](https://github.com/bbatsov/rubocop) static code analysis run
158
161
  bundle exec rubocop
159
162
  ```
160
163
 
161
- When testing your application's integration with this extension you may use its factories.
162
- Simply add this require statement to your spec_helper:
163
-
164
- ```ruby
165
- require 'solidus_paypal_commerce_platform/factories'
166
- ```
167
-
168
164
  ### Running the sandbox
169
165
 
170
166
  To run this extension in a sandboxed Solidus application, you can run `bin/sandbox`. The path for
@@ -182,6 +178,7 @@ Use Ctrl-C to stop
182
178
  ```
183
179
 
184
180
  ### Mocking your buyer country
181
+
185
182
  PayPal normally looks at your IP geolocation to see where you are located to determine what funding sources are available to you. For example, Venmo is currently only available to US buyers.
186
183
  Because of this, you may want to pretend you are from US check that that Venmo is correctly integrated for these customers. To do this, set the payment method's preference of `force_buyer_country` to "US". See more information about preferences above.
187
184
 
@@ -206,8 +203,7 @@ Your new extension version can be released using `gem-release` like this:
206
203
  bundle exec gem bump -v 1.6.0
207
204
  bin/rake changelog
208
205
  git commit -a --amend
209
- git tag v1.6.0
210
- git push --tags
206
+ git push
211
207
  bundle exec gem release
212
208
  ```
213
209
 
@@ -217,4 +213,4 @@ By using this extension, you are giving back to Solidus. PayPal will pay a fee t
217
213
 
218
214
  ## License
219
215
 
220
- Copyright (c) 2020 Nebulab srls, released under the New BSD License
216
+ Copyright (c) 2022 Nebulab srls, released under the New BSD License
data/Rakefile CHANGED
@@ -1,7 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'bundler/gem_tasks'
4
3
  require 'solidus_dev_support/rake_tasks'
5
4
  SolidusDevSupport::RakeTasks.install
6
5
 
7
- task default: 'extension:specs'
6
+ task :default do
7
+ require 'bundler'
8
+ Bundler.with_unbundled_env do
9
+ sh 'bin/rspec'
10
+ end
11
+ end
@@ -83,7 +83,7 @@ module SolidusPaypalCommercePlatform
83
83
 
84
84
  parameters = {
85
85
  'client-id': client_id,
86
- intent: auto_capture? ? "capture" : "authorize",
86
+ intent: auto_capture ? "capture" : "authorize",
87
87
  commit: commit_immediately ? "false" : "true",
88
88
  components: options[:display_credit_messaging] ? "buttons,messages" : "buttons",
89
89
  currency: currency,
@@ -97,22 +97,5 @@ module SolidusPaypalCommercePlatform
97
97
 
98
98
  "https://www.paypal.com/sdk/js?#{parameters.compact.to_query}".html_safe # rubocop:disable Rails/OutputSafety
99
99
  end
100
-
101
- # Will void the payment depending on its state or return false
102
- #
103
- # If the payment has not yet been captured, we can void the transaction.
104
- # Otherwise, we return false so Solidus creates a refund instead.
105
- #
106
- # https://developer.paypal.com/docs/api/payments/v2/#authorizations_void
107
- #
108
- # @api public
109
- # @param payment [Spree::Payment] the payment to void
110
- # @return [Response|FalseClass]
111
- def try_void(payment)
112
- void_attempt = void(nil, { originator: payment })
113
- return void_attempt if void_attempt.success?
114
-
115
- false
116
- end
117
100
  end
118
101
  end
data/bin/dummy-app ADDED
@@ -0,0 +1,37 @@
1
+ #!/usr/bin/env bash
2
+
3
+ set -e
4
+
5
+ extension_name="solidus_paypal_commerce_platform"
6
+
7
+ # Stay away from the bundler env of the containing extension.
8
+ function unbundled {
9
+ ruby -rbundler -e'b = proc {system *ARGV}; Bundler.respond_to?(:with_unbundled_env) ? Bundler.with_unbundled_env(&b) : Bundler.with_clean_env(&b)' -- "$@"
10
+ }
11
+
12
+ # "sqlite" is set by the ORB extension instead of "sqlite3",
13
+ # all other options are already in the format expected by `rails new`.
14
+ test "$DB" = "sqlite" && export DB="sqlite3"
15
+
16
+ rm -rf ./dummy-app
17
+ unbundled bundle exec rails new dummy-app \
18
+ --database=${DB:-sqlite3} \
19
+ --skip-bundle \
20
+ --skip-git \
21
+ --skip-keeps \
22
+ --skip-rc \
23
+ --skip-spring \
24
+ --skip-javascript
25
+
26
+ if [ ! -d "dummy-app" ]; then
27
+ echo 'dummy-app rails application failed'
28
+ exit 1
29
+ fi
30
+
31
+ cd ./dummy-app
32
+ unbundled bundle add solidus --github solidusio/solidus --branch "${BRANCH:-master}" --version '> 0.a'
33
+ unbundled bundle exec rake db:drop db:create
34
+ unbundled bundle exec rails generate solidus:install --auto-accept --payment-method=none --no-seed --no-sample "$@"
35
+ unbundled bundle add $extension_name --path ..
36
+ unbundled bundle exec rails generate $extension_name:install --migrate --specs=all
37
+
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ root = "#{__dir__}/.."
4
+ app_root = "#{root}/dummy-app"
5
+
6
+ unless File.exist? "#{app_root}/bin/rails"
7
+ warn 'Creating the dummy-app app...'
8
+ Dir.chdir root do
9
+ system "#{root}/bin/dummy-app" or begin
10
+ warn 'Automatic creation of the dummy-app app failed'
11
+ exit 1
12
+ end
13
+ end
14
+ end
15
+
16
+ Dir.chdir app_root
17
+ exec "#{app_root}/bin/rails", *ARGV