#qiiixel_api
1 messages · Page 1 of 1 (latest)
👋 Welcome to your new thread!
⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1227229450589048913
📝 Have more to share? Add more details, code, screenshots, videos, etc. below.
hi!
The first payment is processed successfully, but when I run a simulation into the future, the invoices switch to "draft" and then to "payment pending."
do you have an examplein_xxxinvoice where that happened?
Yes the invoice in_1P3dGcBkxKnDCKZ0dHyCb5OB for example
Thanks for your help
seems to me that it did work, we created the recurring Invoice and tried to debit the saved card for the payment. The payment was declined due to requiring 3D Secure.
Can I avoid this with the API? Have a first payment which manages 3D secure and the others which do this automatically without user intervention
sure. You'd use the the test card for that 4000002500003155 https://docs.stripe.com/testing#regulatory-cards
Thanks but I just tried and the problem persists.
Payments for subsequent months require the user to take an action to validate 3D security. Is it possible to no longer have 3D secure for subsequent subscription payments? Perhaps I should proceed differently. Here I follow this approach:
customers->create
checkout->sessions->create
can you share the ID of the example you just tried?
Yes in_1P3diwBkxKnDCKZ0JSsH2APJ
ack, well that should have got an exemption(as you can see on the notes in the timeline at the top of https://dashboard.stripe.com/test/payments/pi_3P3diDBkxKnDCKZ01KpbE5fU) so let me look into it some more
Thanks a lot for your help
Here is my code if that helps :
$stripe_customer_id = get_user_meta($current_user->data->ID, 'stripe_customer_id', true);
if($stripe_customer_id == "") {
$customer = $stripe->customers->create([
'name' => $current_user->data->display_name,
'email' => $current_user->data->user_email,
'metadata' => ['user_id' => $current_user->data->ID]
]);
$stripe_customer_id = $customer->id;
update_user_meta($current_user->data->ID, "stripe_customer_id", $stripe_customer_id);
}
$session = $stripe->checkout->sessions->create([
'success_url' => ($spectacleId != 0) ? home_url('/mon-compte?spectacle_id='.$spectacleId.'#mes-spectacles') : home_url('/proposer-un-spectacle?message=success_subscribe'),
'cancel_url' => home_url('/abonnement'),
'payment_method_types' => ['card'],
'payment_method_options' => [
'card' => [
'request_three_d_secure' => 'any', // Peut être `automatic` ou `any`. `any` force 3D Secure s'il est supporté.
],
],
'line_items' => [
[
'price' => $priceId,
'quantity' => 1,
'tax_rates' => ['txr_1OyB9NBkxKnDCKZ04rzNlHEM'], //Prod : txr_1P1pZVBkxKnDCKZ0F2NdVUdT
],
],
'mode' => 'subscription',
'customer' => $stripe_customer_id,
'subscription_data' => [
'default_tax_rates' => ['txr_1OyB9NBkxKnDCKZ04rzNlHEM'], //Prod : txr_1P1pZVBkxKnDCKZ0F2NdVUdT
]
]);
hmm it's really strange, I don't know. It should have not required 3D Secure as far as I can tell but we decided to request it. Maybe it's a bug in our test mode, I'll flag it internally.
Can 'request_three_d_secure' => 'any' have an impact on future payments and request 3D secure?
ah yeah that's true, I seem to recall us changing something about this recently and making it so that parameter affects future payments on the same subscription or something
you could try removing it
It's perfect, it works.
I think I have to use this option to activate 3Dsecure but it seems that it is managed automatically.
In the retired it works, thank you very much for your help
I also flagged/asked internally since it does seem unexpected to me. I think everything you're doing in the API is correct and should allow simulating exemptions
hmm interesting!
so the only change you made was removing request_three_d_secure from the CheckoutSession create API call?
Yes that's it, and with the test card that you gave me it is well managed but only at the initial payment
I see. Ok a colleague on my team tells me that if you pass request_three_d_secure on the initial CheckoutSession, that is "persisted" across future payments on the Subscription it creates(so each payment then tries to do 3D Secure), which is what you had guessed. I just didn't realise it worked that way
Thank you very much for your help, I have been searching for several hours 😅
yeah sorry, the 3155 card can be hard to find