laravel-cashier

Cashier Laravel error on create new Subscription

Deadly 提交于 2020-12-15 05:42:47
问题 I'm trying to implements laravel cashier in my project. I have laravel 5.5 and cashier 7.2.2. I have a problem when I try to createNewSubscription. In my controller I have: $user = User::find(3); $subscription = $user->newSubscription('Base', 'price_45asd456a1sa56sd4'); $subscription->create($token); But I receive this error: "Call to a member function create() on null" on line 415 of /var/www/html/vendor/laravel/cashier/src/Billable.php The problem is that in trait return error in: $card =

Stripe API: get upcoming invoice for cancelled Subscription

北城余情 提交于 2020-06-26 14:07:30
问题 I used this code to cancel stripe subscription with prorate $user = User::find(Auth::id()); $subscription = \Stripe\Subscription::retrieve( $user->subscription('main')->stripe_id ); $subscription->delete([ 'prorate' => true ]); in the stripe dashboard subscription cancelled and it is created upcoming invoice with prorate amount. I want to refund prorate amount to customer's card. I tried to get prorate amount using below code. $subscription = \Stripe\Subscription::retrieve($user->subscription

Stripe API: get upcoming invoice for cancelled Subscription

无人久伴 提交于 2020-06-26 14:06:07
问题 I used this code to cancel stripe subscription with prorate $user = User::find(Auth::id()); $subscription = \Stripe\Subscription::retrieve( $user->subscription('main')->stripe_id ); $subscription->delete([ 'prorate' => true ]); in the stripe dashboard subscription cancelled and it is created upcoming invoice with prorate amount. I want to refund prorate amount to customer's card. I tried to get prorate amount using below code. $subscription = \Stripe\Subscription::retrieve($user->subscription

Stripe - cannot create a plan

折月煮酒 提交于 2020-06-22 04:26:44
问题 I am using Laravel Cashier to implement a recurring payment system. I need a plan to make subscription. Stripe doc says : "You can create plans using the API, or in the Stripe Dashboard." But when I go to dashboard by clicking on the link there , I do not see any way to create any plan. Question : So how do I create a plan there so that I can use it in the server side Laravel Cashier Stripe implementation in the following way ? $user->newSubscription('main', $plan)->create($token, ['email' =>

Laravel Cashier + Stripe: No Such Customer

社会主义新天地 提交于 2020-05-15 09:16:27
问题 I am working on developing a subscription for a web application using Laravel Cashier and Stripe. I'm using Stripe v3 JavaScript API and using the card elements to generate the Stripe token. The Stripe token is being generated, and if you look in the Stripe dashboard a customer is created. Additionally, a stripe id is being saved in the user database. However, when I try and subscribe the user to a plan with the following code: $user->newSubscription($planId, $planId)->create($stripeToken, [

Laravel Cashier: should I add a trial period in Stripe too?

我是研究僧i 提交于 2020-01-25 21:18:37
问题 Quoting Laravel Cashier documentation: If you would like to offer trial periods to your customers while still collecting payment method information up front, You should use the trialDays method when creating your subscriptions. Assuming I want to add a 30 days trial period to my subscriptions, I can create a subscription with this code: $user->newSubscription('main', 'monthly') ->trialDays(30) ->create($stripeToken); As a Stripe user, should I add a trial period in Stripe plan too? I'm not

Laravel Cashier: should I add a trial period in Stripe too?

Deadly 提交于 2020-01-25 21:18:22
问题 Quoting Laravel Cashier documentation: If you would like to offer trial periods to your customers while still collecting payment method information up front, You should use the trialDays method when creating your subscriptions. Assuming I want to add a 30 days trial period to my subscriptions, I can create a subscription with this code: $user->newSubscription('main', 'monthly') ->trialDays(30) ->create($stripeToken); As a Stripe user, should I add a trial period in Stripe plan too? I'm not

Laravel Cashier Invoice Date Issue

我怕爱的太早我们不能终老 提交于 2019-12-25 03:28:35
问题 I am using Laravel 5.8 with Laravel Cashier. When I try to show a list of invoices of a user, I used this code: @foreach (Auth::user()->invoices() as $invoice) <tr> <td>{{ $invoice->date()->toFormattedDateString() }}</td> <td>{{ $invoice->total() }}</td> <td> <a href="/user/invoice/{{ $invoice->id }}">Download</a> </td> </tr> @endforeach However, the line $invoice->date()->toFormattedDateString() gives an error: DateTime::__construct(): Failed to parse time string (@) at position 0 (@):

Laravel Cashier DateTime::__construct(): Failed to parse time string (@) at position 0 (@):

青春壹個敷衍的年華 提交于 2019-12-20 04:35:34
问题 I have this code when displaying list of invoices, this is similar or maybe exactly the same to the ones in the official Laravel Cashier documentation. I am getting this weird DateTime::__construct(): Failed to parse time string (@) at position 0 (@): Unexpected character error and I'm not sure what's the @ character doing in replace of a supposed to be date. @foreach (Auth::user()->invoices() as $invoice) <tr> <td>{{ $invoice->date()->toFormattedDateString() }}</td> <td>{{ $invoice->total()

Laravel Cashier 3D Secure/SCA issue stripe

放肆的年华 提交于 2019-12-13 03:58:57
问题 After integrating the stripe system using laravel cashier in our website, I did the testing with the test cards, few cards were successful and few were not. I have tried to adapt to the 3D secure/ SCA. So the thing is, 4000003800000446, 4000002500003155 and 4000000000003055 are success while 4000000000003220 and 4000002760003184 are failure among the cards, returns incomplete status. My system is for annual subscription for a magazine. I do get the pop up urging me to confirm authentication