Skip to content

Commit

Permalink
squash
Browse files Browse the repository at this point in the history
Resolves: #
Change-type:
  • Loading branch information
thgreasi committed Nov 28, 2024
1 parent 0a535ec commit 1479865
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/models/billing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,9 @@ const getBillingModel = function (
* @function
* @memberof balena.models.billing
*
* @param {(String|Number)} organization - handle (string) or id (number) of the target organization.
* @param {Object} setupIntentParams - an object containing the parameters for the setup intent creation
* @param {(String|Number)} extraParams.organization - handle (string) or id (number) of the target organization.
* @param {(String|undefined)} [extraParams.'g-recaptcha-response'] - the captcha response
*
* @fulfil {Object} - partial stripe setup intent object
* @returns {Promise}
Expand All @@ -286,9 +288,13 @@ const getBillingModel = function (
* console.log(setupIntent);
* });
*/
createSetupIntent: async (
organization: string | number,
): Promise<{
createSetupIntent: async ({
organization,
...extraParams
}: {
organization: string | number;
'g-recaptcha-response'?: string;
}): Promise<{
id: string;
client_secret: string;
}> => {
Expand All @@ -298,6 +304,7 @@ const getBillingModel = function (
method: 'POST',
url: `/billing/v1/account/${orgId}/setup-intent`,
baseUrl: apiUrl,
body: extraParams,
});
return body;
},
Expand Down

0 comments on commit 1479865

Please sign in to comment.