Skip to content
This repository was archived by the owner on Aug 10, 2023. It is now read-only.

Repository files navigation

OpenAPIClient-php

API definition for Reach's Drop-In API's. This version of the OpenAPI is intended for use with code generation tools.

Installation & Usage

Requirements

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

Composer

To install the bindings via Composer, add the following to composer.json:

{
  "repositories": [
    {
      "type": "vcs",
      "url": "https://github.com/withreach/reach-client-php.git"
    }
  ],
  "require": {
    "withreach/reach-client-php": "*@dev"
  }
}

Then run composer install

Manual Installation

Download the files and include autoload.php:

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

Getting Started

Please follow the installation procedure and then run the following:

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



// Configure HTTP basic authorization: basicAuth
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()
              ->setUsername('YOUR_USERNAME')
              ->setPassword('YOUR_PASSWORD');


$apiInstance = new OpenAPI\Client\Api\OrderApi(
    // 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(),
    $config
);
$order_id = cc7236aa-d11b-436c-a29c-d26cecadc847; // string | Order ID to be cancelled.

try {
    $apiInstance->cancelOrder($order_id);
} catch (Exception $e) {
    echo 'Exception when calling OrderApi->cancelOrder: ', $e->getMessage(), PHP_EOL;
}

API Endpoints

All URIs are relative to https://api.sandbox.withreach.com

Class Method HTTP request Description
OrderApi cancelOrder DELETE /v1/orders/{OrderId}/cancel Cancel an Order.
OrderApi captureOrder POST /v1/orders/{OrderId}/capture Capture an Order.
OrderApi createOrder POST /v1/orders Create a new order
OrderApi createRefund POST /v1/orders/{OrderId}/refunds Issue a refund against an order
OrderApi getRefundById GET /v1/orders/{OrderId}/refunds/{RefundId} Retrieve a refund by id for a given order id
OrderApi getRefundList GET /v1/orders/{OrderId}/refunds Retrieve a list of refunds for a given order id
OrderApi retrieveOrder GET /v1/orders/{OrderId} Retrieve an Order.
RatesApi getRate GET /v2.21/getRate Fetches information about a single rate offer. This will return information about the rate offer so long as it exists, even if it has expired.
RatesApi getRates GET /v2.21/getRates Fetches the list of current foreign exchange rate offers that are available to the merchant.
SessionApi cancelSession DELETE /v1/session/{SessionId}/cancel Cancel a non-final Session
SessionApi createSession POST /v1/session Create a new Session
SessionApi retrieveSession GET /v1/session/{SessionId} Retrieve a Session
SessionApi updateSession PUT /v1/session/{SessionId} Update a session.

Models

Authorization

basicAuth

  • Type: HTTP basic authentication

Tests

To run the tests, use:

composer install
vendor/bin/phpunit

Author

About this package

This PHP package is automatically generated by the OpenAPI Generator project:

  • API version: 1.0.0
  • Build package: org.openapitools.codegen.languages.PhpClientCodegen

About

GitHub repository to hold the swagger auto generated client code needed to interact with our Session and Order API’s for PHP

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages