digikraaft / laravel-paystack-subscription

A simple interface to Paystack's subscription billing services. Checkout a sample implementation here
https://github.com/digikraaft/laravel-paystack-subscription-demo
MIT License
20 stars 11 forks source link

Laravel 8 support #5

Closed Harrison-Idornigie closed 2 years ago

Harrison-Idornigie commented 2 years ago

Hi, I am getting errors when trying to install package in Laravel 8, some dependency issues. Please update it. Thanks

timoladoyinbo commented 2 years ago

It already supports Laravel 8. What PHP version are you using? If you're using PHP 8 then there is already a new tag here, just update via composer.

Harrison-Idornigie commented 2 years ago

Thanks for your response. There are dependency issues when I try to install it in Laravel 8, php 7.4

timoladoyinbo commented 2 years ago

This has been tested in Laravel 8 and PHP 7.4 so it may not be an issue with the package. Can you share the exact installation errors you are getting?

Harrison-Idornigie commented 2 years ago

I just tried it now and it works. Thanks for your response

On a side note, how can I check if a user is subscribed to any plan if I have 4 plans for example?

https://github.com/digikraaft/laravel-paystack-subscription#checking-subscription-status

The example above shows I must add a plan name. What happens if I have multiple plans and just need to check if he is subscribed to any?

Harrison-Idornigie commented 2 years ago

image

The installation instructions after composer require all throw errors

Harrison-Idornigie commented 2 years ago

Please, help a brother, How do I pass metadata into the data object of an API post request?

On Thu, Feb 10, 2022 at 1:53 PM Tim Oladoyinbo @.***> wrote:

This has been tested in Laravel 8 and PHP 7.4 so it may not be an issue with the package. Can you share the exact installation errors you are getting?

— Reply to this email directly, view it on GitHub https://github.com/digikraaft/laravel-paystack-subscription/issues/5#issuecomment-1034887616, or unsubscribe https://github.com/notifications/unsubscribe-auth/AECHNV4OCAMCQREPQMMIBKTU2OYNFANCNFSM5NYGXWLQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you authored the thread.Message ID: @.***>

timoladoyinbo commented 2 years ago

I just tried it now and it works. Thanks for your response

On a side note, how can I check if a user is subscribed to any plan if I have 4 plans for example?

https://github.com/digikraaft/laravel-paystack-subscription#checking-subscription-status

The example above shows I must add a plan name. What happens if I have multiple plans and just need to check if he is subscribed to any?

First, you don't have to add a plan name to check for a subscription status, the second argument to the ->subscribed() function can be null.

Secondly the function you need to check for multiple plans is ->subscribedToPlan() - the first argument can take in an array of plan codes. Read the checking subscription status section again for clarity.

timoladoyinbo commented 2 years ago

Please, help a brother, How do I pass metadata into the data object of an API post request?

You will have to be more specific on this. But it depends on the method you're using. Generally you can pass additional data by passing an array containing your data as the third argument of most functions. Make sure the data is supported by the Paystack API. Read here

timoladoyinbo commented 2 years ago

I'm closing this now since the main issue raised has been resolved.

Harrison-Idornigie commented 2 years ago

https://github.com/digikraaft/laravel-paystack-subscription-demo/blob/master/resources/views/billing_plans.blade.php

Please help me with adding meta-data to the script tag on this form.

On Fri, Feb 11, 2022, 4:17 AM Tim Oladoyinbo @.***> wrote:

Please, help a brother, How do I pass metadata into the data object of an API post request? … <#m1358374310631049443>

You will have to be more specific on this. But it depends on the method you're using. Generally you can pass additional data by passing an array containing your data as the third argument of most functions. Make sure the data is supported by the Paystack API. Read here https://github.com/digikraaft/laravel-paystack-subscription#additional-details

— Reply to this email directly, view it on GitHub https://github.com/digikraaft/laravel-paystack-subscription/issues/5#issuecomment-1035845098, or unsubscribe https://github.com/notifications/unsubscribe-auth/AECHNV4RCZY26ZASU4N2EPDU2R5TNANCNFSM5NYGXWLQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you authored the thread.Message ID: @.***>