1. Go to this page and download the library: Download eversend/eversend-php-sdk 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/ */
eversend / eversend-php-sdk example snippets
use Eversend\Eversend
$eversendClient = new Eversend(
clientId= 'clientId',
clientSecret= 'clientSecret',
version=1
);
$beneficiary = eversendClient.beneficiaries.create(
firstName: "John",
lastName: "Okello",
country: "UG", // Alpha-2 country code
phoneNumber: "+256712345678", // Should be in international format
bankAccountName: "John Okello",
bankAccountNumber: "12345678",
bankName: "Stanbic Bank",
bankCode: 1234 // You can get the bank code from payouts.getDeliveryBanks()
);
$beneficiary = eversendClient.beneficiaries.update(
beneficiaryId: 100,
firstName: "John",
lastName: "Okello",
country: "UG", // Alpha-2 country code
phoneNumber: "+256712345678", // Should be in international format
bankAccountName: "John Okello",
bankAccountNumber: "12345678",
bankName: "Stanbic Bank",
bankCode: 1234 // You can get the bank code from payouts.getDeliveryBanks()
);
eversendClient.collections().initiateMomo(
phone: "+256712345678",
amount: 1000,
country: "UG",
currency: "UGX",
pin: 123456, // From phone number passed in Get Collection OTP
pinId: "dg524fhsgfde", // From Get Collection OTP
transactionRef: "EVS-12345678", // Optional transaction ref generated by you
customer: { name: "John Okello" } // Optional customer object with your metadata
);
$quotation = eversendClient.payouts.getQuotation(
amount: 100,
amountType: "SOURCE", // amountType can be SOURCE or DESTINATION
sourceWallet: "USD",
destinationCountry: "KE",
destinationCurrency: "KES"
);
$payout = eversendClient.payouts.initiate(
beneficiaryId: 100,
quotationToken: "token",
transactionRef: "EVS-12345678" // Optional transaction ref generated by you
);
$payout = eversendClient.payouts.initiate({
firstName: "John",
lastName: "Okello",
country: "UG", // Alpha-2 country code
phoneNumber: "+256712345678", // Should be in international format
bankAccountName: "John Okello",
bankAccountNumber: "12345678",
bankName: "Stanbic Bank",
bankCode: 1234, // You can get the bank code from payouts.getDeliveryBanks()
quotationToken: "token",
transactionRef: "EVS-12345678" // Optional transaction ref generated by you
});