#csolis
1 messages · Page 1 of 1 (latest)
Hello!
Do you have a question about the error in your screenshot?
Error implementing plans installments in laravel, in Mexico for the method of pay, help please
What specific help do you need? Are you asking what the error means?
The documentatio is wrong
Which documentation?
Which part of those docs are wrong?
This error is literally, the example in this documentation
In collect_details.php
In the moment of search of plans, recive error 404
Do you have collect_details.php mapped to the /collect_details URL on your server?
Yes
Are you sure? Are you sure it's not mapped to /collect_details.php?
Or /something/collect_details.php?
If you change this line:
fetch('/collect_details', {
To this:
fetch('/collect_details.php', {
Does it work?
Same 404 error or a different error?
Same 404 not found
Try without the forward slash; it doesn't seem like that file is in the root of your web server: fetch('collect_details.php', {
Okay, so you've got a syntax error in collect_details.php, but at least you've got the fetch call working now!
Can you provide more details? What changed? It looks like you went back to /collect_details.php which wasn't working before?
is the example of your documentation
<?php
try {
vendor using composer
require_once('vendor/autoload.php');
\Stripe\Stripe::setApiKey('sk_test_J023A345LKpNhf7DCygTA1z000VVPVDWy5');
header('Content-Type: application/json');
retrieve json from POST body
$json_str = file_get_contents('php://input');
$json_obj = json_decode($json_str);
$intent = \Stripe\PaymentIntent::create([
'payment_method' => $json_obj->payment_method_id,
'amount' => 3099,
'currency' => 'mxn',
'payment_method_options' => [
'card' => [
'installments' => [
'enabled' => true
]
]
],
]);
echo json_encode([
'intent_id' => $intent->id,
'available_plans' => $intent->payment_method_options->card->installments->available_plans
]);
}
catch (\Stripe\Exception\CardException $e){
"e" contains a message explaining why the request failed
echo 'Card Error Message is:' . $e->getError()->message . '\n';
echo json_encode([
'error_message' => $e->getError()->message
]);
}
catch (\Stripe\Exception\InvalidRequestException $e) {
// Invalid parameters were supplied to Stripe's API
echo 'Invalid Parameters Message is:' . $e->getError()->message . '\n';
echo json_encode([
'error_message' => $e->getError()->message
]);
}
The same code
I try make test, of plans in mexico
But not working
No working in laravel
And no working your code in the documentation
Literally is yours code
@neat urchin really sorry, totally missed your answers. Unfortunately I'm not sure how to help right now. You shared PHP without much details. Is the file named collect_details.php? If not why not? I think there's something bugged with the code. Totally could be our fault but I'm not sure how to help with just this information. You need to look at the requests the code make, compare to your server side logs, and pinpoint the problem