solidus_paypal_commerce_platform 0.1.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/.github/stale.yml +4 -4
  3. data/.github_changelog_generator +2 -0
  4. data/.rubocop.yml +5 -14
  5. data/CHANGELOG.md +181 -0
  6. data/README.md +26 -25
  7. data/app/controllers/solidus_paypal_commerce_platform/orders_controller.rb +8 -5
  8. data/app/decorators/models/solidus_paypal_commerce_platform/spree/address_decorator.rb +17 -0
  9. data/app/jobs/solidus_paypal_commerce_platform/webhook_job.rb +3 -3
  10. data/app/models/solidus_paypal_commerce_platform/payment_method.rb +4 -1
  11. data/app/models/solidus_paypal_commerce_platform/paypal_address.rb +19 -20
  12. data/app/models/solidus_paypal_commerce_platform/paypal_order.rb +3 -3
  13. data/app/models/solidus_paypal_commerce_platform/pricing_options.rb +1 -1
  14. data/app/models/solidus_paypal_commerce_platform/state_guesser.rb +1 -1
  15. data/bin/sandbox +1 -1
  16. data/lib/generators/solidus_paypal_commerce_platform/install/install_generator.rb +9 -0
  17. data/lib/generators/solidus_paypal_commerce_platform/install/templates/initializer.rb +6 -0
  18. data/lib/solidus_paypal_commerce_platform.rb +7 -5
  19. data/lib/solidus_paypal_commerce_platform/client.rb +2 -2
  20. data/lib/solidus_paypal_commerce_platform/configuration.rb +4 -0
  21. data/lib/solidus_paypal_commerce_platform/{factories.rb → testing_support/factories.rb} +0 -0
  22. data/lib/solidus_paypal_commerce_platform/version.rb +1 -1
  23. data/lib/views/frontend/solidus_paypal_commerce_platform/shared/_javascript_sdk_tag.html.erb +6 -0
  24. data/lib/views/frontend/spree/checkout/payment/_paypal_commerce_platform.html.erb +6 -1
  25. data/lib/views/frontend/spree/orders/payment/_paypal_commerce_platform.html.erb +3 -2
  26. data/lib/views/frontend/spree/products/payment/_paypal_commerce_platform.html.erb +3 -2
  27. data/solidus_paypal_commerce_platform.gemspec +7 -7
  28. data/spec/features/frontend/cart_spec.rb +21 -13
  29. data/spec/features/frontend/checkout_spec.rb +21 -13
  30. data/spec/features/frontend/product_spec.rb +23 -15
  31. data/spec/lib/solidus_paypal_commerce_platform/client_spec.rb +1 -1
  32. data/spec/lib/solidus_paypal_commerce_platform/configuration_spec.rb +10 -4
  33. data/spec/models/solidus_paypal_commerce_platform/payment_method_spec.rb +19 -0
  34. data/spec/models/solidus_paypal_commerce_platform/paypal_address_spec.rb +17 -5
  35. data/spec/requests/solidus_paypal_commerce_platform/orders_controller_spec.rb +2 -2
  36. data/spec/requests/solidus_paypal_commerce_platform/shipping_rates_controller_spec.rb +3 -3
  37. data/spec/requests/solidus_paypal_commerce_platform/wizard_controller_spec.rb +1 -1
  38. data/spec/spec_helper.rb +2 -2
  39. data/spec/support/paypal_sdk_script_tag_helper.rb +13 -0
  40. metadata +33 -21
  41. data/app/decorators/solidus_paypal_commerce_platform/remove_required_phone_from_address.rb +0 -13
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9978b8449f0f9ae68173743517e3b4c1316a590e9407fff1768eeef0b3a087a2
4
- data.tar.gz: 3fc6310b89a972b8950917e2ead0b23144e262d536f8465a9d2096ca51ec967b
3
+ metadata.gz: 83bafb3733936d20e66b9f930f5c503ab68ca026f8c7e74b864af8664199e60f
4
+ data.tar.gz: 9861750ba0a1c6e699cdaac965153c5a2879f641b4a851c776c90221b3f1ccae
5
5
  SHA512:
6
- metadata.gz: 4d17b5204087cc10c13db4dc384cb7b961e37c50d13e775f05e4d7531e454be94798a072274b36e4b30557a1e58c2afe9671e035d7a50a8d7c7160845aa224e4
7
- data.tar.gz: 0df8558dd967fd6c8c62157a35f7b17809bb92cdbf5d8cfca5d622c34faef779f54bda2b61eb46a8ede1932db91f6a4b63fe7e6dde6b58c7f08d0edd29986d5c
6
+ metadata.gz: 582c3af98a3247f8d6ff6408f98076d24079952ddf9b59e9fd7828b83f00314b50757cb518e39039b306ec9b084e7d2bba2ff58f673541ed1c8e98abb28c038a
7
+ data.tar.gz: a435d9d574cefe7eac61c5387fc225f868fe9a96ff54d35a29df4f1453144591ac4f936d905f527512b13a8ce787e5cd0778fbe5b487e347d7072667c7ff1ca6
data/.github/stale.yml CHANGED
@@ -1,17 +1,17 @@
1
1
  # Number of days of inactivity before an issue becomes stale
2
2
  daysUntilStale: 60
3
3
  # Number of days of inactivity before a stale issue is closed
4
- daysUntilClose: 7
4
+ daysUntilClose: false
5
5
  # Issues with these labels will never be considered stale
6
6
  exemptLabels:
7
7
  - pinned
8
8
  - security
9
9
  # Label to use when marking an issue as stale
10
- staleLabel: wontfix
10
+ staleLabel: stale
11
11
  # Comment to post when marking an issue as stale. Set to `false` to disable
12
12
  markComment: >
13
13
  This issue has been automatically marked as stale because it has not had
14
- recent activity. It will be closed if no further activity occurs. Thank you
14
+ recent activity. It might be closed if no further activity occurs. Thank you
15
15
  for your contributions.
16
16
  # Comment to post when closing a stale issue. Set to `false` to disable
17
- closeComment: false
17
+ closeComment: false
@@ -0,0 +1,2 @@
1
+ issues=false
2
+ exclude-labels=infrastructure
data/.rubocop.yml CHANGED
@@ -2,6 +2,7 @@ require:
2
2
  - solidus_dev_support/rubocop
3
3
 
4
4
  AllCops:
5
+ NewCops: enable
5
6
  Exclude:
6
7
  - sandbox/**/*
7
8
  - spec/dummy/**/*
@@ -42,6 +43,10 @@ RSpec/VerifiedDoubles:
42
43
  # Sometimes you really need an "anything" double
43
44
  IgnoreSymbolicNames: true
44
45
 
46
+ Rspec/Naming/VariableNumber:
47
+ # PayPal uses snake_case, we use normal_case ¯\_(ツ)_/¯
48
+ Enabled: false
49
+
45
50
  Style/FrozenStringLiteralComment:
46
51
  Exclude:
47
52
  - spec/**/*
@@ -62,17 +67,3 @@ Rails/Inquiry:
62
67
  Enabled: true
63
68
  Exclude:
64
69
  - spec/lib/solidus_paypal_commerce_platform/configuration_spec.rb
65
-
66
- # New cops (2020-09-03)
67
-
68
- Rails/ActiveRecordCallbacksOrder: {Enabled: true}
69
- Rails/FindById: {Enabled: true}
70
- Rails/MailerName: {Enabled: true}
71
- Rails/MatchRoute: {Enabled: true}
72
- Rails/NegateInclude: {Enabled: true}
73
- Rails/Pluck: {Enabled: true}
74
- Rails/PluckInWhere: {Enabled: true}
75
- Rails/RenderInline: {Enabled: true}
76
- Rails/RenderPlainText: {Enabled: true}
77
- Rails/ShortI18n: {Enabled: true}
78
- Rails/WhereExists: {Enabled: true}
data/CHANGELOG.md ADDED
@@ -0,0 +1,181 @@
1
+ # Changelog
2
+
3
+ ## [v0.3.0](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/tree/v0.3.0) (2021-03-16)
4
+
5
+ [Full Changelog](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/compare/v0.2.2...v0.3.0)
6
+
7
+ **Closed issues:**
8
+
9
+ - Prepare Solidus Paypal Commerce Platform for Solidus 3.0 [\#115](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/issues/115)
10
+
11
+ **Merged pull requests:**
12
+
13
+ - Use new factories loading method [\#118](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/pull/118) ([kennyadsl](https://github.com/kennyadsl))
14
+ - Update extension for Solidus 3.0 [\#117](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/pull/117) ([seand7565](https://github.com/seand7565))
15
+
16
+ ## [v0.2.2](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/tree/v0.2.2) (2020-11-20)
17
+
18
+ [Full Changelog](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/compare/v0.2.1...v0.2.2)
19
+
20
+ **Implemented enhancements:**
21
+
22
+ - Make the PayPal messaging component a bit more modular [\#112](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/issues/112)
23
+ - Implement and QA Paypal credit solutions [\#99](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/issues/99)
24
+
25
+ **Closed issues:**
26
+
27
+ - Simulated Address Info in Live Order [\#104](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/issues/104)
28
+
29
+ **Merged pull requests:**
30
+
31
+ - Relax SolidusWebhooks dependency [\#114](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/pull/114) ([kennyadsl](https://github.com/kennyadsl))
32
+ - Add information about paypal credit messaging to readme [\#113](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/pull/113) ([seand7565](https://github.com/seand7565))
33
+
34
+ ## [v0.2.1](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/tree/v0.2.1) (2020-11-09)
35
+
36
+ [Full Changelog](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/compare/v0.2.0...v0.2.1)
37
+
38
+ **Closed issues:**
39
+
40
+ - There was a problem connecting with paypal. [\#107](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/issues/107)
41
+ - Bad Request \(400\) when opening PayPal Payment Popup \(eg clicking Pay with PayPal during checkout\) [\#103](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/issues/103)
42
+
43
+ **Merged pull requests:**
44
+
45
+ - Move and rename address decorator [\#111](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/pull/111) ([seand7565](https://github.com/seand7565))
46
+ - Constrain solidus\_support to 0.5.1 or greater [\#110](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/pull/110) ([seand7565](https://github.com/seand7565))
47
+ - Add currency to PayPal SDK URL [\#108](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/pull/108) ([seand7565](https://github.com/seand7565))
48
+ - Update specs to comply with new rubocop regulations [\#106](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/pull/106) ([seand7565](https://github.com/seand7565))
49
+ - Add address only to initial PayPal request [\#105](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/pull/105) ([seand7565](https://github.com/seand7565))
50
+
51
+ ## [v0.2.0](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/tree/v0.2.0) (2020-10-13)
52
+
53
+ [Full Changelog](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/compare/v0.1.0...v0.2.0)
54
+
55
+ **Closed issues:**
56
+
57
+ - README lists two different types of PayPal credentials [\#97](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/issues/97)
58
+ - `paypal\_email\_confirmed` is not an actual preference [\#96](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/issues/96)
59
+ - Make this extension the default option for Solidus [\#88](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/issues/88)
60
+
61
+ **Merged pull requests:**
62
+
63
+ - Add PayPal messaging component [\#102](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/pull/102) ([seand7565](https://github.com/seand7565))
64
+ - Add partner ID attribute to SDK javascript tag [\#101](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/pull/101) ([seand7565](https://github.com/seand7565))
65
+ - Set current\_order\_id and token during payment step [\#100](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/pull/100) ([MFRWDesign](https://github.com/MFRWDesign))
66
+ - Remove incorrect/unclear info from README [\#98](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/pull/98) ([seand7565](https://github.com/seand7565))
67
+ - Update the extension with the latest solidus\_dev\_support defaults [\#95](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/pull/95) ([elia](https://github.com/elia))
68
+ - Add skip migration option to installer [\#94](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/pull/94) ([seand7565](https://github.com/seand7565))
69
+ - Update README to reflect referral fee [\#93](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/pull/93) ([seand7565](https://github.com/seand7565))
70
+
71
+ ## [v0.1.0](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/tree/v0.1.0) (2020-09-03)
72
+
73
+ [Full Changelog](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/compare/v0.0.1...v0.1.0)
74
+
75
+ **Merged pull requests:**
76
+
77
+ - Temporarily switch from apparition to cuprite [\#92](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/pull/92) ([elia](https://github.com/elia))
78
+ - Add a configurable state\_guesser class to guess states [\#90](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/pull/90) ([seand7565](https://github.com/seand7565))
79
+ - Add better error handling to button\_actions.js [\#89](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/pull/89) ([seand7565](https://github.com/seand7565))
80
+
81
+ ## [v0.0.1](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/tree/v0.0.1) (2020-08-10)
82
+
83
+ [Full Changelog](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/compare/11111204cc53e8bcfd365ae70506c07940446b0c...v0.0.1)
84
+
85
+ **Implemented enhancements:**
86
+
87
+ - Frontend users should be able to check out using PayPal [\#6](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/issues/6)
88
+ - Admin users should be able to style the PayPal buttons on the payment\_method show page [\#5](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/issues/5)
89
+ - Webhooks [\#83](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/pull/83) ([elia](https://github.com/elia))
90
+ - Display paypal email to customer on confirmation [\#54](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/pull/54) ([seand7565](https://github.com/seand7565))
91
+ - Use an env accessor to control live/sandbox urls and classes [\#31](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/pull/31) ([elia](https://github.com/elia))
92
+ - Add response object to API calls to PayPal [\#30](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/pull/30) ([seand7565](https://github.com/seand7565))
93
+
94
+ **Fixed bugs:**
95
+
96
+ - Users can check out with invalid payment [\#19](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/issues/19)
97
+ - Have different nonce for every click of the wizard button [\#87](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/pull/87) ([elia](https://github.com/elia))
98
+ - Correctly communicate errors when updating shipping rates [\#86](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/pull/86) ([elia](https://github.com/elia))
99
+ - Add deface to deps [\#57](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/pull/57) ([elia](https://github.com/elia))
100
+
101
+ **Closed issues:**
102
+
103
+ - Add something to the README about backend payments [\#75](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/issues/75)
104
+ - Explore enabling the payment method by default [\#71](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/issues/71)
105
+ - Explore subscribing to webhooks [\#70](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/issues/70)
106
+ - We're using the wrong ID for paypal\_order\_id [\#69](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/issues/69)
107
+ - Handle instrument declined errors [\#68](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/issues/68)
108
+ - Extend lightbox during customer payment [\#63](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/issues/63)
109
+ - Add this extension to demo store for integration team walkthrough [\#49](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/issues/49)
110
+ - Store PayPal Debug ID [\#48](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/issues/48)
111
+ - PayPal email address needs to be included on the confirm step [\#47](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/issues/47)
112
+ - Digital goods should be set as not requiring shipment [\#46](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/issues/46)
113
+ - Allow checkout on product/cart page to complete the order [\#44](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/issues/44)
114
+ - PayPal uses different states than Solidus for some countries [\#38](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/issues/38)
115
+ - Validate amount charged with PayPal [\#37](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/issues/37)
116
+ - Allow order simulator to be a configurable class [\#36](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/issues/36)
117
+ - Admin users have the option to edit payment amount [\#29](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/issues/29)
118
+ - Add PayPal button to product page [\#27](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/issues/27)
119
+ - Add PayPal button to cart page [\#26](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/issues/26)
120
+ - Add `commit=false` to javascript SDK URL [\#18](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/issues/18)
121
+ - Explore using Rails secrets to encode and decrypt PayPal client id and secret [\#17](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/issues/17)
122
+ - Backend users should be able to checkout & admin payments [\#15](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/issues/15)
123
+ - Change static sandbox URL and objects to dynamic [\#14](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/issues/14)
124
+ - PayPal response address change [\#13](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/issues/13)
125
+ - Ensure the email is verified before activating the payment method [\#9](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/issues/9)
126
+ - Add a URL generator for the PayPal JS SDK [\#8](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/issues/8)
127
+ - Allow users to onboard with PayPal [\#1](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/issues/1)
128
+
129
+ **Merged pull requests:**
130
+
131
+ - Update links after moving the repo to solidusio-contrib [\#91](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/pull/91) ([elia](https://github.com/elia))
132
+ - Use live partner ids [\#85](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/pull/85) ([elia](https://github.com/elia))
133
+ - Update README to account for checkouts without a confirmation step [\#84](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/pull/84) ([seand7565](https://github.com/seand7565))
134
+ - Replace order simulator with something simpler [\#82](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/pull/82) ([seand7565](https://github.com/seand7565))
135
+ - Cleanup [\#81](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/pull/81) ([elia](https://github.com/elia))
136
+ - Send line\_item and shipping promotions to PayPal [\#80](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/pull/80) ([seand7565](https://github.com/seand7565))
137
+ - Change outstanding\_balance to total in order total checker [\#79](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/pull/79) ([seand7565](https://github.com/seand7565))
138
+ - Add overlay to ease transition to confirmation page [\#78](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/pull/78) ([seand7565](https://github.com/seand7565))
139
+ - Default available\_to\_users to true [\#77](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/pull/77) ([seand7565](https://github.com/seand7565))
140
+ - Add info about PayPal Terminal to README [\#76](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/pull/76) ([seand7565](https://github.com/seand7565))
141
+ - Return a payment declined error on the frontend [\#74](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/pull/74) ([seand7565](https://github.com/seand7565))
142
+ - Only use the necessary data to let the spec pass [\#73](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/pull/73) ([elia](https://github.com/elia))
143
+ - Display capture\_id instead of order\_id to admin user [\#72](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/pull/72) ([seand7565](https://github.com/seand7565))
144
+ - Use options instead of preferences [\#67](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/pull/67) ([seand7565](https://github.com/seand7565))
145
+ - Update README to reflect new preferences [\#66](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/pull/66) ([seand7565](https://github.com/seand7565))
146
+ - Add version to cache\_key [\#65](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/pull/65) ([seand7565](https://github.com/seand7565))
147
+ - Include payment method information in pricing options cache key [\#62](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/pull/62) ([seand7565](https://github.com/seand7565))
148
+ - Only use available payment\_methods [\#61](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/pull/61) ([seand7565](https://github.com/seand7565))
149
+ - Explicitly require deface [\#60](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/pull/60) ([elia](https://github.com/elia))
150
+ - Verify email address is verified before allowing payment method to be available [\#59](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/pull/59) ([seand7565](https://github.com/seand7565))
151
+ - Use the ORB definition of lint-code [\#58](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/pull/58) ([elia](https://github.com/elia))
152
+ - Send amount of payment to PayPal on capture [\#56](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/pull/56) ([seand7565](https://github.com/seand7565))
153
+ - Verify amount to charge with order total [\#55](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/pull/55) ([seand7565](https://github.com/seand7565))
154
+ - Linting the project with rubocop [\#53](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/pull/53) ([elia](https://github.com/elia))
155
+ - Add PayPal Debug ID to log entries [\#52](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/pull/52) ([seand7565](https://github.com/seand7565))
156
+ - Fix PayPal request success message en.yml paths [\#51](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/pull/51) ([seand7565](https://github.com/seand7565))
157
+ - Add configuration options to SolidusPaypalCommercePlatform [\#50](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/pull/50) ([seand7565](https://github.com/seand7565))
158
+ - Add PayPal button to product page [\#45](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/pull/45) ([seand7565](https://github.com/seand7565))
159
+ - Add PayPal Button To Cart Page [\#43](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/pull/43) ([seand7565](https://github.com/seand7565))
160
+ - Add ability to change address on PayPal [\#42](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/pull/42) ([seand7565](https://github.com/seand7565))
161
+ - Add a basic codecov config to show commit status [\#41](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/pull/41) ([elia](https://github.com/elia))
162
+ - Add CI & Coverage badges to the readme [\#40](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/pull/40) ([elia](https://github.com/elia))
163
+ - Rely on sdk request classes [\#39](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/pull/39) ([elia](https://github.com/elia))
164
+ - Use "commit=false" in the JS SDK url when "confirm" step is present [\#33](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/pull/33) ([elia](https://github.com/elia))
165
+ - Renames: Gateway → PaymentMethod / Requests → Gateway [\#32](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/pull/32) ([elia](https://github.com/elia))
166
+ - Add PayPal Virtual Terminal notice to backend [\#25](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/pull/25) ([seand7565](https://github.com/seand7565))
167
+ - Add missing partials necessary for backend [\#24](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/pull/24) ([seand7565](https://github.com/seand7565))
168
+ - Add the ability to void authorized payments [\#23](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/pull/23) ([seand7565](https://github.com/seand7565))
169
+ - Fix order controller response [\#22](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/pull/22) ([seand7565](https://github.com/seand7565))
170
+ - Add refund ability to admin payment management [\#21](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/pull/21) ([seand7565](https://github.com/seand7565))
171
+ - Fixes and refactoring [\#20](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/pull/20) ([elia](https://github.com/elia))
172
+ - Add ability for admin users to customize paypal button [\#16](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/pull/16) ([seand7565](https://github.com/seand7565))
173
+ - Restore the generic bin/rails command [\#11](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/pull/11) ([elia](https://github.com/elia))
174
+ - Add PayPal buttons to frontend checkout flow [\#10](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/pull/10) ([seand7565](https://github.com/seand7565))
175
+ - Update readme to reflect onboarding and wizards 🧙 [\#4](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/pull/4) ([seand7565](https://github.com/seand7565))
176
+ - Add setup wizard for paypal commerce platform [\#3](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/pull/3) ([seand7565](https://github.com/seand7565))
177
+ - Add paypal\_commerce\_platform as a payment method [\#2](https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/pull/2) ([seand7565](https://github.com/seand7565))
178
+
179
+
180
+
181
+ \* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)*
data/README.md CHANGED
@@ -16,8 +16,7 @@ gem 'solidus_paypal_commerce_platform'
16
16
  Bundle your dependencies and run the installation generator:
17
17
 
18
18
  ```shell
19
- bundle
20
- bundle exec rails g solidus_paypal_commerce_platform:install
19
+ bin/rails generate solidus_paypal_commerce_platform:install
21
20
  ```
22
21
 
23
22
  ### PayPal Sandbox/Live Environment
@@ -26,26 +25,6 @@ This extension will automatically select a PayPal environment based on Rails env
26
25
 
27
26
  If you want to override these values you can either set `SolidusPaypalCommercePlatform.config.env` to `"live"` or `"sandbox"` inside an initializer. Or, alternatively, you can set the `PAYPAL_ENV` environment variable to one of the same two values.
28
27
 
29
- ### Custom PartnerID & PartnerClientID
30
-
31
- You can declare your PayPal Partner-ID and Partner-Client-ID as environment
32
- variables or set their values directly on `SolidusPaypalCommercePlatform.config`
33
- or by using the configuration method detailed in the Customization section.
34
-
35
- #### Use ENV variables
36
-
37
- ```shell
38
- export PAYPAL_PARTNER_ID="xxxxxxxxxxKG2"
39
- export PAYPAL_PARTNER_CLIENT_ID="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxVSX"
40
- ```
41
-
42
- #### Set them directly
43
-
44
- ```ruby
45
- SolidusPaypalCommercePlatform.config.partner_id = "xxxxxxxxxxKG2"
46
- SolidusPaypalCommercePlatform.config.partner_client_id = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxVSX"
47
- ```
48
-
49
28
  ## Address Phone Number Validation
50
29
 
51
30
  Since PayPal is being used as the checkout if the user checks out on the product or cart page, and PayPal doesn't collect phone numbers, this extension disables phone number required validation for `Spree::Address`. To turn phone number validation back on, you'll need to either:
@@ -73,7 +52,6 @@ Spree::Config.configure do |config|
73
52
  test_mode: !Rails.env.production?,
74
53
  client_id: ENV['PAYPAL_CLIENT_ID'],
75
54
  client_secret: ENV['PAYPAL_CLIENT_SECRET'],
76
- paypal_email_confirmed: true,
77
55
  display_on_product_page: true,
78
56
  display_on_cart: true,
79
57
  }
@@ -93,6 +71,10 @@ When you return to your app, your payment method should be set up and ready to g
93
71
  A confirmed email is required to get paid by PayPal. You'll need to check `Paypal Email Confirmed` on your new
94
72
  payment method before being able to select `Available To Users`.
95
73
 
74
+ ### Messaging Component
75
+
76
+ PayPal offers a messaging component that displays credit messaging to the user. You can find more information [here.](https://www.paypal.com/us/webapps/mpp/on-site-messaging) This messaging is enabled by default on all pages that use the paypal payment buttons, but can be disabled via preferences. PayPal recommends that this messaging be displayed near product or order totals, so please keep that in mind during implementation.
77
+
96
78
  ## Wizards
97
79
 
98
80
  This gem adds support for payment method wizards to be set up. Payment wizards can be used to automatically set up
@@ -172,7 +154,7 @@ the sandbox app is `./sandbox` and `bin/rails` will forward any Rails commands t
172
154
 
173
155
  Here's an example:
174
156
 
175
- ```shell
157
+ ```
176
158
  $ bin/rails server
177
159
  => Booting Puma
178
160
  => Rails 6.0.2.1 application starting in development
@@ -180,14 +162,33 @@ $ bin/rails server
180
162
  Use Ctrl-C to stop
181
163
  ```
182
164
 
165
+ ### Updating the changelog
166
+
167
+ Before and after releases the changelog should be updated to reflect the up-to-date status of
168
+ the project:
169
+
170
+ ```shell
171
+ bin/rake changelog
172
+ git add CHANGELOG.md
173
+ git commit -m "Update the changelog"
174
+ ```
175
+
183
176
  ### Releasing new versions
184
177
 
185
178
  Your new extension version can be released using `gem-release` like this:
186
179
 
187
180
  ```shell
188
- bundle exec gem bump -v VERSION --tag --push --remote origin && gem release
181
+ bundle exec gem bump -v 1.6.0
182
+ bin/rake changelog
183
+ git commit -a --amend
184
+ git push
185
+ bundle exec gem release
189
186
  ```
190
187
 
188
+ ## Referral Fee
189
+
190
+ By using this extension, you are giving back to Solidus. PayPal will pay a fee to the maintainers ([Nebulab](https://nebulab.it)) for each order made through the payment gateway.
191
+
191
192
  ## License
192
193
 
193
194
  Copyright (c) 2020 Nebulab srls, released under the New BSD License
@@ -11,7 +11,8 @@ module SolidusPaypalCommercePlatform
11
11
 
12
12
  @order = ::Spree::Order.create!(
13
13
  user: try_spree_current_user,
14
- store: current_store
14
+ store: current_store,
15
+ currency: current_pricing_options.currency
15
16
  )
16
17
 
17
18
  if @order.contents.update_cart order_params
@@ -64,10 +65,12 @@ module SolidusPaypalCommercePlatform
64
65
  ],
65
66
  recipient: [
66
67
  :email_address,
67
- name: [
68
- :given_name,
69
- :surname,
70
- ]
68
+ {
69
+ name: [
70
+ :given_name,
71
+ :surname,
72
+ ]
73
+ }
71
74
  ]
72
75
  )
73
76
  end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module SolidusPaypalCommercePlatform
4
+ module Spree
5
+ module AddressDecorator
6
+ # PayPal doesn't use the phone number, so in cases where the user checks out via
7
+ # PayPal, this field will be unpopulated. If you want to require phone numbers,
8
+ # you'll need to turn off cart & product page displays on the payment method edit
9
+ # page.
10
+ def require_phone?
11
+ super && false
12
+ end
13
+
14
+ ::Spree::Address.prepend self
15
+ end
16
+ end
17
+ end
@@ -6,15 +6,15 @@ module SolidusPaypalCommercePlatform
6
6
  case payload["resource_type"]
7
7
  when "checkout-order"
8
8
  payment_source = PaymentSource.find_by!(paypal_order_id: payload.dig("resource", "id"))
9
- payment = Spree::Payment.where(source: payment_source).last!
9
+ payment = ::Spree::Payment.where(source: payment_source).last!
10
10
  payment.log_entries.create!(details: payload.to_yaml)
11
11
  when "capture"
12
12
  payment_source = PaymentSource.find_by!(capture_id: payload.dig("resource", "id"))
13
- payment = Spree::Payment.where(source: payment_source).last!
13
+ payment = ::Spree::Payment.where(source: payment_source).last!
14
14
  payment.log_entries.create!(details: payload.to_yaml)
15
15
  when "refund"
16
16
  payment_source = PaymentSource.find_by!(refund_id: payload.dig("resource", "id"))
17
- payment = Spree::Payment.where(source: payment_source).last!
17
+ payment = ::Spree::Payment.where(source: payment_source).last!
18
18
  payment.log_entries.create!(details: payload.to_yaml)
19
19
  end
20
20
  end
@@ -11,6 +11,7 @@ module SolidusPaypalCommercePlatform
11
11
  preference :paypal_button_layout, :paypal_select, default: "vertical"
12
12
  preference :display_on_cart, :boolean, default: true
13
13
  preference :display_on_product_page, :boolean, default: true
14
+ preference :display_credit_messaging, :boolean, default: true
14
15
 
15
16
  def partial_name
16
17
  "paypal_commerce_platform"
@@ -57,7 +58,7 @@ module SolidusPaypalCommercePlatform
57
58
  }
58
59
  end
59
60
 
60
- def javascript_sdk_url(order: nil)
61
+ def javascript_sdk_url(order: nil, currency: nil)
61
62
  # Both instance and class respond to checkout_steps.
62
63
  step_names = order ? order.checkout_steps : ::Spree::Order.checkout_steps.keys
63
64
 
@@ -67,6 +68,8 @@ module SolidusPaypalCommercePlatform
67
68
  'client-id': client_id,
68
69
  intent: auto_capture ? "capture" : "authorize",
69
70
  commit: commit_immediately ? "false" : "true",
71
+ components: options[:display_credit_messaging] ? "buttons,messages" : "buttons",
72
+ currency: currency
70
73
  }
71
74
 
72
75
  "https://www.paypal.com/sdk/js?#{parameters.to_query}"