File tree Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -413,6 +413,34 @@ export async function createSubscription({
413413 return response ;
414414}
415415
416+ export async function createAppStoreSubscription ( {
417+ secretKey,
418+ customerId,
419+ planId,
420+ receipt,
421+ } ) {
422+ const response = await server . loadJson (
423+ `${
424+ Config . apiUrl
425+ } ${ Endpoints . PROJECT . PAYMENTS . SUBSCRIPTIONS . CREATE_APP_STORE ( customerId ) } `,
426+ {
427+ method : 'POST' ,
428+ headers : {
429+ 'X-CM-ProjectId' : Config . projectId ,
430+ Authorization : `Bearer ${ secretKey || Config . secretKey } ` ,
431+ Accept : 'application/json' ,
432+ 'Content-Type' : 'application/json' ,
433+ } ,
434+ body : JSON . stringify ( {
435+ planId,
436+ receipt,
437+ } ) ,
438+ }
439+ ) ;
440+
441+ return response ;
442+ }
443+
416444export async function updateSubscription ( {
417445 secretKey,
418446 id,
Original file line number Diff line number Diff line change @@ -148,6 +148,8 @@ export const CONFIG = {
148148 SUBSCRIPTIONS : {
149149 CREATE : ( customerId ) =>
150150 `/v2/payments/customers/${ customerId } /subscriptions` ,
151+ CREATE_APP_STORE : ( customerId ) =>
152+ `/v2/payments/customers/${ customerId } /subscriptions/apple` ,
151153 UPDATE : ( customerId , id ) =>
152154 `/v2/payments/customers/${ customerId } /subscriptions/${ id } ` ,
153155 CHANGE : ( customerId , id ) =>
You can’t perform that action at this time.
0 commit comments