Category : laravel-cashier

I have 2 different stripe accounts : # Stripe Keys Account 1 STRIPE_KEY=pk_test_abc STRIPE_SECRET=sk_test_abc # Stripe Keys Account 2 STRIPE_KEY_MAPPING=pk_test_opr STRIPE_SECRET_MAPPING_MASTER=sk_test_opr I put in an array : $stripe_accounts = [ env(‘STRIPE_SECRET’), env(‘STRIPE_SECRET_MAPPING_MASTER’) ]; I want to create customer in both accounts in the same time : foreach ($stripe_accounts as $item) { $stripe = new StripeStripeClient($item); ..

Read more

I have 2 stripe account : # Stripe API Keys STRIPE_KEY=pk_test_abc STRIPE_SECRET=sk_test_abc STRIPE_KEY_MAPPING=pk_test_opr STRIPE_SECRET_MAPPING_MASTER=sk_test_opr I put both in an array : ‘stripe_accounts’ => [ env(‘STRIPE_SECRET’), env(‘STRIPE_SECRET_MAPPING_MASTER’) ] Now I want to create user in both accounts : foreach ($stripe_accounts as $item) { Stripe::setApiKey($item); $hotel = session(‘hotel’); $stripeUser = $hotel->createOrGetStripeCustomer(); $hotel->updateDefaultPaymentMethodFromStripe(); } I have no errors, ..

Read more

lets say a monthly recurring payment on a subscription fails it retries automatically on next attempt but is there any way we can try for a charge on that failed payment of subscription when we update a card or retry with same card instead of waiting for stripe to charge automatically on next retry? Source: ..

Read more

I’m upgrading Stripe from Version 9 to Version 10, but this test returns this error, I tried to change the http status but nothing works. My test is here: public function a_item_created_event_will_not_create_a_customer_when_the_customer_creation_fails() { $handler = $this->fakeStripeRequests(); $handler->expects(‘post’, ‘https://api.stripe.com/v1/customers’)->respondWith(500); $logger = $this->fakeLogger(); $item = $this->newItem()->create(); $user = $this->newUser($item)->create(); event(new Created($item, $user)); $this->assertDatabaseMissing(‘customers’, [‘item_id’ => $item->id]); $logger->shouldHaveReceived(‘error’)->with(Mockery::type(ApiErrorException::class)); ..

Read more

I have made a subscription based service and when the user fills in their CC info and purchases the subscription they get redirected to a confirmation page. (See code below) public function store(Request $request) { $plan = Plan::where(‘stripe_plan_id’, $request->plan)->first(); auth()->user()->newSubscription($plan->name, $request->plan)->create($request->paymentMethod); Mail::to(auth()->user()->email)->send(new UserSubscribed(auth()->user(), $plan)); return view(‘billings.confirmation’, compact(‘plan’)); } But I have two situations. First one ..

Read more

When using Checkout Subscriptions, the Stripe documentation states that the minimum event types to monitor are: checkout.session.completed – When you receive a checkout.session.completed event, you can provision the subscription. invoice.paid – Sent each billing interval when a payment succeeds. invoice.payment_failed -Sent each billing interval if there is an issue with your customer’s payment method. When ..

Read more

My customers can update their cards using the methods outlined in the Laravel Cashier documents: https://laravel.com/docs/8.x/billing#updating-the-default-payment-method It doesn’t seem like this also attempts a charge immediately afterwards. From a customer’s perspective, this is very frustrating because they update their card and still don’t have access to the website since it isn’t quite time for the ..

Read more