Category : stripe-payments

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

I tried the receive the stripe webhook using the spatie / laravel-stripe-webhooks package. Currently, I can’t receive the any webhook about stripe connected account. Here is my code snip. I added the endpoint in Stripe dashboard. -Endpoints receiving events from your account http://***/webhook-stripe -Endpoints receiving events from Connect applications http://***/webhook-stripe/connect web.php Route::stripeWebhooks(‘webhook-stripe’); Route::stripeWebhooks(‘webhook-stripe/connect’); VerifyCsrfToken.php protected ..

Read more

I’m using the Stripe webhook in my Laravel application for verifying payments. But when using the Webhook::constructEvent I get this Exception [2021-09-12 11:45:45] local.ERROR: StripeExceptionSignatureVerificationException: No signatures found matching the expected signature for payload in C:wamp64wwwVitaalinbewegingvendorstripestripe-phplibExceptionSignatureVerificationException.php:28 Stack trace: #0 C:wamp64wwwVitaalinbewegingvendorstripestripe-phplibWebhookSignature.php(59): StripeExceptionSignatureVerificationException::factory(‘No signatures f…’, ‘{n "id": "evt_…’, ‘t=1631447143,v1…’) #1 C:wamp64wwwVitaalinbewegingvendorstripestripe-phplibWebhook.php(29): StripeWebhookSignature::verifyHeader(‘{n "id": "evt_…’, ‘t=1631447143,v1…’, ‘whsec_0BTF9kHb2…’, 300) ..

Read more

I’m working on an e-commerce web app using Laravel and Vuejs. I chose Stripe’s API to accept and manage payments. In my Vue component, which contains the payment form, and before making it visible(I’m using a multi-step form), I send a post request to my payments store controller function to ‘initialize’ Stripe and get the ..

Read more

I am implementing Cartalyst Stripe to my laravel app. https://cartalyst.com/manual/stripe/2.0#installation This is my controller code at index method: $stripe = new Stripe(env(‘STRIPE_API_KEY’)); $customer = $stripe->customers()->create([ ’email’ => Auth::user()->email, ‘name’ => Auth::user()->name ]); $token = $stripe->tokens()->create([ ‘card’ => [ ‘number’ => ‘4242424242424242’, ‘exp_month’ => 6, ‘exp_year’ => 2022, ‘cvc’ => 314, ], ]); $card = $stripe->cards()->create($customer[‘id’], ..

Read more

I applied a discount code to a subscription but it gives me this error: [2021-08-13 08:06:49] local.INFO: No such coupon: ‘mycode’ for subscription plan Oro User Name: hmza khan Id:23 The code is as bellow: $abc = $user->newSubscription(‘default’, $plan->plan_id) ->withCoupon($request->coupon) ->create($paymentMethod, [ ’email’ => $user->email, ]); I created a coupon in Stripe a/c on this ..

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

I’m working with stripe integration in laravel and see code of another dev like .. <form action="/payment" method="POST"> <script src="https://checkout.stripe.com class="stripe-button checkout-button button alt" key="HERE existing key (in real version of code)" data-amount="{{ $total*100 }}" data-locale="auto" data-currency="eur"> </script> </form> This code should send stripeToken & stripeEmail because backend trying to catch it like : $token ..

Read more

I’m upgrading from laravel 6 to 7 and Stripe from version 9.0 to 10, but the tests don’t work even if I add the "subscription" route. My test is here: public function myTest() { Event::fake(); $subscription = $this->newStripeSubscription($this->customer)->states(‘on-trial’, ‘pro-monthly’)->create(); $this->expectCouponValidated(‘upgrade_from_trial_coupon_monthly’, ‘pro_monthly_plan’); $this->expectSubscriptionUpdated( $subscription->stripe_id, ‘tok_visa’, ‘pro_monthly_plan’, config(‘stripe.coupons.upgrade_from_trial.monthly’) ); $response = $this->actingAs($this->user)->json(‘POST’, ‘/payment’, [ ‘token’ => ‘tok_visa’, ..

Read more

I’m creating service like Airbnb using Laravel. So I’m using stripe payment gateway for my project. So I want to create escrow system using stripe. Let’s say someone book properties of seller ABC for 3 days. On booking amount is debit from buyer’s account and credit to the admin Account. Now on journey completion seller ..

Read more

I want to apply taxes to my stripe subscriptions. (I’m not using Stripe Checkout) At the moment, I’m doing the following: $taxRate = $this->getTax(); return Subscription::create([ ‘customer’ => $this->user->stripe_customer_id, ‘items’ => [ [ ‘price’ => $this->product->stripe_price_id, ‘tax_rates’ => [$taxRate->id] ], ], ‘payment_behavior’ => ‘default_incomplete’, ‘expand’ => [‘latest_invoice.payment_intent’], ‘default_tax_rates’ => [$taxRate->id] ]); getTax() Method public function ..

Read more

I’m trying to add some more information about my product when creating a Stipe Checkout Session, but the metadata doesn’t pull through and Stripe just seems to ignore it. As far as I can tell I’m matching the docs perfectly: https://stripe.com/docs/api/checkout/sessions/create?lang=php#create_checkout_session-line_items-price_data-product_data-metadata Here is my code: $session = StripeCheckoutSession::create([ ‘payment_method_types’ => [‘card’], ‘shipping_address_collection’ => [ ‘allowed_countries’ ..

Read more