Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

178
Views
Keep getting response code 500 in Cardpointe API call

I keep getting a 500 response code in an API call to the Cardpointe gateway (cardconnect) any insight will help. (I was able to verify the test credentials by just posting to the URL without the auth endpoint)

Here is my code in a Google apps script:

function myFunction() {

  var messagesUrl = "https://fts-uat.cardconnect.com/cardconnect/rest/auth";
  var cred = "testing:testing123";
    
  var payload = JSON.stringify({
  "merchid" : "496160873888",
  "account": "4788250000121443",
  "expiry": "1218",
  "cvv2": "123",
  "amount": "100",
  "phone": "15558889999",
  "capture": "y"
  });

  
  var options = {
    "method" : "put",
   "payload" : payload
  };
  
  options.headers = {    
    "Authorization" : "Basic " + Utilities.base64Encode(cred)
    },{
    "Content-Type" : "application/json"
    }
  var res = UrlFetchApp.fetch(messagesUrl, options);
  
  Logger.log(res);
  
}
about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

options.headers = {    
    "Authorization" : "Basic " + Utilities.base64Encode(cred)
    },{
    "Content-Type" : "application/json"
    }

Here content type is not set to options.headers.

/*<ignore>*/console.config({maximize:true,timeStamps:false,autoScroll:false});/*</ignore>*/ 
const options ={};
options.headers = {    
"Authorization" : "Basic " + "b64"
},{
"Content-Type" : "application/json"
}
console.log(options)
<!-- https://meta.stackoverflow.com/a/375985/ -->    <script src="https://gh-canon.github.io/stack-snippet-console/console.min.js"></script>

headers should be a single object with multiple keys:

options.headers = {    
    "Authorization" : "Basic " + Utilities.base64Encode(cred),
    "Content-Type" : "application/json"
    }

/*<ignore>*/console.config({maximize:true,timeStamps:false,autoScroll:false});/*</ignore>*/ 
const options={}
options.headers = {    
"Authorization" : "Basic " + "b64",
"Content-Type" : "application/json"
}
console.log(options)
<!-- https://meta.stackoverflow.com/a/375985/ -->    <script src="https://gh-canon.github.io/stack-snippet-console/console.min.js"></script>

/*<ignore>*/console.config({maximize:true,timeStamps:false,autoScroll:false});/*</ignore>*/ 
let a;
a = 1,3;
console.log(a);// no 3
<!-- https://meta.stackoverflow.com/a/375985/ -->    <script src="https://gh-canon.github.io/stack-snippet-console/console.min.js"></script>

about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!