#ubi
1 messages · Page 1 of 1 (latest)
Should I use use_stripe_sdk ? the reason I didnt use it is because I am not using any SDK
Just offline payment
Can you show me the exact request you're making (if you share the request ID that should be enough)
{:error,
%Stripe.Error{
source: :stripe,
code: :invalid_request_error,
request_id: {"Request-Id", "req_0OaeUcOT3790Cx"},
extra: %{
card_code: :parameter_missing,
http_status: 400,
raw_error: %{
"code" => "parameter_missing",
"doc_url" => "https://stripe.com/docs/error-codes/parameter-missing",
"message" => "A PaymentIntent using type `card` must be confirmed with either `return_url` set to the desired URL or `use_stripe_sdk` set to true (if using Stripe.js or the mobile SDKs). Please try confirming again in one of these two ways.",
"request_log_url" => "https://dashboard.stripe.com/test/logs/req_0OaeUcOT3790Cx?t=1684517200",
"type" => "invalid_request_error"
}
},
message: "A PaymentIntent using type `card` must be confirmed with either `return_url` set to the desired URL or `use_stripe_sdk` set to true (if using Stripe.js or the mobile SDKs). Please try confirming again in one of these two ways.",
user_message: nil
}}
Are you trying to charge an already setup PaymentMethod off-session, or are you trying to actually setup the PAymentMethod for future usage?
I already did a payment with "off-session" before
I am programming a Installment manually type of thing
First Payment ---> Recurring Every 2 Weeks Payments up to 3 Payments
So this is the future payments I need to execute
Gotcha - then you shouldn't be passing in setup_future_usage: off_session
You need to be passing in off_session: true
Stripe.PaymentIntent.create(%{
confirm: true,
amount: tax_calculation.amount_total,
currency: "USD",
metadata: metadata,
customer: customer,
receipt_email: identity.email,
# error_on_requires_action
payment_method: job.args["payment_method_id"],
off_session: true,
use_stripe_sdk: false
})
like that,?
Yes
