Paymentwall website uses cookies to store your browsing preferences on your device. However, cookies do not collect personal information.

For more information about how we use cookies, check our cookie policy

Close

Documentation

New Documentation Getting Started API Libraries APIs Checklists Flows Integrations Mobile SDKs Reference Smart TV SDK SpiderPipe Testing Payments
Contacts
If you still have questions regarding integration, please email us at devsupport@paymentwall.com

Cancellation API

API URL

https://api.paymentwall.com/developers/api/ticket

Request

Request method: POST

Request parameters:

 

ParameterRequiredPossible valuesDescription
key yes hexadecimal, 32 characters long Project key, can be found in General Settings of the Project inside of your Merchant Account
ref yes*  alphanumeric Transaction reference ID - ‘ref’ field from the pingback
uid yes*  alphanumeric, up to 64 characters long User id
type yes 1, 2 or 3 

Ticket type. Possible values:

  1. Refund
  2. Recurring billing cancellation
  3. Other
message yes  String Message or description of ticket from user / support team
sign yes  hexadecimal, 32 characters long, lowercase Request signature. Refer to signature calculation section below. Important: required format is lowercase
test_mode no  1 or 0 Possible values: 1, 0. 1 means that the API is used in test mode, in this case no real uid or ref is required.

* Either ref or uid is required

Response

Response data format: JSON

Response parameters:

ParameterDescription
result

Result of request. Possible values:

1 - success
0 - error

errors Array of error messages in case of error

Possible errors:

ErrorAction
You have no access to the developers API Please make sure that
  • the request is submitted by POST
  • correct project key is used
  • the signature is calculated properly
Either ref or uid is required Make sure that you provide either uid or ref parameter or both

Signature calculation and posting a ticket

Please note that project key and secret from example need to be replaced with your own.

<?php
function generateCancellationSignature($params, $secret) {
    // work with sorted data
    ksort($params);
    
    // generate the base string
    $baseString = '';
    foreach($params as $key => $value) {
        $baseString .= $key . '=' . $value;
    }
    $baseString .= $secret;
    
    return strtolower(md5($baseString));
}

$secret = 'ac8af8eeb4d5d33d1986bcb52719027b';

$params = array(
    'key' => 'f04150f73d04e47029548e526b2b12ec',
    'ref' => 'b1563',
    'uid' => '218069',
    'type' => '1',
    'message' => 'Please cancel asap', 
'test_mode' => '0' // pass 1 to perform tests without an actual transaction
); $params['sign'] = generateCancellationSignature($params, $secret); $post = curl_init();

curl_setopt($post, CURLOPT_URL, 'https://api.paymentwall.com/developers/api/ticket');
curl_setopt($post, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($post, CURLOPT_POST, 1);
curl_setopt($post, CURLOPT_POSTFIELDS, $params);
curl_setopt($post, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($post, CURLOPT_FOLLOWLOCATION, 1);

$result = curl_exec($post);

Given example will generate the following signature: 9dc4316d3a3d6951d94d1edf6ce735f5
It will also post the ticket.

This page needs JavaScript
Your browser is
not supported anymore.
Please update to the more recent one.
This page needs JavaScript
This page needs JavaScript.
Please enable it in your browser settings and try again.
We use cookies on this website to make your browsing experience better. By using the Paymentwall website you agree to our Cookies Policy.