hotfix(medusa-payment-stripe): fixes failing customer updates
This commit is contained in:
1 parent
8d24f69829
commit
315e8662f0
1 file changed
+7
-2
@@ -24,7 +24,9 @@ class CartSubscriber {
|
|||||||
|
|
||||||
const customer = await this.customerService_.retrieve(customer_id)
|
const customer = await this.customerService_.retrieve(customer_id)
|
||||||
|
|
||||||
const stripeSession = payment_sessions.find(s => s.provider_id === "stripe")
|
const stripeSession = payment_sessions.find(
|
||||||
|
(s) => s.provider_id === "stripe"
|
||||||
|
)
|
||||||
|
|
||||||
if (!stripeSession) {
|
if (!stripeSession) {
|
||||||
return Promise.resolve()
|
return Promise.resolve()
|
||||||
@@ -34,9 +36,12 @@ class CartSubscriber {
|
|||||||
stripeSession.data
|
stripeSession.data
|
||||||
)
|
)
|
||||||
|
|
||||||
let stripeCustomer = await this.stripeProviderService_.retrieveCustomer(
|
let stripeCustomer
|
||||||
|
if (customer.metadata && customer.metadata.stripe_id) {
|
||||||
|
stripeCustomer = await this.stripeProviderService_.retrieveCustomer(
|
||||||
customer.metadata.stripe_id
|
customer.metadata.stripe_id
|
||||||
)
|
)
|
||||||
|
}
|
||||||
|
|
||||||
if (!stripeCustomer) {
|
if (!stripeCustomer) {
|
||||||
stripeCustomer = await this.stripeProviderService_.createCustomer(
|
stripeCustomer = await this.stripeProviderService_.createCustomer(
|
||||||
|
|||||||
Reference in new issue
Block a user