2016-11-22 92 views

回答

0

對於Laravel 5.4,我認爲會更容易一些,但由於在撰寫本文時尚未出現,因此您必須手動進行設置。

與Laravel 5.4(假設該功能使得它在)

$user->invoiceForUpcoming('One-time charge', 1000); 

手動方式(請確保您已經安裝了出納等):

use Stripe\InvoiceItem as StripeInvoiceItem; 

將在您的控制器或其它地方是有道理的:

$options = [ 
    'customer' => $user->stripe_id, 
    'amount' => 1000, 
    'currency' => 'usd', 
    'description' => 'One-time fee', 
]; 
$response = StripeInvoiceItem::create(
    $options, ['api_key' => config('services.stripe.secret')] 
); 
+0

對於任何看這個功能的人來說,都是用不同的名字製作的。 $ user-> tab('一次性收費',1000); –