#jellybeer-_code

1 messages ¡ Page 1 of 1 (latest)

river marshBOT
#

👋 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/1366504411844710412

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

limpid dragon
#

Hello there

#

Hmm not sure what you mean exactly.

#

Can you tell me me more about what you are trying to do and what the issue is?

round fossil
#

ok on my website i have created a payment page. there you can choose from card, paypal, ideal and bancontact. suppose i choose card. i fill in everything and then i click on pay and then my products are paid and the default payment method is also saved immediately in the customer. in other words the default payment method for that customer is now his card with which he paid. then i tried it with the payment method 'ideal'. the payment succeeds, but it does not want to save it as default payment method. then i get this error:

The customer does not have a payment method with the ID pm_1RIxqFGdKuVLvOxUwrO7yR3l. The payment method must be attached to the customer.

limpid dragon
#

Ah thanks for clarifying

round fossil
#

i am really terrible at explaing hehe

limpid dragon
#

iDEAL and Bancontact are single-use PaymentMethods. So in this flow they actually generate a SEPA Debit PaymentMethod that you need to use.

round fossil
#

aha

limpid dragon
#

You want to grab the generated_sepa_debit PaymentMethod

round fossil
#

ah ty i will try

round fossil
#

i got this now:

\Stripe\Stripe::setApiKey($_ENV['STRIPE_SECRET_KEY']);

$paymentIntentId = $_GET['payment_intent'];

try {
    // Haal PaymentIntent op
    $paymentIntent = \Stripe\PaymentIntent::retrieve(
        $paymentIntentId,
        [
            'expand' => ['latest_charge'] // <--- dit moet erbij staan!
        ]
    );

    // Voeg dit toe om alles te dumpen
    header('Content-Type: application/json');
    echo json_encode($paymentIntent, JSON_PRETTY_PRINT);
    exit;

but i cant see the generated_sepa_debit part.

limpid dragon
#

Can you provide the PaymentIntent ID or Checkout Session ID that you are testing with?

round fossil
#

is this the id pi_3RIyGGGdKuVLvOxU1b9LpDCs?

limpid dragon
#

Yes

#

That was a Paypal example

#

Not iDEAL or Bancontact

round fossil
#

Ah my bad, but i het the same result. I will send te new id

#

pi_3RIyOCGdKuVLvOxU1nvfsr39

#

is it because i am in test mode?

limpid dragon
#

You can see that there is a generated_sepa_debit PaymentMethod

#

So you are doing something wrong in your code

#

In terms of retrieving it

round fossil
#

omg i am stupid

#

i added expand' => ['latest_charge'] in de return url but not in the checkout part so i never send the latest charge

river marshBOT
limpid dragon
#

Ah

#

Is it working now?

round fossil
#

yup

limpid dragon
#

Wahoo!

round fossil
#

thanklss a lot. i have been trying stuff for a whole day ahah