Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Before calling the Credit Card Process API, an external API is called on the Blink Platform to tokenise the card details fetched from the hosted card fields and generate a payment Token value. This value will be auto added in the payment form. To achieve this, follow the below steps.


Anchor
payment-token
payment-token

Payment Token

Hosted Fields requires JQuery. The Gateway supports versions 1.8 to 3.6. We use 3.6.3 here:

Code Block
<script src="https://code.jquery.com/jquery-3.6.3.min.js"></script>

To initialise a Hosted Fields instance, include this JavaScript in your payment page. This script should always be loaded directly from the Blink Gateway.

Code Block
<script src="https://gateway2.blinkpayment.co.uk/sdk/web/v1/js/hostedfields.min.js"></script>

In addition to that , include this JavaScript to automatically setup the Hosted Form integration.

Please note that an id value is required in this form element to initiate the Hosted Fields js.

This script will automatically append the paymentToken value to the payment form on form submission.

Code Block
$(function() {
  var formID = $('form').attr('id');
  var $form = $('#'+formID);
  var auto = {
      autoSetup: true,
      autoSubmit: true,
};
try {
  var hf = $form.hostedForm(auto);
} catch(e) {
  //Add your exception handling code here
}