I am using Laravel Cashier and while working on creating a stripe subscription and when I try to pay using failed test card number 4000008260003178 then it is going in my catch()
but creating a subscription with Incomplete payment and Invoice is Open.
try {
return $subscription = $member->newSubscription('main', $planId)->withMetadata($metaArray)->create($paymentMethod);
} catch (IncompletePayment $exception) {
ErrorLog::create(['module'=>'Stripe payment error: ,'error'=>$exception->payment->id."-".$exception->getMessage()]);
return false;
}
So, when I again try in my frontend to pay using correct card. I am getting below Javascript error. Could you all please guide how to resolve this error. I am really getting stuck in this from long time. Eagerly looking for your help.
error: {code: "setup_intent_unexpected_state",…}
code: "setup_intent_unexpected_state"
doc_url: "https://stripe.com/docs/error-codes/setup-intent-unexpected-state"
message: "You cannot update this SetupIntent because it has already succeeded."
setup_intent: {id: "seti_1GdZmxIG6uR48z4R5hRjLsFp", object: "setup_intent", cancellation_reason: null,…}
cancellation_reason: null
client_secret: "seti_1GdZmxIG6uR48z4R5hRjLsFp_secret_HBxiiqS1kVmCTmzUMWtdUOmOENsEKEc"
created: 1588243123
description: null
id: "seti_1GdZmxIG6uR48z4R5hRjLsFp"
last_setup_error: null
livemode: false
next_action: null
object: "setup_intent"
payment_method: "pm_1GdZnCIG6uR48z4Ro4OQbcLO"
payment_method_types: ["card"]
status: "succeeded"
usage: "off_session"
type: "invalid_request_error"