Skip to content

Commit d8edff0

Browse files
chore(paystack): Remove previous useless transaction reference generation technique and clean up
1 parent c87c7c5 commit d8edff0

File tree

2 files changed

+2
-12
lines changed

2 files changed

+2
-12
lines changed

README.md

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,6 @@ return [
7373
*/
7474
'merchantEmail' => getenv('MERCHANT_EMAIL'),
7575

76-
/**
77-
* Unique transaction reference
78-
*/
79-
'reference' => 'payref'.time().'tranx',
8076
];
8177
```
8278

@@ -101,8 +97,6 @@ After having paid the order the customer is redirected back. In the redirection
10197

10298
The hash is calculated out of some of the fields returned and a secret non-public value. This hash is used to verify if the request is valid and comes from the payment provider. It is paramount that this hash is thoroughly checked.
10399

104-
The payment result can be something like "payment ok", "customer cancelled payment" or "payment declined".
105-
106100

107101
## Usage
108102

@@ -173,7 +167,7 @@ Paystack::getAuthorizationUrl()->redirectNow();
173167
/**
174168
* This fluent method does all the dirty work of verifying that the just concluded transaction was actually valid,
175169
* It verifies the transaction reference with Paystack Api and then grabs the data returned from Paystack.
176-
* In that data, we have a lot of good stuff, especially the authorisation code that you can save in your db
170+
* In that data, we have a lot of good stuff, especially the `authorization_code` that you can save in your db
177171
* to allow for easy recurrent subscription.
178172
*/
179173
Paystack::getPaymentData();
@@ -195,7 +189,7 @@ A sample form will look like so:
195189
<input type="hidden" name="orderID" value="345">
196190
<input type="hidden" name="amount" value="800"> {{-- required --}}
197191
<input type="hidden" name="quantity" value="3">
198-
<input type="hidden" name="reference" value="{{ config('paystack.reference') }}"> {{-- required --}}
192+
<input type="hidden" name="reference" value="{{ Paystack::genTranxRef() }}"> {{-- required --}}
199193
<input type="hidden" name="key" value="{{ config('paystack.secretKey') }}"> {{-- required --}}
200194
{{ csrf_field() }}
201195

resources/config/paystack.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,4 @@
2626
*/
2727
'merchantEmail' => getenv('MERCHANT_EMAIL'),
2828

29-
/**
30-
* Unique transaction reference
31-
*/
32-
'reference' => 'payref'.time().'tranx',
3329
];

0 commit comments

Comments
 (0)