Added method for linking customer to member

no-issue

Uses the metadata storage passed into stripe
This commit is contained in:
Fabien O'Carroll 2019-09-25 10:23:01 +07:00
parent 9beb496bd1
commit 69abbc6fa2

View File

@ -75,6 +75,13 @@ module.exports = class StripePaymentProcessor {
return session;
}
async addCustomerToMember(member, customer) {
const metadata = await this.storage.get(member);
return this.storage.set(member, metadata.concat({
customer_id: customer.id
}));
}
async getCustomer(id) {
return retrieve(this._stripe, 'customers', id);
}