### Install Verotel FlexPay PHP Client via Composer Source: https://github.com/verotel/flexpay-php-client/blob/master/README.md Instructions for adding the Verotel FlexPay PHP client library to a project using Composer, the PHP dependency manager. ```bash composer require verotel/flexpay-php-client ``` -------------------------------- ### Include Composer Autoloader in PHP Source: https://github.com/verotel/flexpay-php-client/blob/master/README.md Demonstrates how to include Composer's autoloader in a PHP project, essential for using classes from installed dependencies like the FlexPay client. ```php require_once 'vendor/autoload.php'; ``` -------------------------------- ### Validate Verotel FlexPay Postback Signature Source: https://github.com/verotel/flexpay-php-client/blob/master/README.md Provides an example of validating incoming postback parameters from Verotel FlexPay using the client's validate_signature method. It checks the integrity of the data and handles invalid signatures by sending an HTTP 500 error. ```php if (!$flexpayClient->validate_signature($_GET)){ http_response_code(500); echo "ERROR - Invalid signature!"; exit; } // handle correct postback ... echo "OK"; ``` -------------------------------- ### Construct Verotel FlexPay Client Instance Source: https://github.com/verotel/flexpay-php-client/blob/master/README.md Illustrates how to initialize the Verotel FlexPay client. This involves creating a Brand instance using a merchant ID and then instantiating the Client with a shop ID, signature key, and the brand object. ```php // get your brand instance $brand = Verotel\FlexPay\Brand::create_from_merchant_id(/* Your customer ID */ '9804000000000000'); $flexpayClient = new Verotel\FlexPay\Client(/* shop ID */ 12345, "FlexPay Signature Key", $brand); ``` -------------------------------- ### Directly Include Verotel FlexPay Client in PHP Source: https://github.com/verotel/flexpay-php-client/blob/master/README.md Shows how to manually include the Verotel FlexPay Client class file in a PHP project without using Composer, specifying the direct path to the source file. ```php require_once '/src/Verotel/FlexPay/Client.php'; ``` -------------------------------- ### Generate Verotel FlexPay Purchase URL Source: https://github.com/verotel/flexpay-php-client/blob/master/README.md Demonstrates how to obtain a payment URL for a new purchase using the FlexPay client. It requires an array of parameters including priceAmount, priceCurrency, and description to define the transaction. ```php $purchaseUrl = $flexpayClient->get_purchase_URL([ "priceAmount" => 2.64, "priceCurrency" => "EUR", "description" => "Test purchase", ]); ``` -------------------------------- ### Generate Verotel FlexPay Cancel Subscription URL Source: https://github.com/verotel/flexpay-php-client/blob/master/README.md Shows how to generate a URL for cancelling an existing subscription via the FlexPay client. This method requires the saleID of the subscription to be cancelled. ```php $cancelUrl = $flexpayClient->get_cancel_subscription_URL([ "saleID" => 12345 ]); ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.