Payversa API Integration Documentation

Payversa API Integration Documentation

Gateway

gatewayCallbackPost

Callback operation

The server will post a callback to the partner's callback URL, upon a successful/failed transaction. The server will post up to three times unless the callback responds "ACK" without any other text. # Signature The signature is calculated by using the SHA256 algorithm with the following input: amount+currency+type+txStatus+partnerTxId+merchantTxId+accessId+accessSecret Note: Remove the thousands separator and the decimal point in the amount before generating signature Example: <br /> amount: 100.00 <br /> currency: MYR <br /> type: PAYIN <br /> txStatus: SUCCESS <br /> partnerTxId: 123 <br /> merchantTxId: abc456 <br /> accessId: abc123 <br /> accessSecret: secret123 <br /> signature: <br /> SHA256(10000MYRPAYINSUCCESS123abc456abc123secret123) <br /> Please make sure the signature is correct before proceding.


/gateway/callback

Usage and SDK Samples

curl -X POST\
-H "Content-Type: application/json"\
"//gateway/callback"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.GatewayApi;

import java.io.File;
import java.util.*;

public class GatewayApiExample {

    public static void main(String[] args) {
        
        GatewayApi apiInstance = new GatewayApi();
        Gateway_callback_body body = ; // Gateway_callback_body | 
        try {
            apiInstance.gatewayCallbackPost(body);
        } catch (ApiException e) {
            System.err.println("Exception when calling GatewayApi#gatewayCallbackPost");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.GatewayApi;

public class GatewayApiExample {

    public static void main(String[] args) {
        GatewayApi apiInstance = new GatewayApi();
        Gateway_callback_body body = ; // Gateway_callback_body | 
        try {
            apiInstance.gatewayCallbackPost(body);
        } catch (ApiException e) {
            System.err.println("Exception when calling GatewayApi#gatewayCallbackPost");
            e.printStackTrace();
        }
    }
}
Gateway_callback_body *body = ; //  (optional)

GatewayApi *apiInstance = [[GatewayApi alloc] init];

// Callback operation
[apiInstance gatewayCallbackPostWith:body
              completionHandler: ^(NSError* error) {
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var PayversaApiIntegrationDocumentation = require('payversa_api_integration_documentation');

var api = new PayversaApiIntegrationDocumentation.GatewayApi()
var opts = { 
  'body':  // {{Gateway_callback_body}} 
};
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
api.gatewayCallbackPost(opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class gatewayCallbackPostExample
    {
        public void main()
        {

            var apiInstance = new GatewayApi();
            var body = new Gateway_callback_body(); // Gateway_callback_body |  (optional) 

            try
            {
                // Callback operation
                apiInstance.gatewayCallbackPost(body);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling GatewayApi.gatewayCallbackPost: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\ApiGatewayApi();
$body = ; // Gateway_callback_body | 

try {
    $api_instance->gatewayCallbackPost($body);
} catch (Exception $e) {
    echo 'Exception when calling GatewayApi->gatewayCallbackPost: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::GatewayApi;

my $api_instance = WWW::SwaggerClient::GatewayApi->new();
my $body = WWW::SwaggerClient::Object::Gateway_callback_body->new(); # Gateway_callback_body | 

eval { 
    $api_instance->gatewayCallbackPost(body => $body);
};
if ($@) {
    warn "Exception when calling GatewayApi->gatewayCallbackPost: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.GatewayApi()
body =  # Gateway_callback_body |  (optional)

try: 
    # Callback operation
    api_instance.gateway_callback_post(body=body)
except ApiException as e:
    print("Exception when calling GatewayApi->gatewayCallbackPost: %s\n" % e)

Parameters

Body parameters
Name Description
body

Responses

Status: 200 - ACK


gatewayEntryPost

Entry to payment gateway

Entry point to send pay-in request # Signature The signature is calculated by using the SHA256 algorithm with the following input: amount+currency+partnerTxId+accessId+accessSecret Note: Remove the thousands separator and the decimal point in the amount before generating signature Example: <br /> amount: 100.00 <br /> currency: MYR <br /> partnerTxId: 123 <br /> accessId: abc123 <br /> accessSecret: secret123 <br /> signature: <br /> SHA256(amount+currency+partnerTxId+accessId+accessSecret) <br /> SHA256(10000MYR123abc123secret123) <br /> 357a6ef7001de9dca3c9f1ff4fb789cd47d9819734529b30abd97b666c688750


/gateway/entry

Usage and SDK Samples

curl -X POST\
-H "Accept: application/json"\
-H "Content-Type: application/json"\
"//gateway/entry"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.GatewayApi;

import java.io.File;
import java.util.*;

public class GatewayApiExample {

    public static void main(String[] args) {
        
        GatewayApi apiInstance = new GatewayApi();
        Gateway_entry_body body = ; // Gateway_entry_body | 
        try {
            inline_response_200 result = apiInstance.gatewayEntryPost(body);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling GatewayApi#gatewayEntryPost");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.GatewayApi;

public class GatewayApiExample {

    public static void main(String[] args) {
        GatewayApi apiInstance = new GatewayApi();
        Gateway_entry_body body = ; // Gateway_entry_body | 
        try {
            inline_response_200 result = apiInstance.gatewayEntryPost(body);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling GatewayApi#gatewayEntryPost");
            e.printStackTrace();
        }
    }
}
Gateway_entry_body *body = ; //  (optional)

GatewayApi *apiInstance = [[GatewayApi alloc] init];

// Entry to payment gateway
[apiInstance gatewayEntryPostWith:body
              completionHandler: ^(inline_response_200 output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var PayversaApiIntegrationDocumentation = require('payversa_api_integration_documentation');

var api = new PayversaApiIntegrationDocumentation.GatewayApi()
var opts = { 
  'body':  // {{Gateway_entry_body}} 
};
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.gatewayEntryPost(opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class gatewayEntryPostExample
    {
        public void main()
        {

            var apiInstance = new GatewayApi();
            var body = new Gateway_entry_body(); // Gateway_entry_body |  (optional) 

            try
            {
                // Entry to payment gateway
                inline_response_200 result = apiInstance.gatewayEntryPost(body);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling GatewayApi.gatewayEntryPost: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\ApiGatewayApi();
$body = ; // Gateway_entry_body | 

try {
    $result = $api_instance->gatewayEntryPost($body);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling GatewayApi->gatewayEntryPost: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::GatewayApi;

my $api_instance = WWW::SwaggerClient::GatewayApi->new();
my $body = WWW::SwaggerClient::Object::Gateway_entry_body->new(); # Gateway_entry_body | 

eval { 
    my $result = $api_instance->gatewayEntryPost(body => $body);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling GatewayApi->gatewayEntryPost: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.GatewayApi()
body =  # Gateway_entry_body |  (optional)

try: 
    # Entry to payment gateway
    api_response = api_instance.gateway_entry_post(body=body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling GatewayApi->gatewayEntryPost: %s\n" % e)

Parameters

Body parameters
Name Description
body

Responses

Status: 200 - Success create payment entry

Status: 400 - Invalid Signature


gatewayRedirectPost

Redirect operation

Redirect the user after they have completed/failed payment # Signature The signature is calculated by using the SHA256 algorithm with the following input: amount+currency+type+txStatus+partnerTxId+merchantTxId+accessId+accessSecret Note: Remove the thousands separator and the decimal point in the amount before generating signature Example: <br /> amount: 100.00 <br /> currency: MYR <br /> type: PAYIN <br /> txStatus: SUCCESS <br /> partnerTxId: 123 <br /> merchantTxId: abc456 <br /> accessId: abc123 <br /> accessSecret: secret123 <br /> signature: <br /> SHA256(10000MYRPAYINSUCCESS123abc456abc123secret123) <br /> Please make sure the signature is correct before proceding.


/gateway/redirect

Usage and SDK Samples

curl -X POST\
-H "Content-Type: application/json"\
"//gateway/redirect"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.GatewayApi;

import java.io.File;
import java.util.*;

public class GatewayApiExample {

    public static void main(String[] args) {
        
        GatewayApi apiInstance = new GatewayApi();
        Gateway_redirect_body body = ; // Gateway_redirect_body | 
        try {
            apiInstance.gatewayRedirectPost(body);
        } catch (ApiException e) {
            System.err.println("Exception when calling GatewayApi#gatewayRedirectPost");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.GatewayApi;

public class GatewayApiExample {

    public static void main(String[] args) {
        GatewayApi apiInstance = new GatewayApi();
        Gateway_redirect_body body = ; // Gateway_redirect_body | 
        try {
            apiInstance.gatewayRedirectPost(body);
        } catch (ApiException e) {
            System.err.println("Exception when calling GatewayApi#gatewayRedirectPost");
            e.printStackTrace();
        }
    }
}
Gateway_redirect_body *body = ; //  (optional)

GatewayApi *apiInstance = [[GatewayApi alloc] init];

// Redirect operation
[apiInstance gatewayRedirectPostWith:body
              completionHandler: ^(NSError* error) {
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var PayversaApiIntegrationDocumentation = require('payversa_api_integration_documentation');

var api = new PayversaApiIntegrationDocumentation.GatewayApi()
var opts = { 
  'body':  // {{Gateway_redirect_body}} 
};
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
api.gatewayRedirectPost(opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class gatewayRedirectPostExample
    {
        public void main()
        {

            var apiInstance = new GatewayApi();
            var body = new Gateway_redirect_body(); // Gateway_redirect_body |  (optional) 

            try
            {
                // Redirect operation
                apiInstance.gatewayRedirectPost(body);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling GatewayApi.gatewayRedirectPost: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\ApiGatewayApi();
$body = ; // Gateway_redirect_body | 

try {
    $api_instance->gatewayRedirectPost($body);
} catch (Exception $e) {
    echo 'Exception when calling GatewayApi->gatewayRedirectPost: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::GatewayApi;

my $api_instance = WWW::SwaggerClient::GatewayApi->new();
my $body = WWW::SwaggerClient::Object::Gateway_redirect_body->new(); # Gateway_redirect_body | 

eval { 
    $api_instance->gatewayRedirectPost(body => $body);
};
if ($@) {
    warn "Exception when calling GatewayApi->gatewayRedirectPost: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.GatewayApi()
body =  # Gateway_redirect_body |  (optional)

try: 
    # Redirect operation
    api_instance.gateway_redirect_post(body=body)
except ApiException as e:
    print("Exception when calling GatewayApi->gatewayRedirectPost: %s\n" % e)

Parameters

Body parameters
Name Description
body

Responses

Status: 301 - Success Payment Redirect