PHP code example of digitalpaye / digitalpaye-sdk-php
1. Go to this page and download the library: Download digitalpaye/digitalpaye-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/ */
digitalpaye / digitalpaye-sdk-php example snippets
igitalpayeSdkPhp\Services\Digitalpaye;
$apikey = "live_digitalpaye129923061";
$apisecret = "d511e1f4-d932-32fcd-a804-371539700d60c";
$transactionId = "f511e4f4-d932-4fcd-a804-51539700d60c";
$config = new Digitalpaye($apikey, $apisecret);
$getStatusTransaction = $config->getStatus($transactionId);
if ($getStatusTransaction["data"]["status"] == "PENDING") {
echo "La transaction est en cours de validation";
} elseif ($getStatusTransaction["data"]["status"] == "SUCCESSFUL") {
echo "La transaction a été validée";
} else {
echo $getStatusTransaction["message"];
}
igitalpayeSdkPhp\Services\Digitalpaye;
$apikey = "live_digitalpaye129923061";
$apisecret = "d511e1f4-d932-32fcd-a804-371539700d60c";
$config = new Digitalpaye($apikey, $apisecret);
$dataCreateTransfer = [
"transactionId" => "DIGITAL-0139601181902",
"customer" => [
"lastName" => "GUEI",
"firstName" => "HELIE",
"phone" => "0777101308",
"address" => [
"countryCode" => "CI",
"city" => "Abidjan",
"streetAddress" => "Yopougon, Carrefour Canal"
]
],
"recipient" => "0777101308",
"amount" => "100",
"currency" => "XOF",
"operator" => "WAVE_MONEY_CI"
];
$transfer = $config->createTransfert($dataCreateTransfer);
if ($transfer['data']["status"] == "SUCCESSFUL") {
echo "Le transfert a été validé";
} elseif ($transfer['data']["status"] == "PENDING") {
echo "Le transfert est en cours";
} else {
echo "Le transfert a échoué";
}
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.