Glench/ExtPay

[object PointerEvent] Free Trial

prakhar897 opened this issue · 4 comments

Describe the bug
when running "subscriptionButton.addEventListener('click', extpay.openTrialPage)", the page that loads fails to show the name of the extension and instead shows [object PointerEvent].

Desktop (please complete the following information):

  • OS: Windows
  • Browser Chrome
  • Version 10

Captddure

I’m not sure this is really a bug. You’re passing a PointerEvent to the openTrialPage function which is supposed to take a string.

I was following the code written in sample-extension-mv3.

The correct way was:

"subscriptionButton.addEventListener('click', function() {
extpay.openTrialPage("SmileyWriter");
});
"

Including this kind of stub in documentation would be helpful. Thanks

Glad it’s fixed! If you look, there is no free trial call in the sample extension.

Instead, use the documentation: https://github.com/Glench/ExtPay#8-use-extpayopentrialpage-to-let-the-user-sign-up-for-a-free-trial

And just so you know, you should provide the trial period length, not the extension name, to the trial function. This is so the user understands what they’re signing up for.