mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-17 23:44:39 -05:00
🐛 Fixed creation of extra customer when updating plans
no issue - `customers` property contains an array of customer for which 'for..of' syntax is more appropriate - Bug was causing creation of multiple customers in Stripe when new checkout session was initiated for existing customer - Discussed in https://github.com/TryGhost/Members/pull/90/files#r368889289
This commit is contained in:
parent
92b3cc3758
commit
726ffaf1f8
1 changed files with 1 additions and 1 deletions
|
@ -262,7 +262,7 @@ module.exports = class StripePaymentProcessor {
|
||||||
async _customerForMemberCheckoutSession(member) {
|
async _customerForMemberCheckoutSession(member) {
|
||||||
const metadata = await this.storage.get(member);
|
const metadata = await this.storage.get(member);
|
||||||
|
|
||||||
for (const data in metadata.customers) {
|
for (const data of metadata.customers) {
|
||||||
try {
|
try {
|
||||||
const customer = await this.getCustomer(data.customer_id);
|
const customer = await this.getCustomer(data.customer_id);
|
||||||
if (!customer.deleted) {
|
if (!customer.deleted) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue