zerogrey/axerve-php

1.0.2 2020-10-15 04:40 UTC

This package is not auto-updated.

Last update: 2024-05-09 21:58:43 UTC


README

Axerve API client made for PHP

This PHP package is automatically generated by the Axerve Codegen project:

  • API version: 1.0.0
  • Build package: io.axerve.codegen.v3.generators.php.PhpClientCodegen

Requirements

PHP 5.5 and later

Installation & Usage

Composer

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

{
  "repositories": [
    {
      "type": "git",
      "url": "https://github.com/GIT_USER_ID/GIT_REPO_ID.git"
    }
  ],
  "require": {
    "GIT_USER_ID/GIT_REPO_ID": "*@dev"
  }
}

Then run composer install

Manual Installation

Download the files and include autoload.php:

    require_once('/path/to/AxerveClient-php/vendor/autoload.php');

Tests

To run the unit tests:

composer install
./vendor/bin/phpunit

Getting Started

Please follow the installation procedure and then run the following:

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

// Configure API key authorization: ApiKeyAuth
$config = Axerve\Client\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Axerve\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer');

$apiInstance = new Axerve\Client\Api\PaymentApi(
    // 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
);
$body = new \Axerve\Client\Model\Body(); // \Axerve\Client\Model\Body | 

try {
    $result = $apiInstance->apiV1CheckCreditCardPost($body);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling PaymentApi->apiV1CheckCreditCardPost: ', $e->getMessage(), PHP_EOL;
}

$apiInstance = new Axerve\Client\Api\PaymentApi(
    // 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()
);
$body = new \Axerve\Client\Model\CancelPaymentRequestModel(); // \Axerve\Client\Model\Body6 | 

try {
    $apiInstance->apiV1PaymentCancelPost($body);
} catch (Exception $e) {
    echo 'Exception when calling PaymentApi->apiV1PaymentCancelPost: ', $e->getMessage(), PHP_EOL;
}

$apiInstance = new Axerve\Client\Api\PaymentApi(
    // 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()
);
$body = new \Axerve\Client\Model\Body4(); // \Axerve\Client\Model\Body4 | 

try {
    $apiInstance->apiV1PaymentCapturePost($body);
} catch (Exception $e) {
    echo 'Exception when calling PaymentApi->apiV1PaymentCapturePost: ', $e->getMessage(), PHP_EOL;
}

$apiInstance = new Axerve\Client\Api\PaymentApi(
    // 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()
);
$body = new \Axerve\Client\Model\CreatePaymentModel(); // \Axerve\Client\Model\Body1 | 

try {
    $result = $apiInstance->create($body);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling PaymentApi->apiV1PaymentCreatePost: ', $e->getMessage(), PHP_EOL;
}

$apiInstance = new Axerve\Client\Api\PaymentApi(
    // 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()
);
$payment_id = "payment_id_example"; // string | 
$language_id = "language_id_example"; // string | 
$payment_token = "payment_token_example"; // string | 

try {
    $result = $apiInstance->apiV1PaymentMethodsPaymentIdLanguageIdGet($payment_id, $language_id, $payment_token);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling PaymentApi->apiV1PaymentMethodsPaymentIdLanguageIdGet: ', $e->getMessage(), PHP_EOL;
}

$apiInstance = new Axerve\Client\Api\PaymentApi(
    // 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()
);
$body = new \Axerve\Client\Model\Body5(); // \Axerve\Client\Model\Body5 | 

try {
    $apiInstance->apiV1PaymentRefundPost($body);
} catch (Exception $e) {
    echo 'Exception when calling PaymentApi->apiV1PaymentRefundPost: ', $e->getMessage(), PHP_EOL;
}

$apiInstance = new Axerve\Client\Api\PaymentApi(
    // 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()
);
$body = new \Axerve\Client\Model\SubmitPaymentModel(); // \Axerve\Client\Model\Body3 | 
$payment_token = "payment_token_example"; // string | 

try {
    $apiInstance->submit($body, $payment_token);
} catch (Exception $e) {
    echo 'Exception when calling PaymentApi->apiV1PaymentSubmitPost: ', $e->getMessage(), PHP_EOL;
}

$apiInstance = new Axerve\Client\Api\PaymentApi(
    // 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()
);
$body = new \Axerve\Client\Model\Body2(); // \Axerve\Client\Model\Body2 | 

try {
    $result = $apiInstance->apiV1PaymentUpdatePost($body);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling PaymentApi->apiV1PaymentUpdatePost: ', $e->getMessage(), PHP_EOL;
}

// Configure API key authorization: ApiKeyAuth
$config = Axerve\Client\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Axerve\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer');

$apiInstance = new Axerve\Client\Api\PaymentApi(
    // 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
);
$shop_login = "shop_login_example"; // string | 

try {
    $result = $apiInstance->apiV1ShopMethodsShopLoginGet($shop_login);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling PaymentApi->apiV1ShopMethodsShopLoginGet: ', $e->getMessage(), PHP_EOL;
}
?>

Documentation for API Endpoints

All URIs are relative to https://sandbox.gestpay.net

Class Method HTTP request Description
PaymentApi apiV1CheckCreditCardPost POST /api/v1/check/creditCard/
PaymentApi apiV1PaymentCancelPost POST /api/v1/payment/cancel/
PaymentApi apiV1PaymentCapturePost POST /api/v1/payment/capture/
PaymentApi apiV1PaymentCreatePost POST /api/v1/payment/create
PaymentApi apiV1PaymentMethodsPaymentIdLanguageIdGet GET /api/v1/payment/methods/{paymentId}/{languageId}
PaymentApi apiV1PaymentRefundPost POST /api/v1/payment/refund/
PaymentApi apiV1PaymentSubmitPost POST /api/v1/payment/submit
PaymentApi apiV1PaymentUpdatePost POST /api/v1/payment/update
PaymentApi apiV1ShopMethodsShopLoginGet GET /api/v1/shop/methods/{shopLogin}

Documentation For Models

Documentation For Authorization

ApiKeyAuth

  • Type: API key
  • API key parameter name: Authorization
  • Location: HTTP header

Author