Skip to content

Commit e033925

Browse files
chore(paystack): House Keeping
1 parent d8edff0 commit e033925

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ A sample form will look like so:
187187
</p>
188188
<input type="hidden" name="email" value="[email protected]"> {{-- required --}}
189189
<input type="hidden" name="orderID" value="345">
190-
<input type="hidden" name="amount" value="800"> {{-- required --}}
190+
<input type="hidden" name="amount" value="800"> {{-- required in kobo --}}
191191
<input type="hidden" name="quantity" value="3">
192192
<input type="hidden" name="reference" value="{{ Paystack::genTranxRef() }}"> {{-- required --}}
193193
<input type="hidden" name="key" value="{{ config('paystack.secretKey') }}"> {{-- required --}}

src/Paystack.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ public function isTransactionVerificationValid()
154154

155155
$result = $this->response->json()["message"];
156156

157-
switch($result)
157+
switch ($result)
158158
{
159159
case self::VS:
160160
$validate = true;
@@ -177,7 +177,7 @@ public function isTransactionVerificationValid()
177177
*/
178178
public function getPaymentData()
179179
{
180-
if($this->isTransactionVerificationValid()) {
180+
if ($this->isTransactionVerificationValid()) {
181181
return $this->response->json();
182182
} else {
183183
throw new PaymentVerificationFailedException("Invalid Transaction Reference");

src/TransRef.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class TransRef {
2020
* @param string $type
2121
* @return string
2222
*/
23-
public static function getPool( $type = 'alnum')
23+
private static function getPool( $type = 'alnum')
2424
{
2525
switch ( $type ) {
2626
case 'alnum':
@@ -55,7 +55,7 @@ public static function getPool( $type = 'alnum')
5555
* @param integer $max
5656
* @return integer
5757
*/
58-
public static function secure_crypt($min, $max) {
58+
private static function secure_crypt($min, $max) {
5959
$range = $max - $min;
6060

6161
if ($range < 0) {
@@ -67,7 +67,7 @@ public static function secure_crypt($min, $max) {
6767
$bits = (int) $log + 1; // length in bits
6868
$filter = (int) (1 << $bits) - 1; // set all lower bits to 1
6969
do {
70-
$rnd = hexdec( bin2hex( openssl_random_pseudo_bytes( $bytes ) ) );
70+
$rnd = hexdec(bin2hex(openssl_random_pseudo_bytes($bytes)));
7171
$rnd = $rnd & $filter; // discard irrelevant bits
7272
} while ($rnd >= $range);
7373

0 commit comments

Comments
 (0)