hasajacykacperek Posted June 2, 2020 Share Posted June 2, 2020 (edited) Hello, i added PHP SDK from my payment to modules/gateways https://github.com/pay-now/paynow-php-sdk and added code to new file: <?php if (!defined("WHMCS")) die("This file cannot be accessed directly"); require_once('vendor/autoload.php'); use Paynow\Client; use Paynow\Environment; use Paynow\Exception\PaynowException; use Paynow\Service\Payment; function paynow_config() { $version = '1.0.0'; $configarray = array( "FriendlyName" => array("Type" => "System", "Value"=>"PayNow"), "userid" => array("FriendlyName" => "Identyfikator Punktu Płatności", "Type" => "text", "Size" => "20"), "userkey" => array("FriendlyName" => "Klucz Punktu Płatności", "Type" => "text", "Size" => "20"), "buttontext" => array("FriendlyName" => "Tekst Przycisku", "Type" => "text", "Value"=>"Zapłać z paynow", "Size" => "20"), "Wersja" => array( "Type" => "html", "Size" => "25", "Description" => $version) ); return $configarray; } function paynow_link($params) { $client = new Paynow\Client('xd', 'xd', Paynow\Environment::SANDBOX); $orderReference = "success_whmcs_".$params['invoiceid']; $idempotencyKey = uniqid($orderReference . '_'); $paymentData = [ "amount" => $params['amount'], "currency" => "PLN", "externalId" => $orderReference, "description" => $params["description"], "buyer" => [ "email" => $params['clientdetails']['email'], 'firstName' => $params['clientdetails']['firstname'], 'lastName' => $params['clientdetails']['lastname'] ] ]; try { $payment = new Payment($client); $result = $payment->authorize($paymentData, $idempotencyKey); $code = '<a href="'.$result->getRedirectUrl().'">'.$params['buttontext'].'</a>'; return $code; } catch (PaynowException $exception) { var_dump($exception); return "wystapil bardzo dziwny blad ktorego pewnie nie da sie naprawic XD"; } } and i get this error: Error: Class 'Paynow\Client' not found in /home/klient.dhosting.pl/lizipiczek/hosting.dkonto.pl/public_html/modules/gateways/paynow.php:27 please help me, thanks Edited June 2, 2020 by hasajacykacperek 0 Quote Link to comment Share on other sites More sharing options...
0 hasajacykacperek Posted July 5, 2020 Author Share Posted July 5, 2020 bump 0 Quote Link to comment Share on other sites More sharing options...
Question
hasajacykacperek
Hello, i added PHP SDK from my payment to modules/gateways
https://github.com/pay-now/paynow-php-sdk
and added code to new file:
and i get this error:
Error: Class 'Paynow\Client' not found in /home/klient.dhosting.pl/lizipiczek/hosting.dkonto.pl/public_html/modules/gateways/paynow.php:27
please help me, thanks
Edited by hasajacykacperekLink to comment
Share on other sites
1 answer to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.