slydepay code example
Example: slidepay
<?php
require 'vendor/autoload.php';
use Slydepay\Order\Order;
use Slydepay\Order\OrderItem;
use Slydepay\Order\OrderItems;
$slydepay = new Slydepay\Slydepay("merchantEmail", "merchantSecretKey");
$orderItems = new OrderItems([
new OrderItem("1234", "Test Product", 10, 2),
new OrderItem("1284", "Test Product2", 20, 2),
]);
$shippingCost = 20;
$tax = 10;
$order = Order::createWithId(
$orderItems,
"order_id_1",
$shippingCost,
$tax,
"description",
"no comment"
);
try {
$response = $slydepay->processPaymentOrder($order);
echo $response->redirectUrl();
} catch (Slydepay\Exception\ProcessPayment $e) {
echo $e->getMessage();
}