1- import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator" ;
2- import _regeneratorRuntime from "@babel/runtime/regenerator" ;
31import Config from './config' ;
42import ConfigRequest from './instance' ;
5- var request = new ConfigRequest ( Config . BILLING_URL_ROOT ) ;
3+ const request = new ConfigRequest ( Config . BILLING_URL_ROOT ) ;
64export function configure ( accessToken ) {
7- var errorResponseCallback = arguments . length > 1 && arguments [ 1 ] !== undefined ? arguments [ 1 ] : null ;
5+ let errorResponseCallback = arguments . length > 1 && arguments [ 1 ] !== undefined ? arguments [ 1 ] : null ;
86 request . configure ( accessToken , errorResponseCallback ) ;
97}
10- export function getSubscription ( _x ) {
11- return _getSubscription . apply ( this , arguments ) ;
12- }
13- function _getSubscription ( ) {
14- _getSubscription = _asyncToGenerator ( /*#__PURE__*/ _regeneratorRuntime . mark ( function _callee ( dongle_id ) {
15- return _regeneratorRuntime . wrap ( function _callee$ ( _context ) {
16- while ( 1 ) {
17- switch ( _context . prev = _context . next ) {
18- case 0 :
19- return _context . abrupt ( "return" , request . get ( 'v1/prime/subscription' , {
20- dongle_id : dongle_id
21- } ) ) ;
22- case 1 :
23- case "end" :
24- return _context . stop ( ) ;
25- }
26- }
27- } , _callee ) ;
28- } ) ) ;
29- return _getSubscription . apply ( this , arguments ) ;
30- }
31- export function getSubscribeInfo ( _x2 ) {
32- return _getSubscribeInfo . apply ( this , arguments ) ;
33- }
34- function _getSubscribeInfo ( ) {
35- _getSubscribeInfo = _asyncToGenerator ( /*#__PURE__*/ _regeneratorRuntime . mark ( function _callee2 ( dongle_id ) {
36- return _regeneratorRuntime . wrap ( function _callee2$ ( _context2 ) {
37- while ( 1 ) {
38- switch ( _context2 . prev = _context2 . next ) {
39- case 0 :
40- return _context2 . abrupt ( "return" , request . get ( 'v1/prime/subscribe_info' , {
41- dongle_id : dongle_id
42- } ) ) ;
43- case 1 :
44- case "end" :
45- return _context2 . stop ( ) ;
46- }
47- }
48- } , _callee2 ) ;
49- } ) ) ;
50- return _getSubscribeInfo . apply ( this , arguments ) ;
51- }
52- export function cancelPrime ( _x3 ) {
53- return _cancelPrime . apply ( this , arguments ) ;
54- }
55- function _cancelPrime ( ) {
56- _cancelPrime = _asyncToGenerator ( /*#__PURE__*/ _regeneratorRuntime . mark ( function _callee3 ( dongle_id ) {
57- return _regeneratorRuntime . wrap ( function _callee3$ ( _context3 ) {
58- while ( 1 ) {
59- switch ( _context3 . prev = _context3 . next ) {
60- case 0 :
61- return _context3 . abrupt ( "return" , request . post ( 'v1/prime/cancel' , {
62- dongle_id : dongle_id
63- } ) ) ;
64- case 1 :
65- case "end" :
66- return _context3 . stop ( ) ;
67- }
68- }
69- } , _callee3 ) ;
70- } ) ) ;
71- return _cancelPrime . apply ( this , arguments ) ;
72- }
73- export function getStripeCheckout ( _x4 , _x5 , _x6 ) {
74- return _getStripeCheckout . apply ( this , arguments ) ;
75- }
76- function _getStripeCheckout ( ) {
77- _getStripeCheckout = _asyncToGenerator ( /*#__PURE__*/ _regeneratorRuntime . mark ( function _callee4 ( dongle_id , sim_id , plan ) {
78- return _regeneratorRuntime . wrap ( function _callee4$ ( _context4 ) {
79- while ( 1 ) {
80- switch ( _context4 . prev = _context4 . next ) {
81- case 0 :
82- return _context4 . abrupt ( "return" , request . post ( 'v1/prime/stripe_checkout' , {
83- dongle_id : dongle_id ,
84- sim_id : sim_id ,
85- plan : plan
86- } ) ) ;
87- case 1 :
88- case "end" :
89- return _context4 . stop ( ) ;
90- }
91- }
92- } , _callee4 ) ;
93- } ) ) ;
94- return _getStripeCheckout . apply ( this , arguments ) ;
95- }
96- export function getStripePortal ( _x7 ) {
97- return _getStripePortal . apply ( this , arguments ) ;
98- }
99- function _getStripePortal ( ) {
100- _getStripePortal = _asyncToGenerator ( /*#__PURE__*/ _regeneratorRuntime . mark ( function _callee5 ( dongle_id ) {
101- return _regeneratorRuntime . wrap ( function _callee5$ ( _context5 ) {
102- while ( 1 ) {
103- switch ( _context5 . prev = _context5 . next ) {
104- case 0 :
105- return _context5 . abrupt ( "return" , request . get ( 'v1/prime/stripe_portal' , {
106- dongle_id : dongle_id
107- } ) ) ;
108- case 1 :
109- case "end" :
110- return _context5 . stop ( ) ;
111- }
112- }
113- } , _callee5 ) ;
114- } ) ) ;
115- return _getStripePortal . apply ( this , arguments ) ;
116- }
117- export function getStripeSession ( _x8 , _x9 ) {
118- return _getStripeSession . apply ( this , arguments ) ;
119- }
120- function _getStripeSession ( ) {
121- _getStripeSession = _asyncToGenerator ( /*#__PURE__*/ _regeneratorRuntime . mark ( function _callee6 ( dongle_id , session_id ) {
122- return _regeneratorRuntime . wrap ( function _callee6$ ( _context6 ) {
123- while ( 1 ) {
124- switch ( _context6 . prev = _context6 . next ) {
125- case 0 :
126- return _context6 . abrupt ( "return" , request . get ( 'v1/prime/stripe_session' , {
127- dongle_id : dongle_id ,
128- session_id : session_id
129- } ) ) ;
130- case 1 :
131- case "end" :
132- return _context6 . stop ( ) ;
133- }
134- }
135- } , _callee6 ) ;
136- } ) ) ;
137- return _getStripeSession . apply ( this , arguments ) ;
8+ export async function getSubscription ( dongle_id ) {
9+ return request . get ( 'v1/prime/subscription' , {
10+ dongle_id
11+ } ) ;
12+ }
13+ export async function getSubscribeInfo ( dongle_id ) {
14+ return request . get ( 'v1/prime/subscribe_info' , {
15+ dongle_id
16+ } ) ;
17+ }
18+ export async function cancelPrime ( dongle_id ) {
19+ return request . post ( 'v1/prime/cancel' , {
20+ dongle_id
21+ } ) ;
22+ }
23+ export async function getStripeCheckout ( dongle_id , sim_id , plan ) {
24+ return request . post ( 'v1/prime/stripe_checkout' , {
25+ dongle_id,
26+ sim_id,
27+ plan
28+ } ) ;
29+ }
30+ export async function getStripePortal ( dongle_id ) {
31+ return request . get ( 'v1/prime/stripe_portal' , {
32+ dongle_id
33+ } ) ;
34+ }
35+ export async function getStripeSession ( dongle_id , session_id ) {
36+ return request . get ( 'v1/prime/stripe_session' , {
37+ dongle_id,
38+ session_id
39+ } ) ;
13840}
0 commit comments