@@ -44,34 +44,34 @@ public function proceedToPaymentGateway(Payment $payment, $redirect_or_callback_
4444 /**
4545 * This is a get request. (https://developers.paystack.co/docs/paystack-standard#section-4-verify-transaction)
4646 *
47- * @param Request $request
47+ * @param Request $paymentGatewayServerResponse
4848 *
4949 * @return Payment
5050 */
51- public function confirmResponseCanBeHandledAndUpdateDatabaseWithTransactionOutcome (Request $ request ): ?Payment
51+ public function confirmResponseCanBeHandledAndUpdateDatabaseWithTransactionOutcome (Request $ paymentGatewayServerResponse ): ?Payment
5252 {
53- if (!$ request ->has ('reference ' )) {
53+ if (!$ paymentGatewayServerResponse ->has ('reference ' )) {
5454 return null ;
5555 }
5656
57- return $ this ->processValueForTransaction ($ request ->reference );
57+ return $ this ->processValueForTransaction ($ paymentGatewayServerResponse ->reference );
5858 }
5959
6060 /**
6161 * For Paystack, this is a get request. (https://developers.paystack.co/docs/paystack-standard#section-4-verify-transaction)
6262 */
63- public function processValueForTransaction (string $ transactionReferenceIdNumber ): ?Payment
63+ public function processValueForTransaction (string $ paystackReference ): ?Payment
6464 {
65- throw_if (empty ($ transactionReferenceIdNumber ));
65+ throw_if (empty ($ paystackReference ));
6666
67- $ verificationResponse = $ this ->verifyPaystackTransaction ($ transactionReferenceIdNumber );
67+ $ verificationResponse = $ this ->verifyPaystackTransaction ($ paystackReference );
6868
6969 // status should be true if there was a successful call
7070 if (!$ verificationResponse ->status ) {
7171 throw new \Exception ($ verificationResponse ->message );
7272 }
7373
74- $ payment = $ this ->resolveLocalPayment ($ transactionReferenceIdNumber , $ verificationResponse );
74+ $ payment = $ this ->resolveLocalPayment ($ paystackReference , $ verificationResponse );
7575
7676 if ('success ' === $ verificationResponse ->data ['status ' ]) {
7777 if ($ payment ->payment_processor_name != $ this ->getUniquePaymentHandlerName ()) {
@@ -104,7 +104,7 @@ public function reQuery(Payment $existingPayment): ?ReQuery
104104 throw new \Exception ($ verificationResponse ->message );
105105 }
106106
107- $ payment = $ this ->resolveLocalPayment ($ existingPayment ->transaction_reference , $ verificationResponse );
107+ $ payment = $ this ->resolveLocalPayment ($ existingPayment ->processor_transaction_reference , $ verificationResponse );
108108
109109 if ('success ' === $ verificationResponse ->data ['status ' ]) {
110110 if ($ payment ->payment_processor_name != $ this ->getUniquePaymentHandlerName ()) {
@@ -266,13 +266,13 @@ public function createPaymentPlan(string $name, string $amount, string $interval
266266 return '' ;
267267 }
268268
269- protected function resolveLocalPayment (string $ transactionReferenceIdNumber , PaystackVerificationResponse $ verificationResponse ): Payment
269+ protected function resolveLocalPayment (string $ paystackReferenceNumber , PaystackVerificationResponse $ verificationResponse ): Payment
270270 {
271271 return Payment::query ()
272272 /**
273273 * normal transactions
274274 */
275- ->where ('processor_transaction_reference ' , $ transactionReferenceIdNumber )
275+ ->where ('processor_transaction_reference ' , $ paystackReferenceNumber )
276276
277277 /**
278278 * terminal POS transactions
0 commit comments