You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
->setAmount( 75000 ) // amount is treated in Naira while using this method
66
+
->setAmount( 75000 ) // amount is treated in Naira while using this setAmount() method
75
67
->initialize();
76
68
```
77
-
If you want to get the 200OK raw Object as it is sent by Paystack, Set the 2nd argument of the `initialize()` to `true`, example below
78
-
```php
79
-
// Set data to post using this method
80
-
$response =
81
-
$Transaction
82
-
->setEmail( 'matscode@gmail.com' )
83
-
->setAmount( 75000 ) // amount is treated in Naira while using this method
84
-
->initialize([], true);
85
-
```
86
69
Now do a redirect to payment page (using authorization_url)
87
70
<br>
88
-
NOTE: Recommended to Debug `$response` or check if authorizationUrl is set, and save your Transaction reference code. useful to verify Transaction status
71
+
NOTE: Recommended to check if authorizationUrl is set, and save your Transaction reference code. useful to verify Transaction status
89
72
90
73
```php
91
74
// recommend to save Transaction reference in database and do a redirect
Using a Framework? It is recommended you use the reverse routing/redirection functions provided by your Framework
97
-
98
77
99
-
### Verifying Transaction
100
-
This part would live in your callback file i.e `callback.php` or `whatsoever_you_name.php`
101
-
<br>
102
-
It is also imperative that you create Transaction Obj once more.
103
-
<br>
104
-
This method would return the Transaction Obj but `false` if saved `$reference` is not passed in as argument and also cant be guessed. Using `verify()` would require you do a manual check on the response Obj
// This method does the check for you and return `(bool) true|false`
113
-
$response = $Transaction->isSuccessful();
114
-
```
115
-
The two methods above try to guess your Transaction `$reference` but it is highly recommended you pass the Transaction `$reference` as an argument on the method as follows
116
-
```php
117
-
// This method does the check for you and return `(bool) true|false`
More so, you can also compare if amount paid by a customer is the amount expected. This method only works after calling `verify()` or `isSuccessful()` in the same script. It is recommended to do this if you use paystack inline to initialize the transaction.
121
-
```php
122
-
$amountExpected = 5000; // amount must be in kobo
123
-
// returns `(bool) true|false`
124
-
$Transaction->amountEquals($amountExpected);
125
-
```
126
-
Now you can process Customer Valuable.
127
-
<br>
128
-
You might wanna save Transaction `$authorizationCode` for the current customer subsequent Transaction but not a nessecity. It would only counts to future updates of this package or if you choose to extend the package.
129
-
```php
130
-
// returns Auth_xxxxxxx
131
-
$response = $Transaction->authorizationCode($reference); // can also guess Transaction $reference
0 commit comments