Skip to main content

Parameter Forwarding

Sending parameters for which a TokenEx gateway implementation does not have a suitable mapping

Overview

TokenEx gateway implementations have a variety of parameters available to support merchant needs but not all of the mappings are suitable for every merchant.

When a TokenEx gateway parameter mapping is not suitable or present for your application, the parameterForwards object can be used to specify parameters that should be forwarded to the 3rd-party gateway's API. These parameters are merged into the request that Payment Services generates from the supported parameters (see Gateway Parameters).

When a supported parameter is present in both the parameterForwards object and the generated request, this is referred to as a collision. When a collision occurs, the merging of parameters still occurs, but the value specified within parameterForwards may not be forwarded. To change the value of a collision, please use the supported parameter mapping or drop it from the request body.

To inspect how values from the parameterForwards object are merged into the forwarded request, use the showForwardedRequest:true parameter (only available in Test environment).

Differences between Environments

Behavior differences between TokenEx Test and Prod environments

The forwardedRequest object is only returned in the TokenEx Test environment and when showForwardedRequest is true. Build your application's parameterForwards object using the Test environment to validate that your application will perform in the TokenEx Production environment as expected.

showForwardedRequest is not available in the TokenEx Production environment and no details about a merge will be returned in the response. Contact Support with your response's reference number to request a parameter forwarding report and sanitized forwarded request for a transaction that occurred in the TokenEx Production environment.

Request Object

parameterForwardsTypeDescription
bodyobjectParameters which should be forwarded in the 3rd-Party API's request body.
- contentescaped stringExample: "{\"captureDelayHours\": 3, \"additionalData\":{ \"riskData.userType\":\"Guest\"}}"
- formatnumber or stringDefaults to JSON. Select a value below to see supported gateway implementations.

Valid values:
0 - JSON

Example Request

Request
{
... // other request parameters
"showForwardedRequest":true,// display data about the forwarded request in the response
"parameterForwards":{
"body":{ // example content to forward in the body
"content":"{\"captureDelayHours\": 3, \"additionalData\":{ \"riskData.userType\":\"Guest\"}}"
}
}
}

Response Object

forwardedRequestTypeDescription
parameterForwardsobjectReport on the merge of merchant-specified parameters into the 3rd-Party API request.
- mergeOccuredbooleanTrue if the merchant-specified parameters are in the 3rd-Party API request. False if an error occured during the merge.
- forwardsstring []Merchant-specified parameters which were merged into the 3rd-Party API request with their intended values.
- collisionsstring []Merchant-specified parameters for which the 3rd-Party API request already contains.
Merchant-specified parameter forwards cannot overwrite values that have been specified by other request parameters or by the TokenEx gateway implementation.
Note on Arrays: See JSON Array Handling below.
- messagestringExplanatory message detailing error or collision.

Example Responses

{
"gatewayResponse": {
"forwardedRequest": {
"parameterForwards": {
"mergeOccured": true,
"forwards": [
"captureDelayHours",
"additionalData.riskData.userType"
]
},
"method": "POST",
"uri": "https://checkout-test.adyen.com/v69/payments",
"headers": "{\"Authorization\":[\"basic PFlvdXIgQWR5ZW4gVXNlcm5hbWU+OjxZb3VyIEFkeWVuIFBhc3N3b3JkPg==\"],\"Content-Type\":[\"application/json; charset=utf-8\"]}",
"body": "{\"captureDelayHours\":3,\"additionalData\":{\"riskData.userType\":\"Guest\"},\"amount\":{\"currency\":\"USD\",\"value\":150},\"billingAddress\":{\"city\":\"Felipeshire\",\"country\":\"US\",\"houseNumberOrName\":\"Suite 676\",\"postalCode\":\"37685\",\"stateOrProvince\":\"MT\",\"street\":\"175 Cassin Manors\"},\"paymentMethod\":{\"brand\":\"MasterCard\",\"cvc\":\"737\",\"expiryMonth\":\"12\",\"expiryYear\":\"2030\",\"holderName\":\"Fredrick Gulgowski\",\"number\":\"REMOVED[12]1115\",\"type\":\"scheme\"},\"shopperEmail\":\"[email protected]\",\"merchantAccount\":\"<Your merchant account identifier>\"}"
},
... // remainder of gatewayResponse
}
}

JSON Array Handling

Using parameterForwards to merge JSON arrays will cause the parameter name to be displayed as a collision. When merging arrays, it is important to manually inspect the forwarded request to validate the values your application is forwarding are being merged correctly.

Simple arrays containing strings, numbers, or booleans

These arrays are merged as a union. If a supported parameter is creating a simple array and your application is attempting to merge values into it using parameterForwards - items that already exist are skipped. If one array is [1,2,3] and the other array is [3,4,5], the output will be [1,2,3,4,5]; the 3 is already present, so it's not added again.

Complex arrays containing objects

When two arrays contain objects that have the same keys, the merged array will contain all objects from both arrays. Values are not overwritten, but instead the arrays are concatenated.

Gateway Body.Content Formats

JSON