Skip to content

Commit

Permalink
added create session endpoint (#161)
Browse files Browse the repository at this point in the history
  • Loading branch information
ehtishamSaleem authored Aug 31, 2021
1 parent b23ec14 commit 379fe85
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Models/Subscription.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,6 @@ export default interface Subscription extends Object {
tax_percent: number;
trial_end: number;
trial_start: number;
success_url: string;
cancel_url: string;
}
11 changes: 11 additions & 0 deletions src/Services/Billing/Subscriptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,17 @@ class Subscriptions extends Service {
return response.data;
});
}
/**
* Get subscription for current business for a given entity (any purchasable)
* @param params
*/
createCheckoutSession(params: object ) {
return this.client
.post<JsonResponse<Subscription>>(`1/billing/subscriptions/create-checkout-session`, params)
.then((response: AxiosResponse<JsonResponse<Subscription>>) => {
return response.data;
});
}

/**
* Subscribe to entity (Purchase)
Expand Down

0 comments on commit 379fe85

Please sign in to comment.