### Manual Installation of PokPay PHP SDK Source: https://github.com/pokpay-ltd/php-sdk/blob/main/README.md Manually install the SDK by downloading the files and including the autoloader. This method is an alternative to Composer. ```php getSdkOrderById($sdkOrderId); print_r($result); } catch (Exception $e) { echo 'Exception when calling SdkOrdersApi->getSdkOrderById: ', $e->getMessage(), PHP_EOL; } ``` -------------------------------- ### Run PHP Unit Tests Source: https://github.com/pokpay-ltd/php-sdk/blob/main/README.md Install dependencies and run PHPUnit tests for the SDK. This is useful for verifying the SDK's functionality and your integration. ```bash composer install vendor/bin/phpunit ``` -------------------------------- ### PHP SDK Confirm Order as Guest Example Source: https://github.com/pokpay-ltd/php-sdk/blob/main/docs/Api/SdkOrdersApi.md This example demonstrates how to confirm an order for a guest checkout using the confirmOrderAsGuest method. It includes setting up the API client, defining order details, and handling the response or exceptions. ```php confirmOrderAsGuest($sdkOrderId, $body); print_r($result); } catch (Exception $e) { echo 'Exception when calling SdkOrdersApi->confirmOrderAsGuest: ', $e->getMessage(), PHP_EOL; } ``` -------------------------------- ### Create an SDK Order using MerchantsApi Source: https://github.com/pokpay-ltd/php-sdk/blob/main/docs/Api/MerchantsApi.md This example demonstrates how to create a new SDK order. You need to provide order details such as amount, currency, and products. The API client is initialized with merchant ID and configuration. ```php 100, 'currencyCode' => 'EUR', 'products' => [], ]; $body = new \RPay\POK\PaymentsSdk\Model\CreateSdkOrderPayload($sdkOrderInfo); // \RPay\POK\PaymentsSdk\Model\CreateSdkOrderPayload try { $result = $apiInstance->createOrder($body); print_r($result); } catch (Exception $e) { echo 'Exception when calling MerchantsApi->createOrder: ', $e->getMessage(), PHP_EOL; } ``` -------------------------------- ### Login SDK using AuthApi Source: https://github.com/pokpay-ltd/php-sdk/blob/main/docs/Api/AuthApi.md This snippet demonstrates how to log in to the SDK using the AuthApi. It shows how to set up the API configuration, instantiate the AuthApi client, and make the login request. Ensure the `vendor/autoload.php` is correctly required. ```php login($body); print_r($result); } catch (Exception $e) { echo 'Exception when calling AuthApi->login: ', $e->getMessage(), PHP_EOL; } ``` -------------------------------- ### createOrder() Source: https://github.com/pokpay-ltd/php-sdk/blob/main/docs/Api/MerchantsApi.md Create an SDK API order. This method allows for the creation of a new SDK order with specified details such as amount, currency, and products. ```APIDOC ## POST /merchants/{merchantId}/sdk-orders ### Description Create an sdk api order. This endpoint facilitates the creation of a new SDK order, allowing for the specification of order details in the request body. ### Method POST ### Endpoint /merchants/{merchantId}/sdk-orders ### Parameters #### Path Parameters - **merchantId** (string) - Required - Description not specified in source. #### Query Parameters None explicitly documented. #### Request Body - **body** (*\RPay\POK\PaymentsSdk\Model\CreateSdkOrderPayload*) - Optional - Description not specified in source. ### Request Example ```php 100, 'currencyCode' => 'EUR', 'products' => [], ]; $body = new \RPay\POK\PaymentsSdk\Model\CreateSdkOrderPayload($sdkOrderInfo); // \RPay\POK\PaymentsSdk\Model\CreateSdkOrderPayload try { $result = $apiInstance->createOrder($body); print_r($result); } catch (Exception $e) { echo 'Exception when calling MerchantsApi->createOrder: ', $e->getMessage(), PHP_EOL; } ?> ``` ### Response #### Success Response (200) - **SdkOrderResponse** (*\RPay\POK\PaymentsSdk\Model\SdkOrderResponse*) - Description not specified in source. #### Response Example ```json { "example": "response body" } ``` ### Authorization [jwt](../../README.md#jwt) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: `*/*` ``` -------------------------------- ### captureOrder() Source: https://github.com/pokpay-ltd/php-sdk/blob/main/docs/Api/MerchantsApi.md Capture an SDK order. This method allows you to capture a previously created SDK order, specifying the amount to be captured. ```APIDOC ## POST /merchants/{merchantId}/sdk-orders/{sdkOrderId}/capture ### Description Capture an sdk order. This endpoint allows for the capture of a specified SDK order using its ID and the amount to be captured. ### Method POST ### Endpoint /merchants/{merchantId}/sdk-orders/{sdkOrderId}/capture ### Parameters #### Path Parameters - **merchantId** (string) - Required - Description not specified in source. - **sdkOrderId** (string) - Required - Description not specified in source. #### Query Parameters None explicitly documented. #### Request Body None explicitly documented. The `amount` is passed as a parameter in the example, but not as a formal request body field. ### Request Example ```php captureOrder($sdkOrderId, $amount); print_r($result); } catch (Exception $e) { echo 'Exception when calling MerchantsApi->captureOrder: ', $e->getMessage(), PHP_EOL; } ?> ``` ### Response #### Success Response (200) - **SdkOrderResponse** (*\RPay\POK\PaymentsSdk\Model\SdkOrderResponse*) - Description not specified in source. #### Response Example ```json { "example": "response body" } ``` ### Authorization [jwt](../../README.md#jwt) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: `*/*` ``` -------------------------------- ### Authenticate with PokPay API using API Key Source: https://github.com/pokpay-ltd/php-sdk/blob/main/README.md This snippet demonstrates how to authenticate with the PokPay API using your API key. It initializes the configuration, creates an AuthApi instance, and calls the login method. Ensure you replace 'PokPay Key Id' and 'PokPay Key Secret' with your actual credentials. ```php login($payload); print_r($result); } catch (Exception $e) { echo 'Exception when calling AuthApi->login: ', $e->getMessage(), PHP_EOL; } ``` -------------------------------- ### Confirm SDK Order Source: https://github.com/pokpay-ltd/php-sdk/blob/main/docs/Api/SdkOrdersApi.md Use this method to confirm an existing SDK order. Ensure the SDK client and configuration are properly set up. The order ID and a confirmation payload are required. ```php confirmOrder($sdkOrderId, $body); print_r($result); } catch (Exception $e) { echo 'Exception when calling SdkOrdersApi->confirmOrder: ', $e->getMessage(), PHP_EOL; } ``` -------------------------------- ### MerchantsApi->createOrder Source: https://github.com/pokpay-ltd/php-sdk/blob/main/README.md Creates a new SDK order for a merchant. This endpoint is used to initiate a payment transaction. ```APIDOC ## POST /merchants/{merchantId}/sdk-orders ### Description Create an sdk api order ### Method POST ### Endpoint /merchants/{merchantId}/sdk-orders ### Parameters #### Path Parameters - **merchantId** (string) - Required - The ID of the merchant. #### Request Body - **payload** (CreateSdkOrderPayload) - Required - The payload containing details for creating the order. ### Response #### Success Response (200) - **example** (object) - A response object containing details of the created SDK order. #### Response Example ```json { "example": "response body" } ``` ``` -------------------------------- ### login() Source: https://github.com/pokpay-ltd/php-sdk/blob/main/docs/Api/AuthApi.md Logs in the SDK client to the POK Payments API. This method is used to authenticate your application for making further API calls. ```APIDOC ## POST /auth/sdk/login ### Description Logs in the SDK client to the POK Payments API. This method is used to authenticate your application for making further API calls. ### Method POST ### Endpoint /auth/sdk/login ### Parameters #### Request Body - **body** (RPay\POK\PaymentsSdk\Model\LoginSdkPayload) - Optional - ### Response #### Success Response (200) - **LoginResponse** (RPay\POK\PaymentsSdk\Model\LoginResponse) - ### Authorization No authorization required ``` -------------------------------- ### confirmOrder() Source: https://github.com/pokpay-ltd/php-sdk/blob/main/docs/Api/SdkOrdersApi.md Confirms an existing SDK order. This operation allows for the finalization of an order, potentially with additional payload details. ```APIDOC ## POST /sdk-orders/{sdkOrderId}/confirm ### Description Confirm order. ### Method POST ### Endpoint /sdk-orders/{sdkOrderId}/confirm ### Parameters #### Path Parameters - **sdkOrderId** (string) - Required - The ID of the SDK order to confirm. #### Request Body - **body** (\RPay\POK\PaymentsSdk\Model\ConfirmSdkOrderPayload) - Optional - The payload containing details for confirming the order. ### Response #### Success Response (200) - **SdkOrderResponse** (\RPay\POK\PaymentsSdk\Model\SdkOrderResponse) - Description of the confirmed SDK order. ### Authorization [jwt](../../README.md#jwt) ``` -------------------------------- ### Capture an SDK Order using MerchantsApi Source: https://github.com/pokpay-ltd/php-sdk/blob/main/docs/Api/MerchantsApi.md Use this snippet to capture a previously created SDK order. Ensure you have your merchant ID and the SDK order ID. The amount to capture is also a required parameter. ```php captureOrder($sdkOrderId, $amount); print_r($result); } catch (Exception $e) { echo 'Exception when calling MerchantsApi->captureOrder: ', $e->getMessage(), PHP_EOL; } ``` -------------------------------- ### SdkOrdersApi->confirmOrderAsGuest Source: https://github.com/pokpay-ltd/php-sdk/blob/main/README.md Confirms an SDK order for a guest user. This allows for order confirmation without requiring user login. ```APIDOC ## POST /sdk-orders/{sdkOrderId}/guest-confirm ### Description Confirm order with guest checkout ### Method POST ### Endpoint /sdk-orders/{sdkOrderId}/guest-confirm ### Parameters #### Path Parameters - **sdkOrderId** (string) - Required - The ID of the SDK order to confirm. #### Request Body - **payload** (ConfirmSdkOrderGuestPayload) - Required - The payload for confirming the order as a guest. ### Response #### Success Response (200) - **example** (object) - A response object indicating the guest order has been confirmed. #### Response Example ```json { "example": "response body" } ``` ``` -------------------------------- ### MerchantsApi->captureOrder Source: https://github.com/pokpay-ltd/php-sdk/blob/main/README.md Captures an existing SDK order. This action finalizes the payment for a previously created order. ```APIDOC ## POST /merchants/{merchantId}/sdk-orders/{sdkOrderId}/capture ### Description Capture an sdk order ### Method POST ### Endpoint /merchants/{merchantId}/sdk-orders/{sdkOrderId}/capture ### Parameters #### Path Parameters - **merchantId** (string) - Required - The ID of the merchant. - **sdkOrderId** (string) - Required - The ID of the SDK order to capture. ### Response #### Success Response (200) - **example** (object) - A success response indicating the order was captured. #### Response Example ```json { "example": "response body" } ``` ``` -------------------------------- ### AuthApi->login Source: https://github.com/pokpay-ltd/php-sdk/blob/main/README.md Logs in to the PokPay API using provided API key credentials. This is the first step to authenticate your application for making further API calls. ```APIDOC ## POST /auth/sdk/login ### Description Login Sdk ### Method POST ### Endpoint /auth/sdk/login ### Parameters #### Request Body - **payload** (LoginSdkPayload) - Required - The payload containing the key ID and key secret for authentication. ### Request Example ```json { "keyId": "PokPay Key Id", "keySecret": "PokPay Key Secret" } ``` ### Response #### Success Response (200) - **result** (LoginResponse) - The response object upon successful login. #### Response Example ```json { "example": "response body" } ``` ``` -------------------------------- ### getSdkOrderById() Source: https://github.com/pokpay-ltd/php-sdk/blob/main/docs/Api/SdkOrdersApi.md Retrieves the details of a specific SDK order using its unique identifier. ```APIDOC ## GET /sdk-orders/{sdkOrderId} ### Description Retrieve an order. ### Method GET ### Endpoint /sdk-orders/{sdkOrderId} ### Parameters #### Path Parameters - **sdkOrderId** (string) - Required - The unique identifier of the SDK order to retrieve. ### Response #### Success Response (200) - **SdkOrderResponse** (\RPay\POK\PaymentsSdk\Model\SdkOrderResponse) - The details of the requested SDK order. ### Authorization [jwt](../../README.md#jwt) ``` -------------------------------- ### SdkOrdersApi->getSdkOrderById Source: https://github.com/pokpay-ltd/php-sdk/blob/main/README.md Retrieves the details of a specific SDK order by its ID. ```APIDOC ## GET /sdk-orders/{sdkOrderId} ### Description Retrieve an order ### Method GET ### Endpoint /sdk-orders/{sdkOrderId} ### Parameters #### Path Parameters - **sdkOrderId** (string) - Required - The ID of the SDK order to retrieve. ### Response #### Success Response (200) - **example** (object) - An object containing the details of the requested SDK order. #### Response Example ```json { "example": "response body" } ``` ``` -------------------------------- ### SdkOrdersApi->confirmOrder Source: https://github.com/pokpay-ltd/php-sdk/blob/main/README.md Confirms an SDK order. This is typically called after the user has completed the payment process. ```APIDOC ## POST /sdk-orders/{sdkOrderId}/confirm ### Description Confirm order. ### Method POST ### Endpoint /sdk-orders/{sdkOrderId}/confirm ### Parameters #### Path Parameters - **sdkOrderId** (string) - Required - The ID of the SDK order to confirm. #### Request Body - **payload** (ConfirmSdkOrderPayload) - Required - The payload for confirming the order. ### Response #### Success Response (200) - **example** (object) - A response object indicating the order has been confirmed. #### Response Example ```json { "example": "response body" } ``` ``` -------------------------------- ### confirmOrderAsGuest() Source: https://github.com/pokpay-ltd/php-sdk/blob/main/docs/Api/SdkOrdersApi.md Confirms an order using guest checkout. This method allows for the confirmation of an order without requiring user authentication, suitable for guest checkouts. ```APIDOC ## confirmOrderAsGuest() ### Description Confirms an order using guest checkout. This method allows for the confirmation of an order without requiring user authentication, suitable for guest checkouts. ### Method POST ### Endpoint /sdk/orders/guest/confirm/{sdkOrderId} ### Parameters #### Path Parameters - **sdkOrderId** (string) - Required - The unique identifier for the SDK order. #### Request Body - **body** (ConfirmSdkOrderGuestPayload) - Optional - The payload containing details for confirming the guest order. ### Response #### Success Response (200) - **SdkOrderResponse** (object) - Details of the confirmed SDK order. ### Authorization No authorization required ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.