W3Cschool
恭喜您成為首批注冊用戶
獲得88經(jīng)驗值獎勵
If you would like to make a "one off" charge against a subscribed customer's credit card, you may use the charge method:
$user->charge(100);
The charge method accepts the amount you would like to charge in the lowest denominator of the currency. So, for example, the example above will charge 100 cents, or $1.00, against the user's credit card.
The charge method accepts an array as its second argument, allowing you to pass any options you wish to the underlying Stripe charge creation:
$user->charge(100, [
'source' => $token,
'receipt_email' => $user->email,
]);
The charge method will return false if the charge fails. This typically indicates the charge was denied:
if ( ! $user->charge(100))
{
// The charge was denied...
}
If the charge is successful, the full Stripe response will be returned from the method.
Copyright©2021 w3cschool編程獅|閩ICP備15016281號-3|閩公網(wǎng)安備35020302033924號
違法和不良信息舉報電話:173-0602-2364|舉報郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號
聯(lián)系方式:
更多建議: