Skip to content

Commit

Permalink
Adding in what tenant was being fetched with the payment (#1229)
Browse files Browse the repository at this point in the history
  • Loading branch information
travjenkins authored Oct 10, 2023
1 parent f1ed180 commit 73d8608
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions supabase/functions/billing/get_tenant_payment_methods.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,20 @@ export async function getTenantPaymentMethods(
if (customer) {
const methods = (await StripeClient.customers.listPaymentMethods(customer.id)).data;

return [JSON.stringify({ payment_methods: methods, primary: customer.invoice_settings.default_payment_method }), {
return [JSON.stringify({
payment_methods: methods,
primary: customer.invoice_settings.default_payment_method,
tenant: req_body.tenant
}), {
headers: { "Content-Type": "application/json" },
status: 200,
}];
} else {
return [JSON.stringify({ payment_methods: [], primary: null }), {
return [JSON.stringify({
payment_methods: [],
primary: null,
tenant: req_body.tenant
}), {
headers: { "Content-Type": "application/json" },
status: 200,
}];
Expand Down

0 comments on commit 73d8608

Please sign in to comment.