-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathindex.php
More file actions
45 lines (36 loc) · 961 Bytes
/
index.php
File metadata and controls
45 lines (36 loc) · 961 Bytes
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
/**
*
* Description
*
* @package Paystack
* @category Source
* @author Michael Akanji <matscode@gmail.com>
* @date 2017-06-26
* @copyright (c) 2016 - 2017, TECRUM (http://www.tecrum.com)
*
*/
require_once "../vendor/autoload.php";
use Matscode\Paystack\Transaction;
use Matscode\Paystack\Utility\Debug;
use Matscode\Paystack\Utility\Http;
$secretKey = 'sk_test_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';
// creating the transaction object
$Transaction = new Transaction( $secretKey );
// Set data to post using this method
/*
$response = $Transaction->initialize( [
'email' => 'customer@gmail.com',
'amount' => 500000
] );
*/
// OR
$response =
$Transaction
->setEmail( 'customer@gmail.com' )
->setAmount( 50 )
->initialize();
// print response
Debug::print_r( $response );
// save reference somewhere and do a redirect
Http::redirect($response->authorizationUrl);