mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-03-11 02:12:21 -05:00
Fixed customer not fetched for billing update
no issue The logic to fetch member for a checkout session was incorrectly creating a new customer instead of finding an existing one, so the member's billing details was not getting updated.
This commit is contained in:
parent
a8782054ba
commit
0d7c06b5a8
1 changed files with 2 additions and 3 deletions
|
@ -182,10 +182,9 @@ module.exports = class StripeAPIService {
|
|||
async getCustomerForMemberCheckoutSession(member) {
|
||||
await member.related('stripeCustomers').fetch();
|
||||
const customers = member.related('stripeCustomers');
|
||||
|
||||
for (const data of customers) {
|
||||
for (const data of customers.models) {
|
||||
try {
|
||||
const customer = await this.getCustomer(data.customer_id);
|
||||
const customer = await this.getCustomer(data.get('customer_id'));
|
||||
if (!customer.deleted) {
|
||||
return customer;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue