6. Provision Cancel
Provision Cancel
POST {{Base Address}}/api/paywall/payment/provision/cancel
You just need to make a request to the address provided above. You can use the 'Base Address' as you like for both the Test environment and the Production environment.
apikeypublic
string
Yes
The Public Key you obtained from the merchant panel.
apiclientpublic
string
Yes
The Public Client you obtained from the merchant panel.
The parameters that need to be sent to the service are as follows:
MerchantUniqueCode
string
Yes
It must be the same value as the MerchantUniqueCode sent in the request to initiate the payment. This code is the unique value provided by you for the transaction. It is used to uniquely identify and track a payment for all Cancel/Refund/Payment Inquiry operations.
Date
date
Yes
The date information when the payment was made
{
"Date": "2024-06-13",
"MerchantUniqueCode": "aaa"
}using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;
public class Program
{
private static readonly HttpClient client = new HttpClient();
private static async Task Main(string[] args)
{
var data = new
{
MerchantUniqueCode = "aaa"
};
client.DefaultRequestHeaders.Add("apikeypublic", "%PUBLICKEY%");
client.DefaultRequestHeaders.Add("apiclientpublic", "%PUBLICCLIENT%");
var content = new StringContent(JsonConvert.SerializeObject(data), Encoding.UTF8, "application/json");
var response = await client.PostAsync("{{Base Adres}}/api/paywall/payment/end3d", content);
var responseString = await response.Content.ReadAsStringAsync();
var responseObject = JsonConvert.DeserializeObject<Response>(responseString);
Console.WriteLine("ErrorCode: " + responseObject.ErrorCode);
Console.WriteLine("Result: " + responseObject.Result);
Console.WriteLine("Message: " + responseObject.Message);
}
public class Response
{
public int ErrorCode { get; set; }
public bool Result { get; set; }
public string Message { get; set; }
public string Body { get; set; }
}
}package main
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
)
type Response struct {
ErrorCode int
Result bool
Message string
Body string
}
type Request struct {
MerchantUniqueCode string `json:"MerchantUniqueCode"`
}
func main() {
url := "{{Base Adres}}/api/paywall/payment/end3d"
reqBody := &Request{
MerchantUniqueCode: "aaa",
}
reqBodyBytes := new(bytes.Buffer)
json.NewEncoder(reqBodyBytes).Encode(reqBody)
req, _ := http.NewRequest("POST", url, reqBodyBytes)
req.Header.Set("Content-Type", "application/json")
req.Header.Set("apikeypublic", "%PUBLICKEY%")
req.Header.Set("apiclientpublic", "%PUBLICCLIENT%")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := ioutil.ReadAll(resp.Body)
var responseObj Response
json.Unmarshal(body, &responseObj)
fmt.Println("ErrorCode:", responseObj.ErrorCode)
fmt.Println("Result:", responseObj.Result)
fmt.Println("Message:", responseObj.Message)
}import okhttp3.*;
import org.json.*;
public class Main {
public static void main(String[] args) {
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
JSONObject json = new JSONObject();
json.put("MerchantUniqueCode", "aaa");
RequestBody body = RequestBody.create(mediaType, json.toString());
Request request = new Request.Builder()
.url("{{Base Adres}}/api/paywall/payment/end3d")
.post(body)
.addHeader("Content-Type", "application/json")
.addHeader("apikeypublic", "%PUBLICKEY%")
.addHeader("apiclientpublic", "%PUBLICCLIENT%")
.build();
try {
Response response = client.newCall(request).execute();
String responseString = response.body().string();
// Parse the response
JSONObject jsonResponse = new JSONObject(responseString);
System.out.println("ErrorCode: " + jsonResponse.getInt("ErrorCode"));
System.out.println("Result: " + jsonResponse.getBoolean("Result"));
System.out.println("Message: " + jsonResponse.getString("Message"));
} catch (IOException e) {
e.printStackTrace();
}
}
}<?php
$url = '{{Base Adres}}/api/paywall/payment/end3d';
$data = array(
"MerchantUniqueCode" => "aaa"
);
$options = array(
'http' => array(
'header' => "Content-type: application/json\r\n" .
"apikeypublic: %PUBLICKEY%\r\n" .
"apiclientpublic: %PUBLICCLIENT%\r\n",
'method' => 'POST',
'content' => json_encode($data),
),
);
$context = stream_context_create($options);
$result = file_get_contents($url, false, $context);
if ($result === FALSE) { /* Handle error */ }
// Decode
$response = json_decode($result);
// ErrorCode-Result-Message
echo "ErrorCode: " . $response->ErrorCode . "\n";
echo "Result: " . ($response->Result ? "true" : "false") . "\n";
echo "Message: " . $response->Message . "\n";
?>import requests
import json
url = '{{Base Adres}}/api/paywall/payment/end3d'
headers = {
'Content-Type': 'application/json',
'apikeypublic': '%PUBLICKEY%',
'apiclientpublic': '%PUBLICCLIENT%'
}
data = {
"MerchantUniqueCode": "aaa"
}
response = requests.post(url, headers=headers, data=json.dumps(data))
# Parsing the response
response_json = response.json()
print('ErrorCode:', response_json['ErrorCode'])
print('Result:', response_json['Result'])
print('Message:', response_json['Message'])require 'net/http'
require 'uri'
require 'json'
uri = URI.parse("{{Base Adres}}/api/paywall/payment/end3d")
request = Net::HTTP::Post.new(uri)
request.content_type = "application/json"
request["Apikeypublic"] = "%PUBLICKEY%"
request["Apiclientpublic"] = "%PUBLICCLIENT%"
request.body = JSON.dump({
"MerchantUniqueCode" => "aaa"
})
req_options = {
use_ssl: uri.scheme == "https",
}
response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
http.request(request)
end
response = JSON.parse(response.body)
puts "ErrorCode: #{response['ErrorCode']}"
puts "Result: #{response['Result']}"
puts "Message: #{response['Message']}"import * as https from 'https';
const data = JSON.stringify({
"MerchantUniqueCode": "aaa"
});
const options = {
hostname: '{{Base Adres}}',
port: 443,
path: '/api/paywall/payment/end3d',
method: 'POST',
headers: {
'Content-Type': 'application/json',
'apikeypublic': '%PUBLICKEY%',
'apiclientpublic': '%PUBLICCLIENT%'
}
};
const req = https.request(options, (res) => {
res.on('data', (d) => {
// Parse the response
const response = JSON.parse(d.toString());
console.log(`ErrorCode: ${response.ErrorCode}`);
console.log(`Result: ${response.Result}`);
console.log(`Message: ${response.Message}`);
});
});
req.on('error', (error) => {
console.error(error);
});
req.write(data);
req.end();curl --location --request POST '{{Base Adres}}/api/paywall/payment/end3d' \
--header 'Content-Type: application/json' \
--header 'apikeypublic: %PUBLICKEY%' \
--header 'apiclientpublic: %PUBLICCLIENT%' \
--data-raw '{
"MerchantUniqueCode": "aaa"
}'The response returned from the service:
ErrorCode
int
This indicates the result of the operation. It returns '0' if successful, otherwise '1'.
Result
string
It returns 'true' if the operation is successful, otherwise 'false'.
Message
string
It reports the result message of the operation.
Sample Code:
{
"ErrorCode": 0,
"Result": true,
"Message": "",
"Body": ""
}Last updated