unicodeveloper / laravel-paystack

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

Multiple Callbacks #28

Closed Quadriphobs1 closed 6 years ago

Quadriphobs1 commented 6 years ago

Thanks so much for this Package, but there are few more things I am confused with here, I am building an application whereby I will be having multiple user payment integrations, for example, user will be paying for subscriptions on the platform, but with different user role,

User Role Group A (group A may have as many as possible users): For this user role, they will be having their paid subscription on the platform and after their payment, the callback URL after payment must be supplied so that i will activate their account in my platform, This set of Users also have different type of subscriptions they can opt-in for, and i will have to do activation for all those subscriptions.

User Role B & C: This also works like the User Group A but a little bit different but also its for subscription payment.

goodnesskay commented 6 years ago

You can work with metadata the on the return of the json, you can use role_id in metadata data to determine redirect.

So, this is what I am saying. You don't need multiple redirects. You just need to also add metadata to your payload and include role _id. Once payment is a success and you have your json, you can use the role_id passed into metadata to determine redirects in your controller method.

I hope that helps you