1. Go to this page and download the library: Download maksa988/laravel-wayforpay library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
$order_id = time(); // Payment`s order ID
$amount = 100; // Payment`s amount
$client = new \Maksa988\WayForPay\Domain\Client('John', 'Doe', '[email protected]');
$products = new \Maksa988\WayForPay\Collection\ProductCollection([
new \WayForPay\SDK\Domain\Product('iPhone 12', 10, 1),
]);
//
$data = WayForPay::purchase($order_id, $amount, $client, $products)->getData(); // Array of data for using to create your own form.
$form = WayForPay::purchase($order_id, $amount, $client, $products)->getAsString($submitText = 'Pay', $buttonClass = 'btn btn-primary'); // Get html form as string
$widget = WayForPay::purchase($order_id, $amount, $client, $products)->getWidget($callbackJsFunction = null, $buttonText = 'Pay', $buttonClass = 'btn btn-primary'); // Get html form as string
$card = new \Maksa988\WayForPay\Domain\Card('5276999765600381', '05', '2021', '237', 'JOHN DOU');
$cardToken = new \Maksa988\WayForPay\Domain\Card('1aa11aaa-1111-11aa-a1a1-0000a00a00aa');