We are use stripe payments
method in a php script. We are getting the following error:
Fatal error: Uncaught exception 'Stripe\Error\InvalidRequest' with message
'Amount must be at least 50 cents' in /stripe-php/lib/ApiRequestor.php:102
from API request 'req_7w4X4j80cfWZoS'
Stack trace:
#0 /lib/ApiRequestor.php(216):
Stripe\ApiRequestor->handleApiError('{\n "error": {\n...', 400, Array, Array)
#1 /stripe-php/lib/ApiRequestor.php(60):
Stripe\ApiRequestor->_interpretResponse('{\n "error": {\n...', 400, Array)
#2 /stripe-php/lib/ApiResource.php(105):
Stripe\ApiRequestor->request('post', '/v1/charges', Array, Array)
#3 stripe-php/lib/ApiResource.php(137):
Stripe\ApiResource::_staticRequest('post', '/v1/charges', Array, NULL)
#4 /home/imarkinfo/donogifts.com/stripe-php/lib/Charge.php(37):
Stripe\ApiResource::_create(Array, NULL)
#5 /form_section.php(81):
Stripe\Charge::create(Array)
#6 {main} thrown in stripe-php/lib/ApiRequestor.php on line 102
Please suggest how we can fix it
You created the charge with amount=1
. As the error message explicitly says, the minimum amount is 50 cents. All amounts in Stripe's API are in cents, so amount
must be at least 50
when creating a charge.
If you want to charge $1 you must set amount=100 as stripe uses cents.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With