# OpenAPIClient-php

Documentation RelayPay API v2.0.0


## Installation & Usage

### Requirements

PHP 7.4 and later.
Should also work with PHP 8.0.

### Composer

To install the bindings via [Composer](https://getcomposer.org/), add the following to `composer.json`:

```json
{
  "repositories": [
    {
      "type": "vcs",
      "url": "https://github.com/relaypay-public/merchant-php-client.git"
    }
  ],
  "require": {
    "relaypay-public/merchant-php-client": "*@dev"
  }
}
```

Then run `composer install`

### Manual Installation

Download the files and include `autoload.php`:

```php
<?php
require_once('/path/to/OpenAPIClient-php/vendor/autoload.php');
```

## Getting Started

Please follow the [installation procedure](#installation--usage) and then run the following:

```php
<?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;
}

```

## API Endpoints

All URIs are relative to *https://api.sandbox.relaypay.io/api*

Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*ECommerceApi* | [**getMerchantTransaction**](docs/Api/ECommerceApi.md#getmerchanttransaction) | **GET** /e-commerce/transaction | Get merchant transaction by a specified orderId
*ECommerceApi* | [**getMerchantTxs**](docs/Api/ECommerceApi.md#getmerchanttxs) | **GET** /e-commerce/transaction/history | Get all bill payment transactions for the merchant
*ECommerceApi* | [**getMerchantWebhookLogs**](docs/Api/ECommerceApi.md#getmerchantwebhooklogs) | **GET** /e-commerce/transaction/webhooks | Get merchant webhook logs in date range
*ECommerceApi* | [**setEcommerceRequest**](docs/Api/ECommerceApi.md#setecommercerequest) | **POST** /e-commerce/request | Ecommerce provider sends a transaction request.
*ECommerceApi* | [**setEcommerceSalesforce**](docs/Api/ECommerceApi.md#setecommercesalesforce) | **POST** /e-commerce/salesforce | Ecommerce provider pushes a Salesforce specific data for authorisation.
*MerchantSignatureTestingApi* | [**generateSign**](docs/Api/MerchantSignatureTestingApi.md#generatesign) | **POST** /merchant/generate-sign | Testing header signature generation.
*MerchantSignatureTestingApi* | [**verifyEcommerceApiKeys**](docs/Api/MerchantSignatureTestingApi.md#verifyecommerceapikeys) | **POST** /e-commerce/verify-signature | Ecommerce provider verifies signed request.

## Models

- [EcommerceIncomingRequest](docs/Model/EcommerceIncomingRequest.md)
- [EcommerceMerchantTransaction](docs/Model/EcommerceMerchantTransaction.md)
- [EcommerceResponse](docs/Model/EcommerceResponse.md)
- [MerchantSalesforcePlugin](docs/Model/MerchantSalesforcePlugin.md)
- [MerchantWebhookLog](docs/Model/MerchantWebhookLog.md)
- [PageEcommerceMerchantTransaction](docs/Model/PageEcommerceMerchantTransaction.md)
- [PageMerchantWebhookLog](docs/Model/PageMerchantWebhookLog.md)
- [Pageable](docs/Model/Pageable.md)
- [SortObject](docs/Model/SortObject.md)

## Authorization

Authentication schemes defined for the API:
### authorization

- **Type**: API key
- **API key parameter name**: Authorization
- **Location**: HTTP header


## Tests

To run the tests, use:

```bash
composer install
vendor/bin/phpunit
```

## Author

danny@relaypay.io

## About this package

This PHP package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:

- API version: `2.0.0`
    - Generator version: `7.10.0`
- Build package: `org.openapitools.codegen.languages.PhpClientCodegen`
