2016-02-19 34 views
0

我們在php腳本中使用stripe payments方法。我們得到以下錯誤:條紋結賬不起作用

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 

請建議我們如何解決

+0

代碼佈局和問題的提出重新措辭 –

回答

2

created the chargeamount=1。如錯誤消息明確指出的那樣,minimum amount是50美分。 Stripe API中的所有金額均以美分爲單位,因此在創建費用時amount必須至少爲50

+0

我們已經設置價格1 $費用= \條\交費::創建美分(陣列( 「量」 => 1,//量,再次 「貨幣」 =>「usd」, 「source」=> $ _POST ['stripeToken'], 「description」=>「Example charge」) –

+0

以及這個爲我工作的和非常感謝:) –

+0

金額以美分, $ 1是100不是1.金額= 1會收取$ .01 –