Advertisement
Guest User

Untitled

a guest
Nov 21st, 2017
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. function createACHObject(){
  2. var xhr = new XMLHttpRequest();
  3. var url = "https://staging.gatewayapi.payliance.com/api/ReceivablesProCustomer/createACHAccount/";
  4. var json = {"Request":{
  5. "AccountNumber": "8774598",
  6. "RoutingNumber": "011201458",
  7. "BankName": "Test API Account",
  8. "IsCheckingAccount": "true",
  9. "CustomerId": "420693",
  10. "IsDefault": "true"},
  11. "Auth":{
  12. "UserName": "APIUser155214",
  13. "SecretAccessKey": "kHDkU2sPDVbi6w0gankTc8hfW5ktaKligF50a5GhaFMliscU50JckfSFzFHBxv68jXMlPA0F2bP3C4rCke6Pz4zUWsvwdE2MdxQJX2TSVcFL3KLR0fl2hOJd5I7UcFp0"
  14. }
  15. }
  16. xhr.open("POST", url, true);
  17. xhr.setRequestHeader("Content-type", "application/json");
  18. xhr.onreadystatechange = function () {
  19. if (xhr.readyState === 4 && xhr.status === 200) {
  20. var json = JSON.parse(xhr.responseText);
  21. alert('success');
  22. console.log(json);
  23. //console.log(json.FirstName + ", " + json.LastName + ", " + json.ShippingSameAsBilling);
  24. }
  25. };
  26. var data = JSON.stringify(json);
  27. xhr.send(data);
  28.  
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement