Skip to content
This repository was archived by the owner on Feb 27, 2023. It is now read-only.

Commit 4aeb6ff

Browse files
committed
Adds use_strip_sdk param to server-side confirms.
1 parent 973b56b commit 4aeb6ff

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

web.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def log_info(message)
7575
payload = Sinatra::IndifferentHash[JSON.parse(request.body.read)]
7676
end
7777
begin
78-
payment_intent = Stripe::PaymentIntent.confirm(payload[:payment_intent_id])
78+
payment_intent = Stripe::PaymentIntent.confirm(payload[:payment_intent_id] {:use_stripe_sdk => true})
7979
rescue Stripe::StripeError => e
8080
status 402
8181
return log_info("Error: #{e.message}")
@@ -231,6 +231,7 @@ def create_payment_intent(amount, source_id, payment_method_id, customer_id = ni
231231
:return_url => return_url,
232232
:confirm => confirm,
233233
:confirmation_method => confirm ? "manual" : "automatic",
234+
:use_stripe_sdk => confirm ? true : nil
234235
:capture_method => ENV['CAPTURE_METHOD'] == "manual" ? "manual" : "automatic",
235236
:metadata => {
236237
:order_id => '5278735C-1F40-407D-933A-286E463E72D8',

0 commit comments

Comments
 (0)