improved airtel money flow
This commit is contained in:
@@ -20,7 +20,23 @@ class AirtelMoneyMalawiController extends Controller
|
|||||||
$current_date = date('Y-m-d');
|
$current_date = date('Y-m-d');
|
||||||
// $incoming=file_get_contents("php://input");
|
// $incoming=file_get_contents("php://input");
|
||||||
// $data = json_decode($incoming, true);
|
// $data = json_decode($incoming, true);
|
||||||
$data = $request->only(['msisdn', 'country', 'currency']);
|
//$data = $request->only(['msisdn', 'country', 'currency']);
|
||||||
|
|
||||||
|
|
||||||
|
$request_data = [
|
||||||
|
"reference" => "sample",
|
||||||
|
"subscriber" => [
|
||||||
|
"country" => "MW",
|
||||||
|
"currency"=> "MWK",
|
||||||
|
"msisdn" => $request->msisdn // 996139030
|
||||||
|
],
|
||||||
|
"transaction" => [
|
||||||
|
"amount" => $request->amount, //10,
|
||||||
|
"country" => "MW",
|
||||||
|
"currency" => "MWK",
|
||||||
|
"id" => $request->refID //time() . uniqid()
|
||||||
|
]
|
||||||
|
];
|
||||||
//country, currency, msisdn,
|
//country, currency, msisdn,
|
||||||
// $subscriber_country = $data['subscriber']['country'];
|
// $subscriber_country = $data['subscriber']['country'];
|
||||||
// $subscriber_currency = $data['subscriber']['currency'];
|
// $subscriber_currency = $data['subscriber']['currency'];
|
||||||
@@ -45,7 +61,7 @@ class AirtelMoneyMalawiController extends Controller
|
|||||||
$bearerToken = $result['token'];
|
$bearerToken = $result['token'];
|
||||||
|
|
||||||
//send a ussd push
|
//send a ussd push
|
||||||
$retval = $this->sendUSSDPush($bearerToken, $data);
|
$retval = $this->sendUSSDPush($bearerToken, $request_data);
|
||||||
$result_data = json_decode($retval, true);
|
$result_data = json_decode($retval, true);
|
||||||
// dump($result_data);
|
// dump($result_data);
|
||||||
// Check if the response has a status and success flag
|
// Check if the response has a status and success flag
|
||||||
|
|||||||
@@ -4,10 +4,15 @@ namespace App\Http\Controllers;
|
|||||||
|
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Config;
|
use Config;
|
||||||
|
use App\Models;
|
||||||
|
|
||||||
|
|
||||||
class KazTestController extends Controller
|
class KazTestController extends Controller
|
||||||
{
|
{
|
||||||
public function main(){
|
public function main(){
|
||||||
|
$users = Models\User::get();
|
||||||
|
|
||||||
|
dump($users);
|
||||||
//Testing the retrieval of kazang Base Url from Config
|
//Testing the retrieval of kazang Base Url from Config
|
||||||
$kazang = Config('kazang');
|
$kazang = Config('kazang');
|
||||||
$kaz_host = $kazang['test_base_url'];
|
$kaz_host = $kazang['test_base_url'];
|
||||||
|
|||||||
17
info.md
17
info.md
@@ -9,3 +9,20 @@
|
|||||||
# New Tables
|
# New Tables
|
||||||
- kazang_sessions
|
- kazang_sessions
|
||||||
- transactions_kazang
|
- transactions_kazang
|
||||||
|
|
||||||
|
|
||||||
|
curl --request POST \
|
||||||
|
--url http://localhost//unity/api/collect/airtel \
|
||||||
|
--header 'Authorization: Bearer bd8f75cc-0f63-4707-9a2e-361800a0d94c' \
|
||||||
|
--header 'accept: application/json' \
|
||||||
|
--header 'content-type: application/json' \
|
||||||
|
--data '{
|
||||||
|
"msisdn" : "265244566789",
|
||||||
|
"amount" : "100",
|
||||||
|
"currency" : "MWK",
|
||||||
|
"country" : "MW",
|
||||||
|
"channel" : "ussd",
|
||||||
|
"payment_mode" : "airtel",
|
||||||
|
"broker_id" : "capitalcontinental",
|
||||||
|
"refID" : "12234"
|
||||||
|
}'
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
User-agent: *
|
|
||||||
Disallow:
|
|
||||||
@@ -15,6 +15,12 @@ Route::get('/', function () {
|
|||||||
return view('welcome');
|
return view('welcome');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Route::get('test', function () {
|
||||||
|
// dd($_SERVER);
|
||||||
|
|
||||||
|
dd("Heere at the wall");
|
||||||
|
});
|
||||||
|
|
||||||
// Auth::routes();
|
// Auth::routes();
|
||||||
Auth::routes(['register' => false]);
|
Auth::routes(['register' => false]);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user