diff --git a/lib/api/api.dart b/lib/api/api.dart index 03e6710..c80521e 100644 --- a/lib/api/api.dart +++ b/lib/api/api.dart @@ -41,30 +41,23 @@ Future loginPost(data) async { return {'statusCode': req.statusCode, 'data': req.data}; } -Future getSessions() async { - String tempKey = - 'rTugfHPB7Cd4I1OmsbFCHuJvBSjA2C48WOcMghviohNlNj8IZqazvtwJrdGFHDwp'; +Future getSessions(session) async { var req = await Dio() - .post('$host/sessions', queryParameters: {'key': tempKey}); + .post('$host/sessions', queryParameters: {'session_token': session}); + return {'statusCode': req.statusCode, 'data': req.data}; +} + +Future getTransactions(session) async { + var req = await Dio() + .post('$host/transaction', queryParameters: {'session_token': session}); var res = req.data; return res; } -Future getTransactions() async { - String tempKey = - 'rTugfHPB7Cd4I1OmsbFCHuJvBSjA2C48WOcMghviohNlNj8IZqazvtwJrdGFHDwp'; - var req = await Dio() - .post('$host/transaction', queryParameters: {'key': tempKey}); - var res = req.data; - return res; -} - -Future checkoutPost(data) async { - String tempKey = - 'rTugfHPB7Cd4I1OmsbFCHuJvBSjA2C48WOcMghviohNlNj8IZqazvtwJrdGFHDwp'; +Future checkoutPost(session, data) async { Response req = await Dio().post( ('$host/checkout'), - queryParameters: {'key': tempKey}, + queryParameters: {'session_token': session}, data: data, options: Options( contentType: Headers.formUrlEncodedContentType,