Payment Flows

Sale

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

  1. Create an 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
  6. Confirm the status of the transaction by calling get on /v1/payments/{id}

Refund

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

  1. Execute an initial 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 customer's 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 initial 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.
  7. Confirm the status of the transaction by calling GET on /v1/payments/{id}

Card on File with user not present (Subscription)

This is a payment flow that allows subscription style payments, note that this will incur higher fees.

  1. Execute an initial 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. Post to /v1/cross-reference-payments/{access-token} where access-token is the Id return from creating the token
  5. The result of the transaction will be in the response body of the post

Sale by Mail or Phone (MOTO)

This is for building internal systems that are used for taking payments with card details obtained by phone or mail orders. There will be higher fees for these transactions as the cardholder cannot be authenticated via 3DS.

  1. Create a payment page to be accessed by the merchant or their support team to enter the cardholder details
  2. Pass MOTO to transactionSource when creating the access key
  3. Enter the card details obtained either over the phone or via mail
  4. Execute payment by calling executePayment on the JavaScript object. This will return a promise which will resolve with the outcome of the transaction
  5. Confirm the status of the transaction by calling GET on /v1/payments/{id}