0

I'm using Laravel 5's Cashier, and would like to add additional fees to a user's monthly bill.

Stripe has this functionality available through their API: https://stripe.com/docs/subscriptions#metered-billing-and-one-time-charges

However, it does not look like Cashier is setup to handle this. Any ideas on how this could be added with Cashier?

Marty Thomas
  • 857
  • 2
  • 9
  • 18

1 Answers1

0

I ended up creating a custom class to add an invoice item.

class AddStripeInvoiceItem
{

    public static function execute($user, $amount)
    {    
        Stripe::setApiKey(xxxxxx);
        $invoiceItem = ['customer' => $user->stripe_id,
            'currency' => 'USD',
            'amount' => $amount,
            'description' => '+ '.$amount
        ];
        InvoiceItem::create($invoiceItem);
    }
}
Marty Thomas
  • 857
  • 2
  • 9
  • 18