1. Go to this page and download the library: Download and/w1-api 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/ */
and / w1-api example snippets
$api = new W1\PaymentAPI('merchantId', 'secretKey');
echo $api->getFormHTMLDocument($api->createPaymentForm()
->setPaymentId(uniqid())
->setCultureId('ru' == $this->getLastLocale() ?
W1\Form\PaymentForm::LANG_RU :
W1\Form\PaymentForm::LANG_EN
)
->setAmount(2.99)
->setCurrencyId(W1\Form\PaymentForm::CURRENCY_USD)
->setDescription('Оплата за что-то')
->setSuccessUrl($this->get_page_url('buy_method_w1_callback')) // to redirect user
->setFailUrl($this->get_page_url('')) // to redirect user