Skip to content
This repository has been archived by the owner on Apr 19, 2023. It is now read-only.

Commit

Permalink
🐛 Use stripe ID not organization ID
Browse files Browse the repository at this point in the history
  • Loading branch information
AnandChowdhary committed Mar 6, 2020
1 parent 6290105 commit c280c76
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@staart/api",
"version": "1.3.132",
"version": "1.3.133",
"main": "index.js",
"repository": "[email protected]:staart/api.git",
"author": "Anand Chowdhary <[email protected]>",
Expand Down Expand Up @@ -90,5 +90,5 @@
"setup"
],
"snyk": true,
"staart-version": "1.3.132"
"staart-version": "1.3.133"
}
6 changes: 4 additions & 2 deletions src/rest/organization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1110,12 +1110,14 @@ export const applyCouponToOrganizationForUser = async (
} catch (error) {
throw new Error(INVALID_INPUT);
}
if (amount && currency)
await createCustomerBalanceTransaction(organizationId, {
const organization = await getOrganization(organizationId);
if (amount && currency && organization.stripeCustomerId)
return await createCustomerBalanceTransaction(organizationId, {
amount,
currency,
description
});
throw new Error(STRIPE_NO_CUSTOMER);
}
throw new Error(INSUFFICIENT_PERMISSION);
};
Expand Down

0 comments on commit c280c76

Please sign in to comment.