function setUp() { $this->protocolVersion = '3.4'; $this->secret = "zpXwe2D77g4P7ysGJcr3rY87TBYs6J"; $this->shopId = '68849'; $this->brand = Verotel\FlexPay\Brand::create_from_name('FreenomPay'); $this->client = new Verotel\FlexPay\Client($this->shopId, $this->secret, $this->brand); $this->params = array('saleID' => '433456', 'referenceID' => '5566', 'priceAmount' => '0.00', 'referenceID' => 'reference1234', 'priceCurrency' => 'USD', 'custom1' => 'My', 'description' => 'My Dščřčřřěřě&?=blah123', 'subscriptionType' => 'RECURRING', 'period' => 'P1M', 'name' => 'My name', 'trialAmount' => '0.01', 'trialPeriod' => 'P3D', 'backURL' => 'http://backURL.test', 'declineURL' => 'http://declineURL.test', 'cancelDiscountPercentage' => '30', 'blah' => 'something'); $this->signOfFiltered = '77ab6c444044bffc8a925c55d31d342096ef9e72'; $this->signOfAll = '3650ddcc9360de60f4fc78604057c9f3246923cb'; $this->baseUrl = 'https://secure.freenompay.com/'; $this->commonURLParams = "backURL=http%3A%2F%2FbackURL.test" . "&blah=something" . "&cancelDiscountPercentage=30" . "&custom1=My" . "&declineURL=http%3A%2F%2FdeclineURL.test" . "&description=" . "My+D%C5%A1%C4%8D%C5%99%C4%8D%C5%99%C5%99" . "%C4%9B%C5%99%C4%9B%26%3F%3Dblah123" . "&name=My+name" . "&period=P1M" . "&priceAmount=0.00" . "&priceCurrency=USD" . "&referenceID=reference1234" . "&saleID=433456" . "&shopID=68849" . "&subscriptionType=RECURRING" . "&trialAmount=0.01" . "&trialPeriod=P3D"; }
<?php require_once __DIR__ . '/../src/Verotel/FlexPay/Client.php'; require_once 'config.php'; $brand = Verotel\FlexPay\Brand::create_from_merchant_id($FLEXPAYCONFIG['merchantId']); $flexpayClient = new Verotel\FlexPay\Client($FLEXPAYCONFIG['shopId'], $FLEXPAYCONFIG['signatureKey'], $brand); $purchaseUrl = $flexpayClient->get_purchase_URL(["priceAmount" => 2.64, "priceCurrency" => "EUR", "description" => "Test purchase"]); ?> <!DOCTYPE html> <html> <head> <meta charset='utf-8'> <title>Verotel FlexPay - examples</title> </head> <body> <h1>Verotel FlexPay</h1> <h2>Purchase</h2> <p> <a href="<?php echo htmlspecialchars($purchaseUrl); ?> ">Pay 2.64 EUR</a> </p> </body> </html>