-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Labels
questionFurther information is requestedFurther information is requested
Description
Describe the bug
Pay and add card (https://docs.paytrail.com/#/?id=pay-and-add-card) fails on redirectLink when stamp contains special characters other than - or _.
Steps to Reproduce
- Navigate to demo app: https://paytrail-debug-zeta.vercel.app/
- Alter the stamp input field with any alphanumeric character (or - and _) and see redirectUrl loading in iframe normally.
- Alter the stamp input field with any character other than
-or_and see the iframe break
Expected behaviour
Docs should state limitations. Currently only type "string" and maximum length of 200 is described.
Actual behaviour
Use of special characters breaks redirectLink. In a real application this results in a direct redirection to the "cancel" redirect/callback url.
Screenshots
Screenshots of demo app.
Additional context
Demo application is only for a quick visual of the issue.
Payload is hardcoded with only the stamp changing:
const body = {
stamp,
reference:
"DON" + new Date().getTime() + Math.floor(Math.random() * 1000000),
amount: 100 * 100,
currency: "EUR",
language: "FI",
customer: {
firstName: "John",
lastName: "Doe",
email: "[email protected]",
phone: "1234567890",
},
redirectUrls: {
success: "https://ecom.example.com/cart/success",
cancel: "https://ecom.example.com/cart/cancel",
},
callbackUrls: {
success: "https://ecom.example.com/cart/success",
cancel: "https://ecom.example.com/cart/cancel",
},
};Endpoint used: https://services.paytrail.com/tokenization/pay-and-add-card
HTTP-method used: POST
Metadata
Metadata
Assignees
Labels
questionFurther information is requestedFurther information is requested