-
Notifications
You must be signed in to change notification settings - Fork 67
Technical FAQ
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)
To create and verify signature use algorithm based on SHA-1. For example in Java for getting instance of class java.security.Signature
use algorithm "SHA1withRSA", in PHP use "OPENSSL_ALGO_SHA1", default algorithm for openssl_sign()
a openssl_verify()
functions.
Example of crypto operations in Java
Example of crypto operations in .NET
The eAPI v1, v1.5, v1.6 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.
Beware of correct format of cart parameter, payment gateway expects the list of fields for cart
parameter, i.e. fields must be enclosed in [
and ]
, especially if cart contains only single item.
correct cart content with one item:
"cart":[ { "name":"Reservation", "quantity":1, "amount":10000 } ]
incorrect:
"cart": { "name":"Reservation", "quantity":1, "amount":10000 }
Beware of the "extensions" parameter formatting in case of EET, it is important as you can see below to format this parameter like a field not as an object.
"extensions":[ { "extension": "eetV3", "dttm": "20170125131559", "data": { "premiseId": 181, "cashRegisterId": "00/2535/CN58", "totalPrice": 17896.00 }, "signature": "base64-encoded-extension-signature" } ]
The public key of the payment gateway is distributed in the text PEM format. Please use the following examples for initialitaztion:
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);
$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 );
Example of sign() and verify() operations in this snippet
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 does not support the transaction status enquiry. The operation [payment/status
] is supported the new new eAPI
The recommended settings is Europe/Prague
timezone. The same settings is used in responses sent from payment gateway. The main benefit for merchant is easier tracking of sent communication, however payment gateway does not validate timezone of dttm
parameter, this parameter is primarily used for signature computing.
Please use UTF-8 encoding in JSON requests in eAPI calls.
Generated key from keygen application in Safari browser is not automatically downloaded, key is only displayed in browser. This is limitation of used js library. We recommend to store key manually by ⌘+S.
- Payment lifecycle
- Integration and API security
- Activation of the production environment
- Test cards and credentials
- API Sunset
- Payment Authentication
- Basic Payment
- OneClick Payment
- Custom Payment
- Apple Pay
- Google Pay
- Collecting partial card payment
- ČSOB Payment Button
- Payment Skip Pay
- API Integration
- Request Signing and Response Signature Validation
- API Methods Overview
- Basic Methods
- Methods for OneClick Payment
- Methods for Apple Pay
- Methods for Google Pay
- Methods for ČSOB Payment Button
- Methods for Skip Pay
- Purchase metadata