For any question, we are one click away

Contact us

Web SDK Core

Library for generating cryptograms from data received from the payment form. The library generates the response asynchronously! A webhook is used to get the result.

The library is used by the Merchant on their website. A list of payment form parameters (pan, expiry, cvc, etc.) is passed to the library, and the output is a cryptogram ready for transfer to the acquiring backend.

Example of use

<script src="https://dev.bpcbt.com/payment/modules/card-kit-core/card-kit-core.js"></script>
<script>
  window.CKCToken.generateWithCard(
    {
      pan: '4111111111111111',
      cvc: '123',
      expiryMMYY: '12/24',
      // pubKey: '-----BEGIN PUBLIC KEY-----MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAioZS/AN/xWtZsQNFjOc8VjKnE5xwQuT0zV0q2j2JpBN66We1+dya9gfqt14Mg53tHfvTB+hbHpmK8mYlPdpZXnIIN3TuBv9llfwmAMm4pFRDG8KeIgOVLSGptHufjwoh2iE4YfxZWgCbnkqjDk6YiTPdy+W7nxF+fPUEsFE1YJDTRwzVqpsbjfKW9tQAjDxpAwfsiyhk0NzTEsDahWtjk1+WaqqrN0LRQgtaTnnbjSr3npmegu63mgTXBX1MT5olRY+BjCaPCZLt+6sFNd/wVI+UBo3/U6jHEHVe3T1vdZWNhJe2twFzrSSpm5aevDK7OpQzMT7v2wUIRWIlFvIxFwIDAQAB-----END PUBLIC KEY-----',             
    },
    function (result) {
      console.log('Result:', result);
    }
  );
</script>

Parameters

ParameterMandatoryPurpose
panyesCard number (no spaces)
cvcnoCVV/CVC code of the card
expiryMMYYnodate in MM/YY or MMYY format
pubKeynoPublic key for encryption (if the parameter is not set, the key will be obtained from the server automatically)

Errors

Error typeExplanation
requiredThe field is required.
invalid-formatData format is invalid.
invalid-lengthField length is invalid.
invalid-pub-keyKey is invalid.
get-pub-key-failedFailed to get key from server.

Response format

{
  token: "...", // obtained token ready for passing
  errors: [ // errors array
    {
      field: "pan", // Field name
      error: "invalid-length" // Error type
    },
  ]
}

Example of payment request with generated cryptogram

curl --location --request POST 'https://dev.bpcbt.com/api2/payments' \
--header 'X-Api-Key: 6HUXQFbeomV1zf5i8cgm5W8KfncENVEa5uh8RngB' \
--header 'Content-Type: application/json' \
--data '{
  "amount": 70000,
  "currency": "EUR",
  "paymentMethod": {
    "type": "card",
    "card": {
        "token": "ofVx1r3aIJ3Mlx3nkfeOIJgFOnwfsgFK+V6Yzm+KxJgsq19l74GChhX0We/LEFq78Rhn9uFAEZGdeyDhnIc/KfuvObf0EzoDA65Uj1Z8FjwWyjnEwTBHZL4KmdFBCSk8jLxHt70mXwyjiHYyCVH1fT/UVOnsrkZVGrqmEG4MTi5dX9Znzf24DwRg4iezvdT8vf0dUW5lJdvY1tgOsOnBulwy6kH/YbHVsnR6yxO6d6IsdnT5f8PxaB+7ZyUqgrd6VA88FGJKJgdoxk4721pqKSG5dYroLJG96s23EDJ2Hpi4e9wU2rP7E6dlFw+qzATqX/eaJbaQ9eakkdMWnkj7aQ=="
    }
  },
  "returnUrl": "https://mybestmerchantreturnurl.com/"
}'
Categories:
eCommerceSDKAPI V2
Categories
Search results