#nick_51639
1 messages · Page 1 of 1 (latest)
This channel is for developers and technical integration questions. For Dashboard related queries, our Support team will be able to assist you better than I can: https://support.stripe.com/contact
Find help and support for Stripe. Our support site provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
Thanks @nimble temple I will follow up via that channel, could I clarify a different technical issue I'm experiencing instead.
Currently we're configuring a Clients custom Woocommerce page to use the Stripe Checkout Element for it's payments.
Currently we have this setup and working for Credit Card Payments however we want to use BECS Direct Debit (AU) as well.
We've gone through the steps of enabling this in the Stripe Dashboard and updated our code in WooCommerce to contain the payment_method_type for it.
When we test after these steps we still get the following error and I'm unsure how to debug it:
""The provided payment_method_types (["card", "link"]) does not match the expected payment_method_types (["au_becs_debit", "card"]). Try confirming with a Payment Intent that is configured to use the same parameters as Stripe Elements."
"
Can you share the request ID (req_xxx) with the error? Here’s how you can find it: https://support.stripe.com/questions/finding-the-id-for-an-api-request
Find help and support for Stripe. Our support site provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
One moment I'll get it now
@nimble temple I think it's req_KJZVC4wo4QXfiN?t, this is the link to the dashboard page I have https://dashboard.stripe.com/test/logs/req_KJZVC4wo4QXfiN?t=1697511857"
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
I can provide our code as well if that helps
The Payment Intent is created from the Subscription: https://dashboard.stripe.com/test/logs/req_e8TceusDgwXaPb
payment_method_types should be set in payment_settings.payment_method_types parameter of the Subscription request: https://stripe.com/docs/api/subscriptions/create#create_subscription-payment_settings-payment_method_types
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Hey @nimble temple following the doc we updated our code to the following:
$subscription = $stripe->subscriptions->create([
'customer' => $customerId,
'cancel_at_period_end' => true,
'payment_behavior' => 'default_incomplete',
'items' => [[
'price' => $price_id,
]],
'payment_settings' => [
'save_default_payment_method' => 'on_subscription',
'payment_method_types' =>[
'au_becs_debit',
'card'
]
],
'expand' => [
'latest_invoice.payment_intent', 'pending_setup_intent'
]
]);
However it still returned the error
"message": "The provided payment_method_types (["card"]) does not match the expected payment_method_types (["au_becs_debit", "card"]). Try confirming with a Payment Intent that is configured to use the same parameters as Stripe Elements.",
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
@nimble temple based on the information above are we still missing something? Let me know if you need more of our code it review it
Thanks for waiting! Checking it now
How do you create the Subscription and payment method now? Do you create payment method then create a subscription with deferred intent flow, or create a subscription first and use its payment intent?
@nimble temple We create a subscription first and then use the payment intent
Thanks for sharing! Can you share the code how you initialise the Elements? It looks like you're using deferred intent flow that isn't meant for such a Subscription use case
Payment Element Initialise (JS)
const options = {
mode: modeType,
amount: 1099,
currency: 'aud',
'setup_future_usage' : 'off_session',
paymentMethodTypes : [
'au_becs_debit',
//'link',
'card'
],
appearance: {/.../},
};
// Set up Stripe.js and Elements to use in checkout form
elements = stripe.elements(options);
PHP Create Payment Intent
$intent = $stripe->paymentIntents->create([
'amount' => $upfront_amount ,
'currency' => 'aud',
'description' => 'Upfront payment for '. $product->get_title(),
'customer' => $customerID,
'setup_future_usage' => 'off_session',
'payment_method_types'=>[
'au_becs_debit',
//'link',
'card'
]
]);
Based on the options setting, you're using deferred intent flow for the Payment Intent created from Subscription. Parameters such as mode, amount, currency, setup_future_usage, paymentMethodTypes are not required
Please refer to the guide here for the Subscription integration with Payment Element: https://stripe.com/docs/billing/subscriptions/build-subscriptions?ui=elements
To summarise the process we:
- Create the Customer
- Find the Price in Stripe
- Create the Subscription
- Subscription returns Client Secret
- We use Client Secret for confirming the payment
- After these steps is when we get the current issue
More specifically at step 5 of the guide
The elements initialisation isn't correct
I'll have a look now
Thanks for the assistance so far @nimble temple, I'll need to spend some time updating and retesting our code with this latest info in mind.
If I have additional questions in a few hours time or potentially tomorrow can I message again here or should I start a new chat?
This is a short-lived thread. Feel free to come back with a new chat with reference to this thread, so that my team will be able to further assist you 🙂
Great thanks River