我正在使用 Laravel Cashier ,并在创建条带订阅时,当我尝试使用失败的测试卡号4000008260003178进行支付时,它正在我的catch()
中,但是正在创建订阅未付款且发票已打开。
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;
}
因此,当我再次尝试使用正确的卡付款时,在前端中。我遇到了 Javascript错误。能否请大家指导如何解决此错误。长期以来,我真的陷入了困境。急切地寻求您的帮助。
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"