Skip to content

Commit

Permalink
Merge pull request #151 from internxt/feat/allow-Paypal-method
Browse files Browse the repository at this point in the history
[MKT-125]: Feat/get the client_secret from the setup intent
  • Loading branch information
masterprog-cmd authored Jul 13, 2023
2 parents 62f030e + f084078 commit 3355838
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/drive/payments/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,20 @@ export class Payments {
return this.client.post('/checkout-session', { ...payload }, this.headers());
}

public getPaypalSetupIntent({
priceId,
coupon,
}: {
priceId: string;
coupon?: string;
}): Promise<{ client_secret: string }> {
const query = new URLSearchParams();
if (priceId !== undefined) query.set('priceId', priceId);
if (coupon !== undefined) query.set('coupon', coupon);

return this.client.get(`/paypal-setup-intent?${query.toString()}`, this.headers());
}

/**
* Returns the needed headers for the module requests
* @private
Expand Down

0 comments on commit 3355838

Please sign in to comment.