Payment Flows

Sale

A sale transaciton is the simplest form of payment supported see the steps below to implement this.

  1. Create a access token by posting to /v1/access-tokens on our REST API
  2. Load our JavaScript into your page from https://web.e.test.connect.paymentsense.cloud/assets/js/client.js (see here for production settings)
  3. Initialise an instance of Connect-e standard by calling var connectE = new Connect.ConnectE(config, displayErrorsCallback, onSubmitTriggered);
  4. User enters their payment details
  5. Create a button and call executePayment when it's clicked. This will return a promise which will resolve with the outcome of the transaction.

Refund

Once a sale is made it can be refunded with the following flow.

  1. Execute an inital a payment in the same way as a Sale.
  2. Once the sale has been completed use the Id returned from creating an access token to make a GET request to /v1/payments/{id}
  3. Create another access token using the cross reference obtained from the /v1/payments/{id} and a transactionType of REFUND
  4. Post to /v1/cross-reference-payments/{access-token} using the access token in the previous step. The outcome of the refund will be in the response body of the post

Preauth and Collection

This allows you to capture a customers card details and charge the card at a later date.

  1. Create a payment in the same way as a Sale, however pass a PREAUTH to transactionType when creating the access key
  2. Once the card details have been captured use the Id returned from creating an access token make a GET request to /v1/payments/{id}
  3. Create another access token using the cross reference obtained from the /v1/payments/{id} and a transactionType of COLLECTION
  4. Post to /v1/cross-reference-payments/{access-token} using the access token in the previous step. The outcome of the collection will be in the response body of the post

Card on File with CV2

This a payment flow that allows the user to enter only the CV2 code when making repeated payments.

  1. Execute an inital a payment in the same way as a Sale.
  2. Once the card details have been captured use the Id returned from creating an access token make a GET request to /v1/payments/{id}
  3. Create another access token using the cross reference obtained from /v1/payments/{id} and a transactionType of either SALE or PREAUTH
  4. Initialise an instance of Connect-e recurring payments by calling var connectE = new Connect.ConnectERecurringPayment(config, displayErrorsCallback, onSubmitTriggered);
  5. User enters their CV2 code
  6. Create a button and call executePayment when it's clicked. This will return a promise which will resolve with the outcome of the transaction.