Glench / ExtPay

The JavaScript library for ExtensionPay.com — payments for your browser extensions, no server needed.
https://extensionpay.com
Other
483 stars 62 forks source link

Integration not working in Manifest v3 #227

Closed Glitchero closed 1 month ago

Glitchero commented 1 month ago

Hello Support Team,

I am encountering an issue while integrating ExtPay into my extension. Here are the details:

Problem Description: I have followed the integration steps as per the ExtPay documentation. Specifically, I have included ExtPay.js in my project, configured permissions in manifest.json, and initialized ExtPay in background.js.

Code Snippet:

javascript Copy code // background.js importScripts('ExtPay.js');

const extpay = ExtPay('matchkraft-apollo-addon'); extpay.startBackground();

extpay.getUser().then(user => { if (user.paid) { console.log('User paid:', user.paid); if (user.subscriptionStatus) { console.log('Subscription Status:', user.subscriptionStatus); } else { console.log('Subscription status not available.'); } } else { console.log('User does not pay.'); extpay.openPaymentPage(); } }).catch(error => { console.error('Error fetching user subscription status:', error); }); Expected Behavior: I expect extpay.getUser() to correctly retrieve the user's paid status and subscription details from ExtensionPay's servers.

Actual Behavior: The user.subscriptionStatus is undefined, even though user.paid correctly indicates whether the user has paid.

Steps Taken:

Verified integration steps according to ExtPay documentation. Ensured ExtPay.js is correctly imported and extpay.startBackground() is called once in background.js. Used console logs to trace flow and confirm that extpay.getUser() is called correctly. Additional Notes:

I have reviewed the ExtensionPay documentation and followed their guidelines for integration. Please advise on how to troubleshoot or resolve this issue.

Regards, Rene

Glench commented 1 month ago

Hey Rene! 2 questions before I dig in to try to recreate the issue.

  1. What is your extension id? Is it set up for one-time payments only or subscription payments?
  2. Can you screenshot the payment page for me? And also the results of extpay.getUser()?
Glench commented 1 month ago

Hey @Glitchero! Please let me know your progress on this! If I don't hear back from you, I'll close the issue to reduce clutter in the issue tracker.

Glitchero commented 1 month ago

Hi Glench, sorry for the late response. To be honest, I tried another approach. But let me tell you what happened, looks like the user (extpay.getUser()) had lack of information. For example, when I use the test version and I changed the value to unpaid or something related to that, I strill got paid equal true. I think, we can close this issue. Thanks for the support. Also, the user do not have all the values that appear in the documentation. But I remember user.paid value appeared.

Glench commented 1 month ago

@Glitchero 'unpaid' status is a status in Stripe. It's a status that can happen when a user has paid previously but now their invoice is outstanding. It's different than a user never having paid at all. And out of curiosity, what solution did you end up with?

Glitchero commented 1 month ago

Ohh I see, the unpaid is in stripe, i though it was because i did something wrong in the background script. I also tried browserbill but the support was terrible. You guys are better on the support hehe. At the end, I found a solution using gumroad license key api key. There is a membership mode in gumroad combined with license key solved the issue. Also, this approach offers many advantages because I can ofuscate my code. In the chrome web store I can't offuscate my code. However, I will give extpay another shot soon with another extension, I have a zillow scraper that I want to monetize in the chrome web store. Thanks for the support, that gives me relax on the extpay hehe.

Glench commented 1 month ago

Ah, I see. Yeah, gumroad's fee is huge and having a customer deal with a license code is a bad and outdated user experience (which is why we don't have them), but glad you found something that worked for you.