Overview
Certain transaction types are initiated without any interaction from the customer, and may be triggered entirely via a backend system, or an internal staff facing system like your customer support agents triggering a transaction on behalf of the customer. The following examples can be used as a starting point for transactions you need to process in the merchant-initaited
channel.
Server-to-Server
If you are triggering merchant initiated paymes from a backend, as opposed to a web application that staff is using, you will need to directly manipulate the related objects. Triggering the workflows form the JS SDK hides this from you but when doing server-to-server requests that need 3DS auth you will need to be aware of the ThreeDSecureAuthentications endpoint, and send the ThreeDSecureOptions object to the created object, to configure the workflow.
- Create or Update an Account/Transaction as normal.
- Poll for updates to the object.
- If
metadata.threeDSecure.required
is true, fetch the ThreeDSecureAuthentication with the ID frommetadata.threeDSecure.currentAuthenticationID
- Poll for updates of the ThreeDSecureAuthentication
- When the ThreeDSecureAuthentication is in the
preauth_completed
state, set theoptions
key by updating the ThreeDSecureAuthentication with the ThreeDSecureOptions value you desire. - Poll until status is
postauth_complete
- Continue polling the original object (Account/Transaction) you created, for updates.
Browser Based
For browser based integrations of merchant initiated transactions, you can trigger them as you would customer initiated transactions using the Javascript SDK.
Charging a pre-existing Subscription
let threeDSecureOptions = {
channel: "merchant-initiated",
type: "recurring",
payment: {
type: "goods-services",
amount: 1000,
currency: "EUR",
precision: 2,
subscription: {
identifier: "abcdef",
},
},
account: {
status: "new",
"last-updated": "2020-11-01T12:00:00Z",
created: "2020-11-01T12:00:00Z",
"password-last-updated": "2020-11-01T12:00:00Z",
},
delivery: {
method: "same-day",
destination: "billing-address",
"email-address-id": "e9781557-ed78-46f1-aa6d-ac8e0212b139",
},
};
let response = await client.triggerThreeDSecure(
transaction,
threeDSecureOptions
);
Charging a Subscription that was started prior to the 3DS2 Mandate
let threeDSecureOptions = {
channel: "merchant-initiated",
type: "recurring",
payment: {
type: "goods-services",
amount: 1000,
currency: "EUR",
precision: 2,
subscription: {
identifier: "abcdef",
grandfathered: true,
},
},
account: {
status: "new",
"last-updated": "2020-11-01T12:00:00Z",
created: "2020-11-01T12:00:00Z",
"password-last-updated": "2020-11-01T12:00:00Z",
},
delivery: {
method: "same-day",
destination: "billing-address",
"email-address-id": "e9781557-ed78-46f1-aa6d-ac8e0212b139",
},
};
let response = await client.triggerThreeDSecure(
transaction,
threeDSecureOptions
);
Charging a Phone Order handled by a Customer Service Agent
let threeDSecureOptions = {
channel: "merchant-initiated",
type: "phone",
payment: {
type: "goods-services",
amount: 1000,
currency: "EUR",
precision: 2,
},
account: {
status: "new",
"last-updated": "2020-11-01T12:00:00Z",
created: "2020-11-01T12:00:00Z",
"password-last-updated": "2020-11-01T12:00:00Z",
},
delivery: {
method: "same-day",
destination: "billing-address",
"email-address-id": "e9781557-ed78-46f1-aa6d-ac8e0212b139",
},
};
let response = await client.triggerThreeDSecure(
transaction,
threeDSecureOptions
);
Charging a Mail in Order
let threeDSecureOptions = {
channel: "merchant-initiated",
type: "mail",
payment: {
type: "goods-services",
amount: 1000,
currency: "EUR",
precision: 2,
},
account: {
status: "new",
"last-updated": "2020-11-01T12:00:00Z",
created: "2020-11-01T12:00:00Z",
"password-last-updated": "2020-11-01T12:00:00Z",
},
delivery: {
method: "same-day",
destination: "billing-address",
"email-address-id": "e9781557-ed78-46f1-aa6d-ac8e0212b139",
},
};
let response = await client.triggerThreeDSecure(
transaction,
threeDSecureOptions
);