File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -25,8 +25,12 @@ public function isHandlerFor(Request $webhookRequest): bool
2525
2626 public function handle (Request $ webhookRequest ): Payment
2727 {
28- $ payment = Payment::withTrashed ()->where ('transaction_reference ' , $ webhookRequest ->input ('data.reference ' ))
29- ->orWhere ('transaction_reference ' , $ webhookRequest ->input ('data.metadata.reference ' ))
28+ $ paystackReference = $ webhookRequest ->input ('data.reference ' );
29+ $ appReference = $ webhookRequest ->input ('data.metadata.reference ' );
30+
31+ $ payment = Payment::withTrashed ()
32+ ->where ('processor_transaction_reference ' , $ paystackReference )
33+ ->when ($ appReference , fn ($ query ) => $ query ->orWhere ('transaction_reference ' , $ appReference ))
3034 ->first ();
3135
3236 if (!$ payment ) {
You can’t perform that action at this time.
0 commit comments