unicodeveloper / laravel-paystack

:credit_card: :package: :moneybag: Laravel 6, 7, 8, 9, 10 and 11 Package for Paystack
https://paystack.co
MIT License
609 stars 314 forks source link

feat: Update getPaymentData method to accept a reference parameter #186

Open Freddy10035 opened 3 months ago

Freddy10035 commented 3 months ago

This is to handle

GuzzleHttp\Exception\ClientException Client error: GET https://api.paystack.co/transaction/verify/ resulted in a 400 Bad Request response: { "status": false, "message": "Transaction ID should be numeric." }

error that people keep on getting when using this with laravel.

Freddy10035 commented 3 months ago

DO NOT MERGE

chrisidakwo commented 3 months ago

DO NOT MERGE

Is there any reason why this should not be merged?

@unicodeveloper I just came across this issue when trying to verify a payment from a payment page. On successful transaction, the Paystack payment page sends reference as the query param rather than trxref. Hence, either the verifyTransactionAtGateway() method is updated to account for a reference query param or devs are given the option in getPaymentData() to provide the reference however they receive from Paystack - I prefer this option.

@Freddy10035 Pls see my comment on your changes