// Make a call to your backend to create a new transaction reference
// (1) Your backend makes call to https://sandbox.interswitchng.com/webpay/api/v1/gettransaction.json endpoint and receives an XML response. let getResponseBody = await new Promise(resolve => { const requestOptions = { method: ‘POST’, headers:{ Accept: ‘application/json’, ‘Content-Type’: ‘application/json’, Authorization: `Bearer ${userToken}` }, body: JSON.stringify({ amount:amount, isVisaCard:”true” }) }; fetch(baseURL + ‘/gettransaction’, requestOptions) .then(response => response.text()) .then(text => { const getResponse = JSON.parse(convert.xml2json(text, {compact: true, spaces: 4})); resolve(getResponse); }); }); let presharedKey = ‘ikpFf2shHiduvcVpZiNTVK3lWa7sz9UtF4KbALS81/g=’; let amount = ‘500000’; let currency = 566;
} else (FinalMessage.content), { duration: 5000 }) : t.alert_component([{ status_msg:getResponseBody.status, failed_trans_reason:getResponseBody.RESPONSE_CODE._text, apiKey:’IKIA9614B82064D632E65674ABC20A34C21AB3328B46BF7DB44CA419837BD62AD’, appliedFeePercentage:’%1′, screeningVenueKeyArray:[ { screening_venue_name:’Gates Under-Graduate Centre,Gate Hauz, Oke Afin, Kuto-Abeokuta’,//it should be passed to the api with ValueOf screening_city:’GCA Online Examination’ }, { screening_venue_name:’Pre-Degree Entrance Hall, Canaan Land,Ota,Ogun State’, //it should be passed to the api with ValueOf screening_city:’Canaan Land Online Exam’ }