4 posts / 0 new
Last post
sanjaychaudhary7022
Getting "Internal Server Error" on eCheck Purchase test.

Hi,

I am getting an "internal_server_error" with status 500 , while performing test on eCheck Purchase with sample data on sandbox.

Please help me out.

Here is my code.

------------------------------------------
<?php
require_once('PayeezyCheckLink.php');
require_once('..\src\Payeezy.php');

$serviceURL = 'https://api-cert.payeezy.com/v1/transactions';
$apiKey = "jcNXNMAaYeZuLMS700RhVUBczA4jX2dV";
$apiSecret = "5694c10b2871aabd6f7dcac8258a5797025cf8db781b05c29a9a251cf7c2e24f";
$token = "fdoa-a480ce8951daa73262734cf102641994c1e55e7cdf4c02b6";

$nonce = strval(hexdec(bin2hex(openssl_random_pseudo_bytes(4, $cstrong))));
$timestamp = strval(time() * 1000); //time stamp in milli seconds

$eCheckObj = new PayeezyCheckLink();
$ePayeezyObj = new Payeezy();
//echo '';
//print_r($eCheckObj->setTeleCheckPrimaryTxPayload());
$payload = $ePayeezyObj->getTeleCheckValueLinkPayLoad($eCheckObj->setTeleCheckPrimaryTxPayload());
//die;
//print_r($payload);
//exit;

//$payload = getPayload(setPrimaryTxPayload());

echo " Request JSON Payload :";

echo $payload;

echo " Authorization :";

$data = $apiKey . $nonce . $timestamp . $token . $payload;

$hashAlgorithm = "sha256";

### Make sure the HMAC hash is in hex -->
$hmac = hash_hmac($hashAlgorithm, $data, $apiSecret, false);

### Authorization : base64 of hmac hash -->
$hmac_enc = base64_encode($hmac);

echo " ";

echo $hmac_enc;

echo "";

$curl = curl_init('https://api-cert.payeezy.com/v1/transactions');

$headers = array(
'Content-Type: application/json',
'apikey:' . strval($apiKey),
'token:' . strval($token),
'Authorization:' . $hmac_enc,
'nonce:' . $nonce,
'timestamp:' . $timestamp,
);

curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $payload);

curl_setopt($curl, CURLOPT_VERBOSE, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);

$json_response = curl_exec($curl);

$status = curl_getinfo($curl, CURLINFO_HTTP_CODE);

$response = json_decode($json_response, true);

echo " ";

if ($status != 201) {
die("Error: call to URL $serviceURL failed with status $status, response $json_response, curl_error " . curl_error($curl) . ", curl_errno " . curl_errno($curl));
}

curl_close($curl);

echo "Response is: \n";
print_r($response);

echo "JSON response is: " . $json_response . "\n" . $status;
?>

--------------------------------------

My json formatted payload is :

{
"method":"tele_check",
"transaction_type":"purchase",
"amount":"10",
"currency_code":"USD",
"tele_check":{
"check_number":"4788250000028291",
"check_type":"C",
"routing_number":"123456789",
"account_number":"123",
"accountholder_name":"Tom Eck",
"customer_id_type":"1",
"customer_id_number":"7623786df",
"client_email":"rajan.veeramani@firstdata.com",
"gift_card_amount":"100",
"vip":"n",
"clerk_id":"RVK_001",
"device_id":"jkhsdfjkhsk",
"micr":"jkhjkh",
"release_type":"X",
"registration_number":"12345",
"registration_date":"01012014",
"date_of_birth":"01012010"
},
"billing_address":{
"street":"225 Liberty Street",
"city":"NYC",
"state_province":"NY",
"zip_postal_code":"10281",
"country":"US"}
}


rohitrajagopal3538
Re: Getting "Internal Server Error" on eCheck Purchase test.

Please try the same payload with a account number > 3 digits. I just tested that it works.

Regards,

Payeezy team


sanjaychaudhary7022
Re: Getting "Internal Server Error" on eCheck Purchase test.

Hey thanks !

The code is working fine now.

Regards,
Sanjay Chaudhary


sujeetkumar19957
Re: Getting "Internal Server Error" on eCheck Purchase test.

Here is my payload and I am getting Internal Server Error, Can you please take a look.

URL: https://api-cert.payeezy.com/v1/transactions/

I also try changing amount and other value.

/**************************/
API SECRET: 1425dcf2bc9010d965c566b3cd4d18dc14c6f8824e3d4aa2203327ef87304570

HTTP HEADERS:
TOKEN: fdoa-add6c4d0f7eccdec91c2a2496e70e6eaadd6c4d0f7eccdec
APIKEY: uQUnnwIQJQHNnA29GfdrZOsZW09Amhx6
AUTHORIZATION: MDFiODhiZWVjZmVlMTVkNDUyZDQ0NDIyYzI0ZmMyZDg2NTg5YTllNjZjMzg3NmFiYmE5YTI1Y2YwNTE1NDVjNg==
NONCE: 1860819654
TIMESTAMP: 1522951874240

JSON Request:
{ "method":"tele_check","transaction_type":"authorize","amount":"0","currency_code":"USD","tele_check":{ "check_number":"4788250000028291","check_type":"C","routing_number":"BN1234567801234567890","account_number":"17101874","accountholder_name":"Bob Payeezy","customer_id_type":"1","customer_id_number":"701367","client_email":"testuser9999@childfund.org"},"billing_address":{ "street":"484 Chestnut St Apt 21","city":"Manchester","state_province":"NH","zip_postal_code":"03101","country":"US" } }

JSON Response:
{"correlation_id":"124.2295188946658","Error":{"messages":[{"code":"internal_server_error","description":"Internal Server Error"}]},"transaction_status":"Not Processed"}
/*****************************/