forked from rishimukherjee/instamojo-php-api-wrapper
-
Notifications
You must be signed in to change notification settings - Fork 88
/
Copy pathmain.php
44 lines (36 loc) · 1.14 KB
/
main.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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php
require_once __DIR__ . '/vendor/autoload.php';
$instaobj = Instamojo\Instamojo::init('app',[
"client_id" => $_ENV["CLIENT_ID"],
"client_secret" => $_ENV["CLIENT_SECRET"]
],true);
// $transaction_id = "TEST_".time();
// var_dump([
// "name" => "XYZ",
// "email" => "xyz@squareboat.com",
// "phone" => "9999999988",
// "amount" => 200,
// "transaction_id" => $transaction_id,
// "currency" => "INR"
// ]);
$payment_request = $instaobj->createPaymentRequest([
'amount'=>10,
'purpose'=>"Test script"
]);
var_dump($payment_request['id']);
try{
$gateway_order = $instaobj->createGatewayOrderForPaymentRequest(
"292e38e570794fa592ccf74cc84c8fda",
[
"name" => "XYZ",
"email" => "xyz@squareboat.com",
"phone" => "9999999988",
// "amount" => 200,
// "transaction_id" => $transaction_id,
// "currency" => "INR"
]);
var_dump(json_encode($gateway_order));
}catch(Exception $e){
print('Error: ' . $e->getMessage());
}
?>