#gonzaloinc_89698
1 messages · Page 1 of 1 (latest)
Hi can you share more details in this thread so I can help?
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
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?
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
Yeah the return url you're passing isn't a valid url
Like if you paste it in the browser it won't go
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
That shows what you're passing
Buaaa. of course! thank you my friend! 💯
No problem