Picture

Cancellations - Online Payments

If you need to cancel a payment, you can do this in Cashflows Go, as long as the payment has not been settled (which means that the funds have not been transferred yet). If you cancel a payment, you must cancel the full amount.

When you cancel a payment, you are deleting the request for the funds (the capture request). No funds are ever taken from the card. These requests for funds are batched up and submitted at midnight. Therefore, you can cancel a payment on the same day any time up until midnight. If you need to cancel a payment after midnight (not the same day), the funds will have been transferred and you need to refund the payment instead. For information, see Refunds.

Cancelling a payment and cancelling a payment job are not the same thing. If you cancel a payment but not the payment job, you can still use the payment job for submitting more payments in the future.

How to cancel a payment

As long as a payment has not been settled, you can usually cancel the payment on the same day when the transaction occurred.

You can only cancel a payment job for payments that have not been settled. If a payment has been settled, the only way to reverse it is with a refund. For information, see Refunds.

Example request to cancel a payment

The cancel payment has no message body. You just need to include the paymentJobReference and paymentReference in the URL, for example:

https://gateway-int.cashflows.com//api/gateway/payment-jobs/210221017490247692/payments/210221117473470476/cancel

Example response

{

    "data": {

        "reference": "210221117473470476",

        "createDateTimeUtc": "2021-02-24T14:05:08.475Z",

        "paymentMethods": [

            "Card"

        ],

        "status": "Cancelled",

        "amountToCollect": "10.00",

        "surchargeAmount": "0",

        "paidAmount": "10.00",

        "steps": [

            {

                "reference": "210221221667909660",

                "createDateTimeUtc": "2021-02-24T14:05:08.9Z",

                "action": "Start",

                "paymentMethods": [

                    "Card"

                ],

                "status": "Pending",

                "amountToCollect": "10.00"

            },

            {

                "reference": "210221204563402752",

                "createDateTimeUtc": "2021-02-24T14:05:30.79Z",

                "action": "Process",

                "paymentMethods": [

                    "Card"

                ],

                "status": "Paid",

                "amountToCollect": "10.00"

            },

            {

                "reference": "210221204596957184",

                "createDateTimeUtc": "2021-02-24T14:11:07.9139698Z",

                "action": "Cancel",

                "paymentMethods": [

                    "Card"

                ],

                "status": "Cancelled",

                "amountToCollect": "10.00"

            }

        ],

        "flags": {},

        "attributes": {

            "returnUrlSuccess": "https://www.mywebshop.com/?paymentjobref=210221017490247692&paymentref=210221117473470476&ordernumber=Payment+ref+D1C",

            "returnUrlFailed": "https://www.mywebshop.com/?paymentjobref=210221017490247692&paymentref=210221117473470476&ordernumber=Payment+ref+D1C",

            "returnUrlCancelled": "https://www.mywebshop.com?paymentjobref=210221017490247692&paymentref=210221117473470476&ordernumber=Payment+ref+D1C&status=cancelled",

            "cashFlowsAcquiringDetails": "{\"ThreeDSecureVersion\":\"1.0.2\",\"ThreeDSecureVersionReason\":\"3-D Secure v2 not enabled for this merchant.\",\"AuthenticationStatus\":\"Y\",\"Xid\":\"0Kbcw53GnooWrEjdo1T3f1iBbb0=\",\"Cavv\":\"7EmWGOmKzy1eEJPl89OfUwX9S9T=\",\"Eci\":\"05\",\"AuthCode\":\"AUTHOK\",\"Arn\":\"74501871055010015749357\",\"Message\":\"Authorised\",\"Status\":\"Successful\",\"IssuerResponseCode\":\"00\",\"CvvAvsResult\":\"200\",\"AcquirerResponseCode\":\"A\",\"TruncatedCardNumber\":\"400000******0002\"}",

            "originatingIpAddress": "86.167.78.143, 23.200.87.37, 88.221.114.222",

            "originHeader": "https://integration.cashflows.com",

            "paymentMethodTransactionId": "01S00DB3211",

            "paymentMethodVoidTransactionId": "01V00DB322B"

        },

        "refunds": [],

        "captures": []

    }

}

How to cancel a payment job

A payment job can remain on the Cashflows Gateway for six months before it expires so it’s good housekeeping to cancel any payment jobs that are no longer in use.

Tip: If you want a payment job to expire sooner than six months, you can set an expiry date when you create the payment job. Here’s an example that includes an expiration date and time:

{"type": "Payment", "paymentMethodsToUse": ["creditcard"],"parameters": {"cardNumber":"4000000000000002", "cardCvc": "123", "cardExpiryMonth": "05", "cardExpiryYear": "23" }, "order": {"orderNumber": "Payment ref D1E"}, "currency": "GBP", "amountToCollect": "10.00", "expirationDateTimeUtc": "2021-01-20T16:50:01"}

It’s also good practice to cancel a payment job to prevent misuse and ensure that that it can’t be used for any other tasks. When you can cancel a payment job, it will not be possible to submit any more payments using the same payment job.

Note: Cancelling a payment job does not cancel completed payments.

Example response

{

    "data": {

        "reference": "210121017238589452",

        "createDateTimeUtc": "2021-01-14T10:32:50.506Z",

        "type": "Payment",

        "traceReference": "210120117364553808",

        "configurationId": "200426117314086912",

        "domain": "cashflows.com",

        "locale": "en_GB",

        "timeZone": "Europe/London",

        "order": {

            "orderNumber": "Your ref",

            "createDateTimeUtc": "2021-01-14T10:32:50.506Z",

            "billingAddress": {

                "firstName": "Alex",

                "lastName": "Smith"

            },

            "billingIdentity": {

                "emailAddress": "alex@test.com"

            },

            "orderLines": []

        },

        "orderHistory": [],

        "paymentMethodsToUse": [

            "Card"

        ],

        "currency": "GBP",

        "amountToCollect": "10.00",

        "expirationDateTimeUtc": "2021-07-14T10:32:50.506Z",

        "lastUpdateTimeUtc": "2021-01-14T15:10:59.0720383Z",

        "lastProcessedTimeUtc": "2021-01-14T10:32:50.506Z",

        "flags": {

            "createdOnMapi": true

        },

        "attributes": {},

        "paymentStatus": "Cancelled",

        "payments": [

            {

                "reference": "210121117372807180",

                "createDateTimeUtc": "2021-01-14T10:32:50.677Z",

                "paymentMethods": [

                    "Card"

                ],

                "status": "Cancelled",

                "amountToCollect": "10.00",

        ��       "steps": [

                    {

                        "reference": "210121217372942352",

                        "createDateTimeUtc": "2021-01-14T10:32:50.73Z",

                        "action": "DisplayHostedPage",

                        "paymentMethods": [

                            "Card"

                        ],

                        "status": "Pending",

                        "amountToCollect": "10.00"

                    },

                    {

                        "reference": "210121217339387924",

                        "createDateTimeUtc": "2021-01-14T15:10:59.0479346Z",

                        "action": "Cancel",

                        "paymentMethods": [

                            "Card"

                        ],

                        "status": "Cancelled",

                        "amountToCollect": "10.00"

                    }

                ],

                "flags": {},

                "attributes": {

                    "returnUrlSuccess": "https://www.mywebshop.com/?paymentjobref=210121017238589452&paymentref=210121117372807180&ordernumber=Your+ref",

                    "returnUrlFailed": "https://www.mywebshop.com/?paymentjobref=210121017238589452&paymentref=210121117372807180&ordernumber=Your+ref",

                    "returnUrlCancelled": "https://www.mywebshop.com?paymentjobref=210121017238589452&paymentref=210121117372807180&ordernumber=Your+ref&status=cancelled"

                },

                "refunds": [],

                "captures": []

            }

        ]

    }

}