-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathdeposit_funds.php
28 lines (22 loc) · 1.07 KB
/
deposit_funds.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?php
/**
* This example shows settings to use when submitting a request to get a USSD mobile money PIN
* prompt to transfer funds from a mobile money user to your Yo! Payments Account
*/
require './YoAPI.php';
// Create a new YoAPI instance with Yo! Payments Username and Password
//Set below variables to your Yo! Payments username and password accordingly
$username = "";
$password = "";
$mode = "sandbox";//In production, set this to "production"
$yoAPI = new YoAPI($username, $password, $mode);
// Create a unique transaction reference that you will reference this payment with
$transaction_reference = date("YmdHis").rand(1,100);
$yoAPI->set_external_reference($transaction_reference);
$response = $yoAPI->ac_deposit_funds('256770000000', 1000, 'Reason for transfer of funds');
if($response['Status']=='OK'){
echo "Payment made! Funds have been deposited onto your account. Transaction Reference = ".$response['TransactionReference'].". Thank you for using Yo! Payments";
// Save this transaction for future reference
}else{
echo "Yo Payments Error: ".$response['StatusMessage'];
}