0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-10 23:36:14 -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:
Nazar Gargol 2020-01-22 12:53:27 +07:00
parent 92b3cc3758
commit 726ffaf1f8

View file

@ -262,7 +262,7 @@ module.exports = class StripePaymentProcessor {
async _customerForMemberCheckoutSession(member) {
const metadata = await this.storage.get(member);
for (const data in metadata.customers) {
for (const data of metadata.customers) {
try {
const customer = await this.getCustomer(data.customer_id);
if (!customer.deleted) {