Skip to content

Technical FAQ

Ondřej Zaoral edited this page Jul 3, 2015 · 27 revisions

I am getting http status 400, bad request when calling the eAPI

In most of the cases, the reason is the wrong signature. The most common mistakes are:

  • the string for calculation of the signature is incorrect or the signature calculation algorithm is wrong. Please see more details in eAPI specification
  • incorrect private key is used for the signature (i.e. integration and production environment key mismatch)

Can the cart contain multiple items?

The eAPI v1 requires at least one (e.g.”credit top-up) and maximum two cart (e.g. “mobile phone” and “shipping”) items. Future versions will introduce a new cart with broader options.

How to load the public key in PEM format?

The public key of the payment gateway is distributed in the text PEM format. Please use the following examples for initialitaztion:

JAVA

String publicKeyFileName = "test.pub";
String content = FileUtils.readFileToString(new File(publicKeyFileName));
content = StringUtils.remove(content, "-----BEGIN PUBLIC KEY-----");
content = StringUtils.remove(content, "-----END PUBLIC KEY-----");
X509EncodedKeySpec keySpec = new X509EncodedKeySpec(Base64.decodeBase64(content));
KeyFactory keyFactory = KeyFactory.getInstance("RSA");
PublicKey publicKey = keyFactory.generatePublic(keySpec);

PHP

$publicKeyFileName = "test.pub";
$fp = fopen ($publicKeyFileName, "r" );
if (! $fp) {
    throw new Exception ( "Public key " . $publicKeyFileName . " not found" );
}
$content = fread ($fp, filesize ( $publicKeyFileName ) );
fclose ( $fp );
$publicKey = openssl_get_publickey ( $content );

The payment/process call returns http status 404, not found

Operation payment/process is called using the GET method. Please make sure that the last portion of the URL - signature parameter - is "URL encoded". The signature is transmitted to the gateway as Base64 encoded, therefore contains with a high probability the / character. Payment gateway will not accept the incorrectly formatted request (as it can not load the signature).

Legacy API (migration from GP Webpay) - how to call the transaction status

Legacy API does not support the transaction status enquiry. The operation [payment/status] is supported the new new eAPI

Clone this wiki locally