mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-13 18:46:49 +00:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3ea9dcc719 | ||
|
|
b0eb0f4a24 |
@@ -5,7 +5,6 @@ require 'stripe/credit_card_cloner'
|
||||
require 'stripe/authorize_response_patcher'
|
||||
require 'stripe/payment_intent_validator'
|
||||
require 'active_merchant/billing/gateways/stripe_payment_intents'
|
||||
require 'active_merchant/billing/gateways/stripe_decorator'
|
||||
|
||||
module Spree
|
||||
class Gateway
|
||||
@@ -112,6 +111,7 @@ module Spree
|
||||
options[:description] = "Spree Order ID: #{gateway_options[:order_id]}"
|
||||
options[:currency] = gateway_options[:currency]
|
||||
options[:stripe_account] = stripe_account_id
|
||||
options[:execute_threed] = true # Handle 3DS responses
|
||||
options
|
||||
end
|
||||
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
# Here we bring commit 823faaeab0d6d3bd75ee037ec894ab7c9d95d3a9 from ActiveMerchant v1.98.0
|
||||
# This is needed to make StripePaymentIntents work correctly
|
||||
# This can be removed once we upgrade to ActiveMerchant v1.98.0
|
||||
ActiveMerchant::Billing::StripeGateway.class_eval do
|
||||
def authorization_from(success, url, method, response)
|
||||
return response.fetch('error', {})['charge'] unless success
|
||||
|
||||
if url == 'customers'
|
||||
[response['id'], response.dig('sources', 'data').first&.dig('id')].join('|')
|
||||
elsif method == :post &&
|
||||
(url.match(%r{customers/.*/cards}) || url.match(%r{payment_methods/.*/attach}))
|
||||
[response['customer'], response['id']].join('|')
|
||||
else
|
||||
response['id']
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user