How to have multiple plans with ExtensionPay! #40
Replies: 4 comments
-
Thanks @benf2004 I'm in exactly the same shoes as you (developing an extension that I'm planning to launch in the near future) and I also want to have multiple plans. This will come in handy for sure! |
Beta Was this translation helpful? Give feedback.
-
Thanks! This is also next on my list to implement a Business Version and a Annually Plan |
Beta Was this translation helpful? Give feedback.
-
thanks @benf2004 !! Do you have some code example for this? still figuring out how to set this up correctly, storage usage and sync etc. |
Beta Was this translation helpful? Give feedback.
-
@BowTiedSwan Here's some snipetts
|
Beta Was this translation helpful? Give feedback.
-
I posted this in a separate comment but thought I would make a new post for greater visibility. I recommend having a decent understanding of how Extension Pay works before reading this.
Hey everyone! I have figured out how you can add multiple plans to your extension (and confirmed with @Glench that "if it works it works"). In my case, I'm only offering two payment options (monthly & lifetime), so for me, it's not too complicated. It's a bit of a jerry-rig, but it's not too bad.
extpay.startBackground()
, because you're not sure which plan the user has selected. Instead, once a user has selected a plan, send a message to the background script with whatever plan they chose and then startBackground(). After the background has started, you can callextpay.openPaymentPage()
chrome.storage.sync.remove(['extensionpay_api_key','extensionpay_installed_at', "extensionpay_user"]
. Warning: This will immediately sign out the user of their 'paid' features. While they can sign back in, make sure they understand by clicking continue, they will be immediately signed out. Some people may click the "buy now" button and then change their mind before they complete the purchase. That can be a hassle if you don't ensure the user knows what is happening.extpay.startBackground()
.[extension_name]_[plan_name]
. So I retrieve the plan from chrome storage and then setconst extpay = ExtPay(plan_name)
This way, in my content & background scripts I can get the appropriate plan to show the correct features/upgrade buttons.If you have any questions or want some more examples, don't be afraid to reach out!
Beta Was this translation helpful? Give feedback.
All reactions