-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathprocess.php
More file actions
40 lines (23 loc) · 1.29 KB
/
process.php
File metadata and controls
40 lines (23 loc) · 1.29 KB
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
29
30
31
32
33
34
35
36
37
38
39
<?php
/**
* Created by PhpStorm.
* User: william
* Date: 10/18/15
* Time: 1:43 PM
*/
$app_config = require("Api/CheckOut/config.php");
include 'Api/CheckOut/Lnmo_checkout_Service.php';
include 'Api/CheckOut/processCheckOutRequest.php';
include 'Api/CheckOut/processCheckOutResponse.php';
//capture the payment details and prepare a call to SAG(Service Agent Gateway)
$checkoutService = new \Api\CheckOut\Lnmo_checkout_Service();
// $checkOutHeader = new \Api\CheckOut\CheckOutHeader($app_config["MERCHANT_ID"],"","");
$processcheckOutReq = new \Api\CheckOut\processCheckOutRequest($app_config["MERCHANT_ID"],"",30020," "," ",$app_config["CALLBACK_URL"],$app_config["CALLBACK_METHOD"]," ");
$response = new \Api\CheckOut\processCheckOutResponse("","","","","");
$response = $checkoutService -> processCheckOut($processcheckOutReq);
//invoke the processCheckOut
//the SAG validates the response and sends a response
//merchant receives the processCheckOutResponse
//the merchant should display the CUST_MSG to the customer after which he invokes confirmPaymentRequest
// --> the system will push a USSD menu to customer to request the user to enter Bonga pin and any other validation info
//the transaction is processed on mpesa and a callback is exexuted