#danilo_dlr
1 messages ยท Page 1 of 1 (latest)
๐ happy to help
<?php
require_once '../stripe-php/init.php';
require_once('vendor/autoload.php');
\Stripe\Stripe::setApiKey('*********');
$customer_email = $_POST['email'];
$amount = $_POST['importe'];
$invoice = \Stripe\Invoice::create([
'customer_email' => $customer_email,
'amount' => $amount,
'currency' => 'usd',
]);
header("Location: " . $invoice->hostedInvoiceUrl);
exit();
?>
would you mind sharing the request ID?
Find help and support for Stripe. Our support center provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
im not sending a request id on the invoice
maybe my code is wrong
maybe its because im not connecting properly to the SDK?
or a field is missing
idk
the request ID is generated for each API call
please read through the guide I sent you to learn how to retrieve one
the API call didnt create a request, last request ID was req_y8rNKsLp8ZjhH6 day 21/04/2023
something is wrong on the code, its not generating a request properly
<?php
require_once '../stripe-php/init.php';
require_once('vendor/autoload.php');
\Stripe\Stripe::setApiKey('*');
$customer_email = $_POST['email'];
$amount = $_POST['importe'];
$invoice = \Stripe\Invoice::create([
'customer_email' => $customer_email,
'amount' => $amount,
'currency' => 'usd',
]);
header("Location: " . $invoice->hostedInvoiceUrl);
exit();
?>
the form we using its just sending the amount and customer email to the paystripe.php with the code above
HTTP ERROR 500 when sending the data to the php
You need to debug your code (add some logs) in order to see why there are missing fields when creating the API request.. probably some fields are null/undefined
i will check logs and make an update on this ticket soon
thanks
looks like autoload is not correctly refferenced:
Got error 'PHP message: PHP Warning: require_once(vendor/autoload.php): failed to open stream: No such file or directory in /var/www/vhosts/test.secure.unrwa.es/httpdocs/chile/paystripe.php on line 3PHP message: PHP Fatal error: require_once(): Failed opening required 'vendor/autoload.php' (include_path='.:/opt/plesk/php/7.4/share/pear') in /var/www/vhosts/test.secure.unrwa.es/httpdocs/chile/paystripe.php on line 3'
on server error_log
You'll need to debug that.... you can also refer to this quickstart for invoices:
https://stripe.com/docs/invoicing/integration/quickstart?lang=php
i used the code you provided me https://stripe.com/docs/invoicing/integration/quickstart?lang=php and added on the end of the server.php the following line: header("Location: " . $invoice->hostedInvoiceUrl);
to redirecto to the payment page. But when i send the payment the screen turn white, nothing showing, also on the webhook on the stripe dhasboard is not showing any API calls.
How can I continue to fix this problem?
i can send you the code if you want, to get a better understanding of my issue
Try running that sample in a standalone project first and do an end to end test first
to redirecto to the payment page. But when i send the payment the screen turn white, nothing showing, also on the webhook on the stripe dhasboard is not showing any API calls.
Did you tried to access to the invoice hosting page from its url ?
you mean just copy paste the sample? im not using composer i think the only change i need to do is deleting the autoloader and add the init.php file right?
I'm not very familiar with PHP, but composer is the dependency manager, without composer what framework are you using for managin your php dependencies?
i just put the repository you have on github manually on my server https://github.com/stripe/stripe-php
๐ taking over for my colleague. Let me catch up.
any updates?
I'm terribly terribly sorry
I missed that, and haven't taken a look
I sincerely appologize
that's not really a very good way to use stripe-php SDK
on the doc it says i can use composer or just put the git repository on my server https://stripe.com/docs/invoicing/integration/quickstart?lang=php
did you follow these steps https://github.com/stripe/stripe-php#manual-installation ?