#u2ojr2-billing_details-stripejs

1 messages · Page 1 of 1 (latest)

steep lion
#

looking

lone stream
#

all good

#

Any ideas?

steep lion
#

ah sorry I missed following up here

#

can you make sure a/ your new code is running by putting a custom console.log() before your confirmPayment()

and b/ mind sharing an API request for that /v1/payment_intents/:id/confirm request, where you're passing billing_details but not seeing it

lone stream
#
    // retrieve JSON from POST body
    $jsonStr = file_get_contents('php://input');
    $jsonObj = json_decode($jsonStr);

    // Create a PaymentIntent with amount and currency
    $paymentIntent = \Stripe\PaymentIntent::create(
        [
            'amount' => calculateOrderAmount($jsonObj->items),
            'currency' => 'eur',
            'automatic_payment_methods' => [
                'enabled' => true,
            ],
            'description' => 'test@test.com | Product: test x1',
        ]
    );

    

    $output = [
        'clientSecret' => $paymentIntent->client_secret,
    ];


    echo json_encode($output);
} catch (Error $e) {
    http_response_code(500);
    echo json_encode(['error' => $e->getMessage()]);
}```

This is my paymentIntent create
#

where do I need to trigger a confirm request?

steep lion
#

stepping away, a colleague is jumping in to help you out!

sacred birch
#

👋 Hello! Give me a minute to catch up

#

Do you have more details on what specifically isn't working? Are you getting an error message? What behavior are you seeing?