Payment Flows
Sale
A sale transaction is the simplest form of payment supported, see the steps below to implement this.
- Create an access token by posting to
/v1/access-tokens
on our REST API - Load our JavaScript into your page from
https://web.e.test.connect.paymentsense.cloud/assets/js/client.js
(see here for production settings) - Initialise an instance of Connect-e standard by calling
var connectE = new Connect.ConnectE(config, displayErrorsCallback, onSubmitTriggered);
- User enters their payment details
- Create a button and call
executePayment
when it's clicked. This will return a promise which will resolve with the outcome of the transaction - Confirm the status of the transaction by calling get on
/v1/payments/{access-token}
Refund
Once a sale is made it can be refunded with the following flow.
- Execute an initial payment in the same way as a Sale
- Once the sale has been completed use the Id returned from creating an access token to make a
GET
request to/v1/payments/{access-token}
- Create another access token using the cross reference obtained from
/v1/payments/{access-token}
and atransactionType
ofREFUND
- 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.
- Create a payment in the same way as a Sale, however pass a
PREAUTH
totransactionType
when creating the access key - Once the card details have been captured use the Id returned from creating an access token make a
GET
request to/v1/payments/{access-token}
- Create another access token using the cross reference obtained from
/v1/payments/{access-token}
and atransactionType
ofCOLLECTION
- 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.
- Execute an initial payment in the same way as a Sale
- Once the card details have been captured use the Id returned from creating an access token make a
GET
request to/v1/payments/{access-token}
- Create another access token using the cross reference obtained from
/v1/payments/{access-token}
and atransactionType
of eitherSALE
orPREAUTH
- Initialise an instance of Connect-e recurring payments by calling
var connectE = new Connect.ConnectERecurringPayment(config, displayErrorsCallback, onSubmitTriggered);
- User enters their CV2 code
- Create a button and call
executePayment
when it's clicked. This will return a promise which will resolve with the outcome of the transaction. - Confirm the status of the transaction by calling
GET
on/v1/payments/{access-token}
Card on File with user not present
This is a payment flow that allows merchant initiated payments. Note that this will incur higher fees.
- Execute an initial payment in the same way as a Sale
- Once the card details have been captured use the Id returned from creating an access token make a
GET
request to/v1/payments/{access-token}
- Create another access token using the cross reference obtained from
/v1/payments/{access-token}
and atransactionType
of eitherSALE
orPREAUTH
- Post to
/v1/cross-reference-payments/{access-token}
whereaccess-token
is the Id return from creating the token - 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.
- Create a payment page to be accessed by the merchant or their support team to enter the cardholder details
- Pass
MOTO
totransactionSource
when creating the access key - Enter the card details obtained either over the phone or via mail
- Execute payment by calling
executePayment
on the JavaScript object. This will return a promise which will resolve with the outcome of the transaction - Confirm the status of the transaction by calling
GET
on/v1/payments/{access-token}