How to do a transaction in CM
- Create a transaction in Payhub:
curl --location 'https://api.payhub.cm.com/v1/accounts/05e1ee3f-301d-4648-a165-df012dad4902/transactions' --header 'X-CM-SSO-ACCOUNTGUID: 03e8f0a0-43ec-4def-977b-2c9c670f89ac' --header 'Content-Type: application/json' --data '{
"additionalData": null,
"amount": {
"currency": "EUR",
"amount": "1.04"
},
"allowedMethods": [ "apple_pay" ],
"card": null,
"connectionId": "eb8b1678-d6f9-4c77-878c-4937d1714462",
"consumer": null,
"description": "Test",
"expiresAtUtc": "2025-10-18T09:51:56Z",
"customerReference": "NUIKPM38862784EQ17S7",
"returnUrlSuccess": "https://example.com",
"returnUrlFailure": "https://facebook.com"
}'
which will give the following response:
{
"id": "d2e35032-b555-4fce-b1e6-cfe34e015074",
"accountId": "05e1ee3f-301d-4648-a165-df012dad4902",
"amount": {
"currency": "EUR",
"amount": "1.04"
},
"status": "Created",
"type": "Payment",
"reference": "",
"allowedMethods": [
"VISA"
],
"providerReference": "dcb698cc-7b23-41a9-8207-6a5f91d73657",
"providerData": {},
"description": "Test",
"connectionId": "eb8b1678-d6f9-4c77-878c-4937d1714462",
"relatedTransactionId": null,
"expiresAtUtc": "2025-10-18T09:51:56Z",
"additionalData": {},
"redirectUrl": "https://payhub.cm.com/l/DVOUa6ZWf6yw_WJQ5FN5q",
"returnUrlSuccess": "https://example.com",
"returnUrlFailure": "https://facebook.com"
}
On clicking the redirectUrl, you will be taken to the cm payment window:

you can find the test cards here: https://www.cm.com/cdn/web/file/guide/payment-method-test-guide.pdf
Use this account for prod testing:
https://www.cm.com/en-gb/app/marketplace/05e1ee3f-301d-4648-a165-df012dad4902/payment/eb8b1678-d6f9-4c77-878c-4937d1714462