alt

Important information

Please be advised that there will be a scheduled downtime across our API network on November 05 and November 07, 2024. For more information, visit our platform status portal.:
- Scheduled maintenance on November 5, 2024
- Scheduled maintenance on November 7, 2024

Unzer

Manage PayU payment

Manage PayU transactions.

After the successful charge transaction, you can perform additional operations on the payment resource. Some of the important ones are described in the following section.

For a full reference of managing payments, go to relevant server-side integration documentation page: Manage API resources (direct API calls), Manage API resources (PHP SDK), or Manage API resources (Java SDK).

Cancel after payment (refund)

You can refund up to the amount of the received payment. To do this, you have to make a cancel transaction for an existing charge transaction.

POST https://api.unzer.com/v1/payments/s-pay-10/charges/cancels
{}
$unzer = new Unzer('s-priv-xxxxxxxxxx');

$cancel = $unzer->cancelChargedPayment('s-pay-1', new Cancellation(10.00));
Unzer unzer = new Unzer("s-priv-xxxxxxxxxx");

Cancel cancel = unzer.cancelCharge("s-pay-1", new BigDecimal("10.00"));

The response looks similar to the following example:

{
    "id": "s-cnl-1",
    "isSuccess": true,
    "isPending": false,
    "isResumed": false,
    "isError": false,
    "card3ds": false,
    "message": {
        "code": "COR.000.000.000",
        "merchant": "Transaction succeeded",
        "customer": "Your payments have been successfully processed."
    },
    "amount": "1.0000",
    "currency": "PLN",
    "date": "2023-06-12 09:06:28",
    "resources": {
        "customerId": "s-cst-041fbdedbb9b",
        "paymentId": "s-pay-10",
        "basketId": "",
        "metadataId": "",
        "payPageId": "",
        "traceId": "8843268aa44e31f6f8cef582ae5bcea9",
        "typeId": "s-pyu-mnzdgnjmuane"
    },
    "paymentReference": "",
    "processing": {
        "uniqueId": "6925139e.a763.495e.bbd2.6ee3679834bf",
        "shortId": "2226.5195.0176",
        "traceId": "8843268aa44e31f6f8cef582ae5bcea9"
    }
}