-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathcallback.php
More file actions
48 lines (35 loc) · 1.04 KB
/
callback.php
File metadata and controls
48 lines (35 loc) · 1.04 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
40
41
42
43
44
45
46
47
48
<?php
/**
*
* Description
*
* @package Paystack
* @category Source
* @author Michael Akanji <matscode@gmail.com>
* @date 2017-06-27
* @copyright (c) 2016 - 2017, TECRUM (http://www.tecrum.com)
*
*/
require_once "../vendor/autoload.php";
use Matscode\Paystack\Transaction;
use Matscode\Paystack\Utility\Debug;
$secretKey = 'sk_test_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';
// creating the transaction object
$Transaction = new Transaction( $secretKey );
// transaction can be verified by doing manual check on the response Obj
/*
$response = $Transaction->verify();
Debug::print_r( $response);*/
// OR
$result = $Transaction->isSuccessful();
/*
Debug::print_r( $result);
*/
// To check if verified amount is the expected amount before giving value to customer
$result = $Transaction->amountEquals(5000); // amount in kobo
Debug::printStr( $result );
// Getting AuthorizationCode
/*
$authorizationCode = $Transaction->getAuthorizationCode();
Debug::print_r( $authorizationCode);
*/