node.js ValidationError using 'paymentProductFilters'
Rob1nTimmer opened this issue · 2 comments
When using JSON:
{
"hostedCheckoutSpecificInput": {
"paymentProductFilters": {
"restrictTo": {
"products": [1, 2, 3, 809, 836, 840]
},
"tokensOnly": false
},
},
"order": {
"amountOfMoney": {
"currencyCode": "USD",
"amount": 1000
},
"customer": {
"billingAddress": {
"countryCode": "US"
}
}
}
}
I get the error:
[ ValidationError {
property: 'instance.hostedCheckoutSpecificInput',
message: 'additionalProperty "paymentProductFilters" exists in instance when not allowed',
schema:
{ type: 'object',
properties: [Object],
additionalProperties: false },
instance: { paymentProductFilters: [Object] },
name: 'additionalProperties',
argument: 'paymentProductFilters',
stack: 'instance.hostedCheckoutSpecificInput additionalProperty "paymentProductFilters" exists in instance when not allowed' } ]
Possibly unhandled Error: instance.hostedCheckoutSpecificInput additionalProperty "paymentProductFilters" exists in instance when not allowed
However when using JSON (without "paymentProductFilters"):
{
"hostedCheckoutSpecificInput": {
},
"order": {
"amountOfMoney": {
"currencyCode": "USD",
"amount": 1000
},
"customer": {
"billingAddress": {
"countryCode": "US"
}
}
}
}
it works and I get the response:
{
"status": 201,
"body": {
"RETURNMAC": "27ab0e7c-fd0c-4758-87be-b84de2e72710",
"hostedCheckoutId": "00000024620000000146",
"partialRedirectUrl": "sandbox.poweredbyglobalcollect.com/checkout/2462-73bb6804950943a3b8a7fbaded5d26a5:00000024620000000146:cd68d4f27ebd4cc3a505e5902412c923"
}
}
I am using the nodejs SDK using the call;
merchant_demo.ingenicoConnect.hostedcheckouts.create(merchantId, body, null, function (err, sdkResponse) {
}
Can you make sure you use at least version 1.1.0 of the SDK? If you are using version 1.0.0, this functionality is not yet supported.
This has indeed resolved the issue