You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
constdata=JSON.stringify({"api_key": "ff3a4889-94d0-4b85-92af-d545607f4d77","api_secret": "79b1a302-8409-46a9-ba6e-8c5c30c11d2f","grant_type": "client_credentials"});constxhr=newXMLHttpRequest();xhr.withCredentials=true;xhr.addEventListener("readystatechange",function(){if(this.readyState===this.DONE){constresponse=this.responseText;// Save the tokenlocalStorage.setItem('token',response.token);}});xhr.open("POST","https://aggreg82r.com/customer/auth");xhr.setRequestHeader("Content-Type","application/json");xhr.send(data);
Push transaction in our server
constdata=JSON.stringify({"payment_gateway": "Stripe",// Your preferred gateway"amount": "10.50","currency": "usd","card": {"number": "4242424242424242","expiryMonth": "6","expiryYear": "2030","cvv": "123"}});constxhr=newXMLHttpRequest();xhr.withCredentials=true;xhr.addEventListener("readystatechange",function(){if(this.readyState===this.DONE){// PROCESS THE RESPONSE DATA IN YOUR APPLICATIONconstresponse=this.responseText;}});xhr.open("POST","https://aggreg82r.com/customer/checkout");xhr.setRequestHeader("Content-Type","application/json");xhr.setRequestHeader("Authorization","Bearer <TOKEN>");xhr.send(data);