rpay/prestashop-pokpay-payments-sdk

PokPay's Prestashop PHP SDK for Checkout REST APIs

1.1.0 2022-10-28 09:03 UTC

This package is not auto-updated.

Last update: 2025-08-13 22:22:43 UTC


README

PokPay's Prestashop PHP SDK for Checkout REST APIs

Installation & Usage

Requirements

PHP 7.0 and later. Should also work with PHP 8.0 but has not been tested.

Composer

$ composer require rpay/prestashop-pokpay-payments-sdk

Manual Installation

Download the files and include autoload.php:

<?php
require_once('/path/to/pok-payments-sdk/vendor/autoload.php');

Logging in with API key

Please follow the installation procedure and then run the following:

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

// Create the configuration for the API calls
// getDefaultConfiguration accepts a parameter to specify whether the production environment is used
// By default the staging environment is used
// The same configuration is later used for all the other API classes
$config = RPay\POK\PaymentsSdk\Configuration::getDefaultConfiguration(true);

$apiInstance = new RPay\POK\PaymentsSdk\Api\AuthApi(
    $config,
    new GuzzleHttp\Client(),
);

$keyId = 'PokPay Key Id';
$keySecret = 'PokPay Key Secret';

$payload = new \RPay\POK\PaymentsSdk\Model\LoginSdkPayload($keyId, $keySecret); // \RPay\POK\PaymentsSdk\Model\LoginSdkPayload

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

API Endpoints

All URIs are relative to https://api.pokpay.io in the production environment and https://api-staging.pokpay.io in the staging environment

Class Method HTTP request Description
AuthApi login POST /auth/sdk/login Login Sdk
MerchantsApi captureOrder POST /merchants/{merchantId}/sdk-orders/{sdkOrderId}/capture Capture an sdk order
MerchantsApi createOrder POST /merchants/{merchantId}/sdk-orders Create an sdk api order
SdkOrdersApi confirmOrder POST /sdk-orders/{sdkOrderId}/confirm Confirm order.
SdkOrdersApi confirmOrderAsGuest POST /sdk-orders/{sdkOrderId}/guest-confirm Confirm order with guest checkout
SdkOrdersApi getSdkOrderById GET /sdk-orders/{sdkOrderId} Retrieve an order

Models

Authorization

jwt

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

Tests

To run the tests, use:

composer install
vendor/bin/phpunit

Author

RPay Ltd

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