Skip to content

Latest commit

 

History

History
327 lines (229 loc) · 10.1 KB

ECommerceApi.md

File metadata and controls

327 lines (229 loc) · 10.1 KB

RelayPay\ECommerceApi

All URIs are relative to https://api.sandbox.relaypay.io/api, except if the operation defines another base path.

Method HTTP request Description
getMerchantTransaction() GET /e-commerce/transaction Get merchant transaction by a specified orderId
getMerchantTxs() GET /e-commerce/transaction/history Get all bill payment transactions for the merchant
getMerchantWebhookLogs() GET /e-commerce/transaction/webhooks Get merchant webhook logs in date range
setEcommerceRequest() POST /e-commerce/request Ecommerce provider sends a transaction request.
setEcommerceSalesforce() POST /e-commerce/salesforce Ecommerce provider pushes a Salesforce specific data for authorisation.

getMerchantTransaction()

getMerchantTransaction($x_api_key, $x_merchant_id, $order_id): \RelayPay\Model\EcommerceMerchantTransaction

Get merchant transaction by a specified orderId

Use this endpoint to retrieve merchant transaction by orderId

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');



$apiInstance = new RelayPay\Api\ECommerceApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client()
);
$x_api_key = 'x_api_key_example'; // string
$x_merchant_id = 'x_merchant_id_example'; // string
$order_id = 'order_id_example'; // string

try {
    $result = $apiInstance->getMerchantTransaction($x_api_key, $x_merchant_id, $order_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ECommerceApi->getMerchantTransaction: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
x_api_key string
x_merchant_id string
order_id string

Return type

\RelayPay\Model\EcommerceMerchantTransaction

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getMerchantTxs()

getMerchantTxs($x_api_key, $x_merchant_id, $page, $size, $sort): \RelayPay\Model\PageEcommerceMerchantTransaction

Get all bill payment transactions for the merchant

Use this endpoint to retrieve transaction history

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');



$apiInstance = new RelayPay\Api\ECommerceApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client()
);
$x_api_key = 'x_api_key_example'; // string
$x_merchant_id = 'x_merchant_id_example'; // string
$page = '0'; // string
$size = '20'; // string
$sort = 'created:desc'; // string

try {
    $result = $apiInstance->getMerchantTxs($x_api_key, $x_merchant_id, $page, $size, $sort);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ECommerceApi->getMerchantTxs: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
x_api_key string
x_merchant_id string
page string [optional] [default to '0']
size string [optional] [default to '20']
sort string [optional] [default to 'created:desc']

Return type

\RelayPay\Model\PageEcommerceMerchantTransaction

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: */*

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getMerchantWebhookLogs()

getMerchantWebhookLogs($x_api_key, $x_merchant_id, $start_date, $end_date, $page, $size, $sort): \RelayPay\Model\PageMerchantWebhookLog

Get merchant webhook logs in date range

Use this endpoint to retrieve merchant webhook logs in date range for merchant

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');



$apiInstance = new RelayPay\Api\ECommerceApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client()
);
$x_api_key = 'x_api_key_example'; // string
$x_merchant_id = 'x_merchant_id_example'; // string
$start_date = new \DateTime('2013-10-20T19:20:30+01:00'); // \DateTime
$end_date = new \DateTime('2013-10-20T19:20:30+01:00'); // \DateTime
$page = '0'; // string
$size = '20'; // string
$sort = 'created:desc'; // string

try {
    $result = $apiInstance->getMerchantWebhookLogs($x_api_key, $x_merchant_id, $start_date, $end_date, $page, $size, $sort);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ECommerceApi->getMerchantWebhookLogs: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
x_api_key string
x_merchant_id string
start_date \DateTime
end_date \DateTime
page string [optional] [default to '0']
size string [optional] [default to '20']
sort string [optional] [default to 'created:desc']

Return type

\RelayPay\Model\PageMerchantWebhookLog

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: */*

[Back to top] [Back to API list] [Back to Model list] [Back to README]

setEcommerceRequest()

setEcommerceRequest($x_api_key, $x_merchant_id, $x_api_signature, $ecommerce_incoming_request): \RelayPay\Model\EcommerceResponse

Ecommerce provider sends a transaction request.

Use this endpoint to create a payment request. The service returns a unique url to be used for redirection.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');



$apiInstance = new RelayPay\Api\ECommerceApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client()
);
$x_api_key = 'x_api_key_example'; // string
$x_merchant_id = 'x_merchant_id_example'; // string
$x_api_signature = 'x_api_signature_example'; // string
$ecommerce_incoming_request = new \RelayPay\Model\EcommerceIncomingRequest(); // \RelayPay\Model\EcommerceIncomingRequest

try {
    $result = $apiInstance->setEcommerceRequest($x_api_key, $x_merchant_id, $x_api_signature, $ecommerce_incoming_request);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ECommerceApi->setEcommerceRequest: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
x_api_key string
x_merchant_id string
x_api_signature string
ecommerce_incoming_request \RelayPay\Model\EcommerceIncomingRequest

Return type

\RelayPay\Model\EcommerceResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: */*

[Back to top] [Back to API list] [Back to Model list] [Back to README]

setEcommerceSalesforce()

setEcommerceSalesforce($x_api_key, $x_merchant_id, $x_api_signature, $merchant_salesforce_plugin)

Ecommerce provider pushes a Salesforce specific data for authorisation.

Use this endpoint to update Salesforce private key

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');



$apiInstance = new RelayPay\Api\ECommerceApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client()
);
$x_api_key = 'x_api_key_example'; // string
$x_merchant_id = 'x_merchant_id_example'; // string
$x_api_signature = 'x_api_signature_example'; // string
$merchant_salesforce_plugin = new \RelayPay\Model\MerchantSalesforcePlugin(); // \RelayPay\Model\MerchantSalesforcePlugin

try {
    $apiInstance->setEcommerceSalesforce($x_api_key, $x_merchant_id, $x_api_signature, $merchant_salesforce_plugin);
} catch (Exception $e) {
    echo 'Exception when calling ECommerceApi->setEcommerceSalesforce: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
x_api_key string
x_merchant_id string
x_api_signature string
merchant_salesforce_plugin \RelayPay\Model\MerchantSalesforcePlugin

Return type

void (empty response body)

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]