Flutterwave / PHP-v3

PHP Library for Flutterwave v3 APIs
MIT License
18 stars 17 forks source link

Not printing the results after mobile money payments #23

Closed comfortchambeshi closed 2 years ago

comfortchambeshi commented 3 years ago

I want to get the result of the payment in array using $print_r($result) but it's not giving me a chance. It's only ending on payment successful and not returning to the page where i can print the results (especially the status) in using $print_r($result). So that i can check the status of the mobile money payment after a successful payment. I used this code but it's still ending on payment successful with a Flutterwave logo instead of printing the results like the way the card payment does.

`<?php
include($_SERVER['DOCUMENT_ROOT'].'/plugins/flutterwave/library/CardPayment.php');
include($_SERVER['DOCUMENT_ROOT'].'/plugins/flutterwave/library/MobileMoney.php');

    use Flutterwave\Card;
    use Flutterwave\MobileMoney;

//The data variable holds the payload
$data = array(
    "order_id" => "USS_URG_89245453s2323",
    "amount" => "1",
    "type" => "mobile_money_zambia",// could be mobile_money_rwanda,mobile_money_uganda, mobile_money_zambia, mobile_money_ghana
    "currency" => "ZMW",
    "email" => "ekene@flw.com",
    "phone_number" => "0968793843",
    "fullname" => "John Madakin",
    "client_ip" => "154.123.220.1",
    "device_fingerprint" => "62wd23423rq324323qew1",
    "meta" => [
        "flightID" => "213213AS"
        ]       
    );

$payment = new MobileMoney();
$result = $payment->mobilemoney($data);
$id = $result['data']['id'];
$verify = $payment->verifyTransaction($id);
print_r($result);`
olaobajuabraham commented 2 years ago

Hi @comfortchambeshi apologies for the late response. please note that this is the current flow for mobile money zambia.

please if you have further questions regarding the flow kindly email developers@flutterwavego.com for more information. more info here https://developer.flutterwave.com/docs/zambia-mobile-money.