1. Go to this page and download the library: Download lloricode/paymaya-sdk-php 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/ */
lloricode / paymaya-sdk-php example snippets
use Lloricode\Paymaya\Client\Checkout\CustomizationClient;
use Lloricode\Paymaya\Request\Checkout\Customization\Customization;
use Lloricode\Paymaya\PaymayaClient;
$customization = (new CustomizationClient(
new PaymayaClient(
'sk-X8qolYjy62kIzEbr0QRK1h4b4KDVHaNcwMYk39jInSl', // secret
'pk-Z0OSzLvIcOI2UIvDhdTGVVfRSSeiGStnceqwUE7n0Ah', // public
PaymayaClient::ENVIRONMENT_SANDBOX
)
))
->register(
(new Customization())
->setLogoUrl('https://image-logo.png')
->setIconUrl('https://image-icon.png')
->setAppleTouchIconUrl('https://image-apple.png')
->setCustomTitle('Test Title Mock')
->setColorScheme('#e01c44')
);
echo $customization->customTitle; //check all properties in class
use Lloricode\Paymaya\Client\Checkout\CustomizationClient;
use Lloricode\Paymaya\Request\Checkout\Customization\Customization;
use Lloricode\Paymaya\PaymayaClient;
$customization = (new CustomizationClient(
new PaymayaClient(
'sk-X8qolYjy62kIzEbr0QRK1h4b4KDVHaNcwMYk39jInSl', // secret
'pk-Z0OSzLvIcOI2UIvDhdTGVVfRSSeiGStnceqwUE7n0Ah', // public
PaymayaClient::ENVIRONMENT_SANDBOX
)
))
->retrieve();
echo $customization->customTitle; //check all properties in class
use Lloricode\Paymaya\Client\Checkout\CustomizationClient;
use Lloricode\Paymaya\Request\Checkout\Customization\Customization;
use Lloricode\Paymaya\PaymayaClient;
(new CustomizationClient(
new PaymayaClient(
'sk-X8qolYjy62kIzEbr0QRK1h4b4KDVHaNcwMYk39jInSl', // secret
'pk-Z0OSzLvIcOI2UIvDhdTGVVfRSSeiGStnceqwUE7n0Ah', // public
PaymayaClient::ENVIRONMENT_SANDBOX
)
))
->delete();
use Lloricode\Paymaya\Client\Checkout\WebhookClient;
use Lloricode\Paymaya\PaymayaClient;
use Lloricode\Paymaya\Request\Checkout\Webhook;
$paymayaClient = new PaymayaClient(
'sk-X8qolYjy62kIzEbr0QRK1h4b4KDVHaNcwMYk39jInSl', // secret
'pk-Z0OSzLvIcOI2UIvDhdTGVVfRSSeiGStnceqwUE7n0Ah', // public
PaymayaClient::ENVIRONMENT_SANDBOX
);
(new WebhookClient($paymayaClient))->deleteAll();
// create
(new WebhookClient($paymayaClient))
->register(
(new Webhook())
->setName(Webhook::CHECKOUT_SUCCESS)
->setCallbackUrl('https://web.test/test/success')
);
(new WebhookClient($paymayaClient))
->register(
(new Webhook())
->setName(Webhook::CHECKOUT_FAILURE)
->setCallbackUrl('https://web.test/test/failure')
);
(new WebhookClient($paymayaClient))
->register(
(new Webhook())
->setName(Webhook::CHECKOUT_DROPOUT)
->setCallbackUrl('https://web.test/test/drop')
);
$webhookResponses = (new WebhookClient($paymayaClient))
->retrieve();
// update
(new WebhookClient($paymayaClient))
->update(
$webhookResponses[Webhook::CHECKOUT_SUCCESS]
->setCallbackUrl('https://web.test/test/update-success')
);
// single delete
(new WebhookClient($paymayaClient))
->delete(
$webhookResponses[Webhook::CHECKOUT_DROPOUT]
);
// delete all
(new WebhookClient($paymayaClient))
->deleteAll();
bash
composer
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.