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

Invalid plan Sent #125

Closed PromiseShedrach closed 3 years ago

PromiseShedrach commented 3 years ago

When I try to initialize a transaction. I get this error:

GuzzleHttp\Exception\ClientException Client error: POST https://api.paystack.co/transaction/initialize resulted in a 400 Bad Request response: { "status": false, "message": "Invalid plan Sent" }

Raymoneto commented 3 years ago

I encountered same issue. The payment was working seamlessly hours ago, and stopped with Invalid plan Sent. I had to do a quick fix by tampering with the library code.

Goto: vendor/unicodeveloper/src/Paystack.php, and comment the line below:

// "plan" => request()->plan,

NB: This is a quick fix, and shouldn't be used when implementing plans/subscriptions.

unicodeveloper commented 3 years ago

@PromiseShedrach @Raymoneto I have fixed the issue. Please upgrade to the latest version of the package.

Raymoneto commented 3 years ago

@PromiseShedrach @Raymoneto I have fixed the issue. Please upgrade to the latest version of the package.

Bravo! Thank you.

blazefluz commented 3 years ago

You don't need to comment it.

Go to the vendor folder vendor\unicodeveloper\laravel-paystack\src\Paystack.php Change "plan" => request()->plan, to "plan_code" => request()->plan,

paystack did an update that is why you have an error.

devclassik commented 1 year ago

"plan_code" => request()->plan, or //"plan" => request()->plan,

nothing works