Processing Payments with Legacy Payblis intégration
The Legacy Integration method uses a secure redirection flow that sends customers to the Payblis hosted checkout page, where payment is processed and the result is returned via callback URLs.
PHP Implementation
Copy
// Set up the request parameters$MyVars = array( 'MerchantKey' => 'YOUR_MERCHANT_KEY', 'sandbox' => 'true', //Only for TEST MODE 'amount' => '19.99', 'currency' => 'EUR', //EUR,USD, CAD 'product_name' => 'Test product', 'method' => 'credit_cards', 'RefOrder' => 'xxxxx', 'Customer_Email' => 'customer@example.com', 'Customer_Name' => 'Doe', 'Customer_FirstName' => 'John', 'country' => 'FR', 'userIP' => $_SERVER['REMOTE_ADDR'], 'lang' => 'en', 'store_name' => 'Example Store', 'urlOK' => 'https://your-domain.com/success', 'urlKO' => 'https://your-domain.com/failed', 'ipnURL' => 'https://your-domain.com/ipn');// Serialize the data (convert array to string format)$serializedData = serialize($MyVars);// Base64 encode the serialized data directly (no URL encoding)$encoded = base64_encode($serializedData);// Prepare the custom payment URL$paymentUrl = "https://pay.payblis.com/api/payment_gateway.php?token=" . $encoded;// Redirect the user to your custom endpoint (payment page)header("Location: " . $paymentUrl);exit;