#gonzaloinc_89698

1 messages · Page 1 of 1 (latest)

outer obsidianBOT
olive basin
#

Hi can you share more details in this thread so I can help?

torpid mulch
#

Thanks! I am using a test mode with test cards from stripe. A few days function perfectly but now show me this error. I cant find the error code to work on this

olive basin
#

Still need more info

#

What are you attempting to do where you get this error? Can you share a request id?

#

Can you share code snippets?

torpid mulch
#

Of course Thanks

#

$stripe = new \Stripe\StripeClient($this->mode('prod'));

header('Content-Type: application/json');

try {
// retrieve JSON from POST body
$jsonStr = file_get_contents('php://input');
$jsonObj = json_decode($jsonStr, true);

// Create a PaymentIntent with amount and currency
$paymentIntent = $stripe->paymentIntents->create([
    'amount' => (int)$_REQUEST['amount'],
    'currency' => 'mxn',
    //'metadata' => ['order_id' => $this->get_id_reserve($jsonObj->items)],
    'automatic_payment_methods' => [
        'enabled' => true,
    ],
]);

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

echo json_encode($output);

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

#

paymentIntents->create

#

In my console

olive basin
#

Yeah the return url you're passing isn't a valid url

#

Like if you paste it in the browser it won't go

outer obsidianBOT
olive basin
#

That shows what you're passing

torpid mulch
#

Buaaa. of course! thank you my friend! 💯

olive basin
#

No problem

torpid mulch
#

I wasn't thinking clearly anymore!

#

have a good day