spree_stripe 1.8.0 → 6.0.0.beta1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/LICENSE +21 -0
- data/README.md +41 -104
- data/Rakefile +7 -19
- data/app/jobs/spree_stripe/base_job.rb +1 -1
- data/app/jobs/spree_stripe/create_webhook_endpoint_job.rb +17 -2
- data/app/models/spree/payment_sessions/stripe.rb +45 -11
- data/app/models/spree_stripe/gateway/connect.rb +327 -0
- data/app/models/spree_stripe/gateway/payment_sessions.rb +234 -88
- data/app/models/spree_stripe/gateway/payment_setup_sessions.rb +15 -9
- data/app/models/spree_stripe/gateway/webhooks.rb +107 -0
- data/app/models/spree_stripe/gateway.rb +197 -244
- data/app/models/spree_stripe/payment_sources/ideal.rb +1 -1
- data/app/models/spree_stripe/payment_sources/przelewy24.rb +1 -1
- data/app/models/spree_stripe/payout_provider.rb +348 -0
- data/app/presenters/spree_stripe/customer_presenter.rb +7 -6
- data/app/presenters/spree_stripe/statement_descriptor_suffix_presenter.rb +11 -10
- data/app/services/spree_stripe/create_gateway_webhooks.rb +57 -33
- data/app/services/spree_stripe/create_payment.rb +46 -31
- data/app/services/spree_stripe/create_source.rb +37 -17
- data/app/services/spree_stripe/update_customer.rb +5 -4
- data/app/subscribers/spree_stripe/customer_updated_subscriber.rb +18 -0
- data/config/initializers/stripe.rb +1 -13
- data/config/locales/en.yml +4 -0
- data/lib/generators/spree_stripe/install/install_generator.rb +12 -12
- data/lib/spree_stripe/engine.rb +7 -38
- data/lib/spree_stripe/factories.rb +1 -3
- data/lib/spree_stripe/testing_support/factories/gateway_factory.rb +10 -9
- data/lib/spree_stripe/testing_support/factories/payment_session_factory.rb +50 -0
- data/lib/spree_stripe.rb +7 -8
- data/lib/tasks/migrate_webhook_keys.rake +128 -0
- metadata +29 -167
- data/app/assets/config/spree_stripe_manifest.js +0 -4
- data/app/assets/images/payment_icons/banktransfer.svg +0 -3
- data/app/assets/images/payment_icons/link.svg +0 -1
- data/app/assets/images/payment_icons/sepadebit.svg +0 -22
- data/app/controllers/spree_stripe/apple_pay_domain_verification_controller.rb +0 -11
- data/app/controllers/spree_stripe/confirm_payments_controller.rb +0 -52
- data/app/controllers/spree_stripe/store_controller_decorator.rb +0 -11
- data/app/controllers/stripe_event/webhook_controller_decorator.rb +0 -21
- data/app/helpers/spree_stripe/base_helper.rb +0 -35
- data/app/helpers/spree_stripe/checkout_helper_decorator.rb +0 -17
- data/app/javascript/spree_stripe/application.js +0 -18
- data/app/javascript/spree_stripe/controllers/stripe_button_controller.js +0 -398
- data/app/javascript/spree_stripe/controllers/stripe_controller.js +0 -238
- data/app/jobs/spree_stripe/attach_customer_to_credit_card_job.rb +0 -18
- data/app/jobs/spree_stripe/complete_order_from_session_job.rb +0 -12
- data/app/jobs/spree_stripe/create_tax_transaction_job.rb +0 -10
- data/app/jobs/spree_stripe/register_domain_job.rb +0 -20
- data/app/jobs/spree_stripe/update_customer_job.rb +0 -10
- data/app/models/spree_stripe/base.rb +0 -6
- data/app/models/spree_stripe/calculators/stripe_tax.rb +0 -96
- data/app/models/spree_stripe/credit_card_decorator.rb +0 -13
- data/app/models/spree_stripe/custom_domain_decorator.rb +0 -20
- data/app/models/spree_stripe/gateway/payment_intents.rb +0 -149
- data/app/models/spree_stripe/gateway_customer_decorator.rb +0 -9
- data/app/models/spree_stripe/order_decorator.rb +0 -9
- data/app/models/spree_stripe/payment_decorator.rb +0 -46
- data/app/models/spree_stripe/payment_method_decorator.rb +0 -18
- data/app/models/spree_stripe/payment_methods_webhook_key.rb +0 -8
- data/app/models/spree_stripe/payment_source_decorator.rb +0 -9
- data/app/models/spree_stripe/shipment_decorator.rb +0 -21
- data/app/models/spree_stripe/store_decorator.rb +0 -24
- data/app/models/spree_stripe/user_decorator.rb +0 -21
- data/app/models/spree_stripe/webhook_key.rb +0 -14
- data/app/presenters/spree_stripe/payment_intent_presenter.rb +0 -101
- data/app/presenters/spree_stripe/tax_presenter.rb +0 -63
- data/app/services/spree_stripe/complete_order.rb +0 -105
- data/app/services/spree_stripe/create_payment_session.rb +0 -18
- data/app/services/spree_stripe/register_domain.rb +0 -22
- data/app/services/spree_stripe/webhook_handlers/base.rb +0 -19
- data/app/services/spree_stripe/webhook_handlers/payment_intent_amount_capturable_updated.rb +0 -13
- data/app/services/spree_stripe/webhook_handlers/payment_intent_payment_failed.rb +0 -16
- data/app/services/spree_stripe/webhook_handlers/payment_intent_succeeded.rb +0 -11
- data/app/services/spree_stripe/webhook_handlers/setup_intent_succeeded.rb +0 -34
- data/app/subscribers/spree_stripe/order_completed_subscriber.rb +0 -14
- data/app/views/spree/admin/payment_methods/configuration_guides/_spree_stripe.html.erb +0 -0
- data/app/views/spree/admin/payment_methods/custom_form_fields/_spree_stripe.html.erb +0 -47
- data/app/views/spree/admin/payment_methods/descriptions/_spree_stripe.html.erb +0 -15
- data/app/views/spree/checkout/payment/_spree_stripe.html.erb +0 -66
- data/app/views/spree_stripe/_head.html.erb +0 -2
- data/app/views/spree_stripe/_quick_checkout.html.erb +0 -34
- data/config/i18n-tasks.yml +0 -173
- data/config/importmap.rb +0 -8
- data/config/initializers/spree.rb +0 -9
- data/config/routes.rb +0 -11
- data/db/migrate/20250310152812_setup_spree_stripe_models.rb +0 -24
- data/lib/spree_stripe/configuration.rb +0 -11
- data/lib/spree_stripe/testing_support/factories/after_pay_payment_source_factory.rb +0 -6
- data/lib/spree_stripe/testing_support/factories/alipay_payment_source_factory.rb +0 -6
- data/lib/spree_stripe/testing_support/factories/ideal_payment_source_factory.rb +0 -6
- data/lib/spree_stripe/testing_support/factories/klarna_payment_source_factory.rb +0 -6
- data/lib/spree_stripe/testing_support/factories/link_payment_source_factory.rb +0 -6
- data/lib/spree_stripe/testing_support/factories/przelewy24_payment_source_factory.rb +0 -6
- data/lib/spree_stripe/testing_support/factories/sepa_debit_payment_source_factory.rb +0 -6
- data/lib/spree_stripe/testing_support/factories/stripe_payment_session_factory.rb +0 -33
- data/lib/spree_stripe/testing_support/factories/webhook_key_factory.rb +0 -23
- data/lib/spree_stripe/version.rb +0 -7
- data/vendor/javascript/@stripe--stripe-js--dist--pure.esm.js.js +0 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6b19b020b414085c822cac14eb0e6eb3b9477e00db8133f5922cf442c597cccf
|
|
4
|
+
data.tar.gz: 7ee74de9899f55a6a6d61a6122c6e6639e5cb9913cd705b7852fe0f11939b6b1
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2c274dfb225afb9fbd665bed8af493eafbec5a24bfeddf16b3e11f0c075743778ce8cfb52de7e9f034e40f9f6d33d7c349237282946ce016595e0f0e16475dda
|
|
7
|
+
data.tar.gz: 58d8dc69605f5ddbf228233f114d36f071f79afbf336bb40b6a2d62c77a15b64e096d31ebc7133273863ddea15a65c8da4b6e9bff9672e1967981c49009d1132
|
data/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026-present, Vendo Sp. z o.o., Vendo Connect Inc.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
data/README.md
CHANGED
|
@@ -1,126 +1,63 @@
|
|
|
1
|
-
<p align="center">
|
|
2
|
-
<a href="https://spreecommerce.org">
|
|
3
|
-
<img alt="Spree Commerce x Stripe integration" src="https://vendo-production-res.cloudinary.com/image/upload/w_2000/q_auto/v1742930549/docs/github/Spree_Commerce_open-source_eCommerce_Stripe_payments_integration_-_Github_xlrcn8.jpg">
|
|
4
|
-
</a>
|
|
5
|
-
|
|
6
1
|
# Spree Stripe
|
|
7
2
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
Or you could follow the [installation instructions](https://spreecommerce.org/docs/integrations/payments/stripe).
|
|
13
|
-
|
|
14
|
-
If you like what you see, consider giving this repo a GitHub star :star:
|
|
15
|
-
|
|
16
|
-
Thank you for supporting Spree open-source :heart:
|
|
17
|
-
|
|
18
|
-
> [!TIP]
|
|
19
|
-
> Looking for a [Stripe Connect integration](#looking-for-a-stripe-connect-integration-for-spree) for Spree? It's available with the [Enterprise Edition](https://spreecommerce.org/spree-commerce-version-comparison-community-edition-vs-enterprise-edition/).
|
|
20
|
-
|
|
21
|
-
## Features
|
|
22
|
-
|
|
23
|
-
- Support for quick checkout using Apple Pay, Google Pay, Stripe Link
|
|
24
|
-
- Support for 3D Secure and other security standards
|
|
25
|
-
- Support for off-session payments
|
|
26
|
-
- Support for Storefront API integration (see the API docs [here](https://spreecommerce.org/docs/api-reference/storefront/stripe)).
|
|
27
|
-
- Accept payments in over 130 currencies
|
|
28
|
-
- Accept Credit Cards, Apple Pay, Google Pay, and more
|
|
29
|
-
- Accept SEPA Direct Debit payments
|
|
30
|
-
- Accept iDEAL payments
|
|
31
|
-
- Accept SOFORT payments
|
|
32
|
-
- Accept Bancontact payments
|
|
33
|
-
- Accept Alipay payments
|
|
34
|
-
- Accept WeChat Pay payments
|
|
35
|
-
- Accept Afterpay, Klarna, Affirm, and more
|
|
36
|
-
|
|
37
|
-
## What's new?
|
|
38
|
-
|
|
39
|
-
### Installment (BNPL) payments indicator on PDP (Product Detail Page)
|
|
40
|
-
|
|
41
|
-

|
|
42
|
-
|
|
43
|
-
### Quick payment options on the cart (Apple Pay, Google Pay, Link)
|
|
44
|
-
|
|
45
|
-

|
|
46
|
-
|
|
47
|
-
### Quick payments bypassing checkout 1st step (Apple Pay, Google Pay, Link)
|
|
48
|
-
|
|
49
|
-

|
|
3
|
+
Official [Stripe](https://stripe.com) payment gateway for
|
|
4
|
+
[Spree Commerce](https://spreecommerce.org), built on Spree's payment session
|
|
5
|
+
API.
|
|
50
6
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
7
|
+
Supports card payments plus Klarna, Affirm, Afterpay, Alipay, iDEAL, Link,
|
|
8
|
+
SEPA Direct Debit, Przelewy24 and bank transfers, along with Apple Pay and
|
|
9
|
+
Google Pay quick checkout. Customers can save payment methods for later use
|
|
10
|
+
through setup sessions.
|
|
54
11
|
|
|
55
12
|
## Installation
|
|
56
13
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
```ruby
|
|
60
|
-
bundle add spree_stripe
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
2. Run the install generator
|
|
64
|
-
|
|
65
|
-
```ruby
|
|
66
|
-
bundle exec rails g spree_stripe:install
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
3. Restart your server
|
|
70
|
-
|
|
71
|
-
If your server was running, restart it so that it can find the assets properly.
|
|
72
|
-
|
|
73
|
-
This Stripe integration is also bundled in the [Spree Starter](https://github.com/spree/spree_starter/) for your development convenience.
|
|
14
|
+
Add the gem to your `Gemfile`:
|
|
74
15
|
|
|
75
|
-
|
|
16
|
+
```ruby
|
|
17
|
+
gem 'spree_stripe'
|
|
18
|
+
```
|
|
76
19
|
|
|
77
|
-
|
|
20
|
+
Then run `bundle install`. The gateway registers itself — there is nothing to
|
|
21
|
+
generate and no migrations to run.
|
|
78
22
|
|
|
79
|
-
|
|
80
|
-
bundle update
|
|
81
|
-
bundle exec rake test_app
|
|
82
|
-
```
|
|
23
|
+
## Configuration
|
|
83
24
|
|
|
84
|
-
|
|
85
|
-
|
|
25
|
+
Create a Stripe payment method in the admin dashboard and enter your
|
|
26
|
+
publishable and secret keys. Everything else is automatic:
|
|
86
27
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
28
|
+
- The webhook endpoint is registered with Stripe on save, and its signing
|
|
29
|
+
secret is stored on the payment method.
|
|
30
|
+
- Your storefront domains are registered with Stripe so Apple Pay and Google
|
|
31
|
+
Pay can offer themselves at checkout.
|
|
90
32
|
|
|
91
|
-
|
|
92
|
-
|
|
33
|
+
Set `STRIPE_SIGNING_SECRET` to verify webhooks forwarded by the Stripe CLI
|
|
34
|
+
during local development.
|
|
93
35
|
|
|
94
|
-
|
|
95
|
-
require 'spree_stripe/factories'
|
|
96
|
-
```
|
|
36
|
+
## Upgrading from spree_stripe 1.x
|
|
97
37
|
|
|
98
|
-
|
|
38
|
+
Signing secrets used to live in their own tables. Move them onto the payment
|
|
39
|
+
method with:
|
|
99
40
|
|
|
100
|
-
```
|
|
101
|
-
bundle exec
|
|
102
|
-
bundle exec gem release
|
|
41
|
+
```bash
|
|
42
|
+
bundle exec rake spree:upgrade:migrate_stripe_webhook_keys
|
|
103
43
|
```
|
|
104
44
|
|
|
105
|
-
|
|
45
|
+
This runs as part of `rake spree:upgrade`. Until it does, gateways carrying a
|
|
46
|
+
pre-6.0 webhook endpoint will reject incoming webhooks.
|
|
106
47
|
|
|
107
|
-
|
|
48
|
+
Applications still using the Rails storefront checkout, the legacy
|
|
49
|
+
`stripe_event` webhook path, or Stripe Tax should complete the payment session
|
|
50
|
+
migration before upgrading — those paths ship only in the 1.x series.
|
|
108
51
|
|
|
109
|
-
|
|
110
|
-
[instructions](CONTRIBUTING.md) for installing dependencies and crafting a good
|
|
111
|
-
pull request.
|
|
52
|
+
## Testing
|
|
112
53
|
|
|
113
|
-
|
|
54
|
+
The suite runs offline against recorded VCR cassettes:
|
|
114
55
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
- Automated split payments between marketplace and vendors
|
|
120
|
-
- Support for multiple payment methods including cards and digital wallets
|
|
121
|
-
- Configurable marketplace fees and commission structures
|
|
122
|
-
- Automated payouts to vendors
|
|
123
|
-
- Comprehensive transaction reporting
|
|
124
|
-
- Built-in fraud prevention tools
|
|
56
|
+
```bash
|
|
57
|
+
bundle exec rake test_app # once
|
|
58
|
+
bundle exec rspec
|
|
59
|
+
```
|
|
125
60
|
|
|
126
|
-
|
|
61
|
+
Set `RECORD_VCR=1` with real Stripe test credentials to record new
|
|
62
|
+
interactions. Note that renaming a `:vcr`-tagged example changes its cassette
|
|
63
|
+
path, so it will re-record rather than reuse the old file.
|
data/Rakefile
CHANGED
|
@@ -1,27 +1,15 @@
|
|
|
1
|
-
require '
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
require 'rubygems'
|
|
2
|
+
require 'rake'
|
|
3
|
+
require 'rake/testtask'
|
|
4
4
|
require 'rspec/core/rake_task'
|
|
5
|
-
require 'spree/testing_support/
|
|
5
|
+
require 'spree/testing_support/common_rake'
|
|
6
6
|
|
|
7
7
|
RSpec::Core::RakeTask.new
|
|
8
8
|
|
|
9
|
-
task :
|
|
10
|
-
if Dir['spec/dummy'].empty?
|
|
11
|
-
Rake::Task[:test_app].invoke
|
|
12
|
-
Dir.chdir('../../')
|
|
13
|
-
end
|
|
14
|
-
Rake::Task[:spec].invoke
|
|
15
|
-
end
|
|
9
|
+
task default: :spec
|
|
16
10
|
|
|
17
|
-
desc
|
|
11
|
+
desc "Generates a dummy app for testing"
|
|
18
12
|
task :test_app do
|
|
19
13
|
ENV['LIB_NAME'] = 'spree_stripe'
|
|
20
|
-
Rake::Task['
|
|
21
|
-
install_storefront: true,
|
|
22
|
-
install_admin: true
|
|
23
|
-
)
|
|
24
|
-
system({ 'BUNDLE_GEMFILE' => File.expand_path('Gemfile', __dir__) }, 'rails g spree_posts:install')
|
|
25
|
-
system({ 'BUNDLE_GEMFILE' => File.expand_path('Gemfile', __dir__) }, 'rails g spree_legacy_api_v2:install')
|
|
26
|
-
system({ 'BUNDLE_GEMFILE' => File.expand_path('Gemfile', __dir__) }, 'rails g spree_legacy_product_properties:install')
|
|
14
|
+
Rake::Task['common:test_app'].invoke
|
|
27
15
|
end
|
|
@@ -1,7 +1,22 @@
|
|
|
1
1
|
module SpreeStripe
|
|
2
2
|
class CreateWebhookEndpointJob < BaseJob
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
# @param connect [Boolean] true registers the connected-accounts endpoint,
|
|
4
|
+
# which a marketplace holds alongside its payment one
|
|
5
|
+
def perform(payment_method_id, connect: false)
|
|
6
|
+
# Both endpoints store their credentials in the one serialised
|
|
7
|
+
# `preferences` column, so concurrent jobs would drop each other's
|
|
8
|
+
# signing secret. Locked on load because `with_lock` refuses a record
|
|
9
|
+
# with unsaved changes, and reading a preference populates its default.
|
|
10
|
+
Spree::PaymentMethod.transaction do
|
|
11
|
+
payment_method = Spree::PaymentMethod.lock.find_by(id: payment_method_id)
|
|
12
|
+
next if payment_method.blank?
|
|
13
|
+
|
|
14
|
+
if connect
|
|
15
|
+
payment_method.create_connect_webhook_endpoint
|
|
16
|
+
else
|
|
17
|
+
payment_method.create_webhook_endpoint
|
|
18
|
+
end
|
|
19
|
+
end
|
|
5
20
|
end
|
|
6
21
|
end
|
|
7
22
|
end
|
|
@@ -2,7 +2,6 @@ module Spree
|
|
|
2
2
|
class PaymentSessions::Stripe < PaymentSession
|
|
3
3
|
delegate :api_options, to: :payment_method
|
|
4
4
|
|
|
5
|
-
# Duck-type interface consumed by the CompleteOrder and CreatePayment services
|
|
6
5
|
def stripe_id
|
|
7
6
|
external_id
|
|
8
7
|
end
|
|
@@ -31,23 +30,58 @@ module Spree
|
|
|
31
30
|
end
|
|
32
31
|
|
|
33
32
|
def successful?
|
|
34
|
-
stripe_payment_intent
|
|
33
|
+
payment_method.payment_intent_successful?(stripe_payment_intent)
|
|
35
34
|
end
|
|
36
35
|
|
|
37
36
|
def charge_not_required?
|
|
38
37
|
payment_method.payment_intent_charge_not_required?(stripe_payment_intent)
|
|
39
38
|
end
|
|
40
39
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
40
|
+
# Warms everything settlement reads from Stripe — the intent, its charge,
|
|
41
|
+
# and the gateway customer a card source needs — so the webhook path's
|
|
42
|
+
# locked settlement does no Stripe I/O.
|
|
43
|
+
def prepare_for_settlement!
|
|
44
|
+
stripe_charge
|
|
45
|
+
payment_method.fetch_or_create_customer(order: owner) if owner&.customer
|
|
46
|
+
self
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
# Core creates the payment; Stripe only says what instrument it was paid
|
|
50
|
+
# with. The charge and customer are already warmed by
|
|
51
|
+
# +prepare_for_settlement!+, so this does no Stripe I/O inside the lock.
|
|
52
|
+
#
|
|
53
|
+
# @return [Spree::PaymentSource, nil]
|
|
54
|
+
def payment_source_for_settlement
|
|
55
|
+
charge = stripe_charge
|
|
56
|
+
|
|
57
|
+
if charge.present?
|
|
58
|
+
SpreeStripe::CreateSource.new(
|
|
59
|
+
owner: owner,
|
|
60
|
+
stripe_payment_method_details: charge.payment_method_details,
|
|
61
|
+
stripe_payment_method_id: charge.payment_method,
|
|
62
|
+
stripe_billing_details: charge.billing_details,
|
|
63
|
+
gateway: payment_method
|
|
64
|
+
).call
|
|
65
|
+
elsif charge_not_required?
|
|
66
|
+
# Bank transfers settle with no charge object, so the instrument has
|
|
67
|
+
# to come off the intent instead.
|
|
68
|
+
intent = stripe_payment_intent
|
|
69
|
+
|
|
70
|
+
SpreeStripe::CreateSource.new(
|
|
71
|
+
owner: owner,
|
|
72
|
+
stripe_payment_method_details: intent.payment_method,
|
|
73
|
+
stripe_payment_method_id: intent.payment_method.id,
|
|
74
|
+
stripe_billing_details: nil,
|
|
75
|
+
gateway: payment_method
|
|
76
|
+
).call
|
|
77
|
+
end
|
|
78
|
+
end
|
|
44
79
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
).call
|
|
80
|
+
# Keeps the charge reference alongside whatever the caller passed.
|
|
81
|
+
def apply_settlement_metadata(payment, metadata)
|
|
82
|
+
super
|
|
83
|
+
charge = stripe_charge
|
|
84
|
+
payment.metadata['stripe_charge_id'] = charge.id if charge.present?
|
|
51
85
|
end
|
|
52
86
|
end
|
|
53
87
|
end
|