@@ -44,34 +44,34 @@ public function proceedToPaymentGateway(Payment $payment, $redirect_or_callback_
44
44
/**
45
45
* This is a get request. (https://developers.paystack.co/docs/paystack-standard#section-4-verify-transaction)
46
46
*
47
- * @param Request $request
47
+ * @param Request $paymentGatewayServerResponse
48
48
*
49
49
* @return Payment
50
50
*/
51
- public function confirmResponseCanBeHandledAndUpdateDatabaseWithTransactionOutcome (Request $ request ): ?Payment
51
+ public function confirmResponseCanBeHandledAndUpdateDatabaseWithTransactionOutcome (Request $ paymentGatewayServerResponse ): ?Payment
52
52
{
53
- if (!$ request ->has ('reference ' )) {
53
+ if (!$ paymentGatewayServerResponse ->has ('reference ' )) {
54
54
return null ;
55
55
}
56
56
57
- return $ this ->processValueForTransaction ($ request ->reference );
57
+ return $ this ->processValueForTransaction ($ paymentGatewayServerResponse ->reference );
58
58
}
59
59
60
60
/**
61
61
* For Paystack, this is a get request. (https://developers.paystack.co/docs/paystack-standard#section-4-verify-transaction)
62
62
*/
63
- public function processValueForTransaction (string $ transactionReferenceIdNumber ): ?Payment
63
+ public function processValueForTransaction (string $ paystackReference ): ?Payment
64
64
{
65
- throw_if (empty ($ transactionReferenceIdNumber ));
65
+ throw_if (empty ($ paystackReference ));
66
66
67
- $ verificationResponse = $ this ->verifyPaystackTransaction ($ transactionReferenceIdNumber );
67
+ $ verificationResponse = $ this ->verifyPaystackTransaction ($ paystackReference );
68
68
69
69
// status should be true if there was a successful call
70
70
if (!$ verificationResponse ->status ) {
71
71
throw new \Exception ($ verificationResponse ->message );
72
72
}
73
73
74
- $ payment = $ this ->resolveLocalPayment ($ transactionReferenceIdNumber , $ verificationResponse );
74
+ $ payment = $ this ->resolveLocalPayment ($ paystackReference , $ verificationResponse );
75
75
76
76
if ('success ' === $ verificationResponse ->data ['status ' ]) {
77
77
if ($ payment ->payment_processor_name != $ this ->getUniquePaymentHandlerName ()) {
@@ -104,7 +104,7 @@ public function reQuery(Payment $existingPayment): ?ReQuery
104
104
throw new \Exception ($ verificationResponse ->message );
105
105
}
106
106
107
- $ payment = $ this ->resolveLocalPayment ($ existingPayment ->transaction_reference , $ verificationResponse );
107
+ $ payment = $ this ->resolveLocalPayment ($ existingPayment ->processor_transaction_reference , $ verificationResponse );
108
108
109
109
if ('success ' === $ verificationResponse ->data ['status ' ]) {
110
110
if ($ payment ->payment_processor_name != $ this ->getUniquePaymentHandlerName ()) {
@@ -266,13 +266,13 @@ public function createPaymentPlan(string $name, string $amount, string $interval
266
266
return '' ;
267
267
}
268
268
269
- protected function resolveLocalPayment (string $ transactionReferenceIdNumber , PaystackVerificationResponse $ verificationResponse ): Payment
269
+ protected function resolveLocalPayment (string $ paystackReferenceNumber , PaystackVerificationResponse $ verificationResponse ): Payment
270
270
{
271
271
return Payment::query ()
272
272
/**
273
273
* normal transactions
274
274
*/
275
- ->where ('processor_transaction_reference ' , $ transactionReferenceIdNumber )
275
+ ->where ('processor_transaction_reference ' , $ paystackReferenceNumber )
276
276
277
277
/**
278
278
* terminal POS transactions
0 commit comments