Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no gold to gem conversion possible after gift subscription (subscribers can't buy gems) #4340

Closed
wildcate opened this issue Dec 5, 2014 · 15 comments

Comments

Projects
None yet
7 participants
@wildcate
Copy link
Contributor

commented Dec 5, 2014

I subscribed yesterday, using paypal and the self-gifting method (I'm based in Germany). That resulted in raised dropcap, hourglasses and the mystery item in the inventory, but there is no gem conversion thingie in the marketplace - just the previously available special items. Hard reload and logging out and in again did not work to change that. Another subscriber (same method) reports the same issue in the Tavern.

My uuid, in case you need it:
d7ca2b94-7515-4f88-bed0-cb16160e4b5f

@TwasBrillig1

This comment has been minimized.

Copy link

commented Dec 5, 2014

I was in the tavern conversation as well - In case another data point might be helpful, I've been subscribed for 9 months, and I have not lost the gem conversion option in the marketplace, even after refreshes.

UUID: 3ab30744-c44f-491a-b69e-c9eeefa5f24e

@Alys

This comment has been minimized.

Copy link
Contributor

commented Dec 5, 2014

The code that turns on subscriber functions uses things like if user.purchased.plan.planId. @lefnire, do users with gifted subscriptions have a value for that object? Do we need to give them a planId or do we need to change the code to use if user.purchased.plan.planId || user.purchased.something_else?

@Alys

This comment has been minimized.

Copy link
Contributor

commented Dec 5, 2014

I think this is the relevant code: https://github.com/HabitRPG/habitrpg/blob/develop/src/controllers/payments/index.js#L41
A gift subscription doesn't set planId but does set customerId (which is also set for non-gift subs).

Terminating a subscription seems to set both planId and customerId to null (https://github.com/HabitRPG/habitrpg-shared/blob/develop/script/index.coffee#L1413).

I think this issue could be fixed by either setting planId to 'gift' if it doesn't already have a value when a gift subscription is given, or by changing all 'if' statements that use planId to use customerId instead. @lefnire which do you prefer?

@Alys Alys changed the title no gem conversion possible after subscription no gold to gem conversion possible after gift subscription (subscribers can't buy gems) Dec 5, 2014

@lemoness

This comment has been minimized.

Copy link
Contributor

commented Dec 5, 2014

Bug report from FB: "I got a one-month subscription-gift from a friend, but I can't buy gems in the market. Though the orb of rebirth appeared, but I'm not level 50 yet XD Bugged....."

This is one of two reports of other special items like the orb of rebirth being incorrectly unlocked in lieu of the gold-to-gems, so I thought I should mention it as well.

@Alys

This comment has been minimized.

Copy link
Contributor

commented Dec 5, 2014

The Orb of Rebirth can be unlocked for three reasons (ultimate gear, beastmaster). It's unlikely to be connected to this. The gem purchase icon is controlled by an 'if' statement that shows the gem if the user's account has a particular variable set. That variable is not being set for gift subscriptions. I think that's the only reason the icon doesn't appear.

@crookedneighbor

This comment has been minimized.

Copy link
Contributor

commented Dec 5, 2014

I think customerId is the way to go. I just tested it with a local user (set my computer's clock ahead a year to trick it into expiring) and the customerId does get removed once the subscription is over.

I also purchased 20 gems, and did not receive a customerId, so I think that's the best way to go.

Can anyone else think of other test cases?

@Alys

This comment has been minimized.

Copy link
Contributor

commented Dec 5, 2014

habitrpg-shared/script/index.coffee will need to be fixed too and possibly other places (I didn't do a full code search in case the option for setting planId was chosen). Blade do you want to or shall I? Do you still have your local install running for testing?

@Alys Alys reopened this Dec 5, 2014

@lefnire

This comment has been minimized.

Copy link
Member

commented Dec 5, 2014

2018cc8

On Fri, Dec 5, 2014 at 3:03 PM, Alice Harris notifications@github.com
wrote:

habitrpg-shared/script/index.coffee will need to be fixed too and possibly
other places (I didn't do a full code search in case the option for setting
planId was chosen). Blade do you want to or shall I? Do you still have your
local install running for testing?


Reply to this email directly or view it on GitHub
#4340 (comment).

@crookedneighbor

This comment has been minimized.

Copy link
Contributor

commented Dec 5, 2014

Mine is up and running and ready to test, but....

@Alys what about it needs to be fixed? I could be wrong, but my understanding was that a customerId is necessary for creating subscriptions and gifts, but that a planId is only necessary for creating subscriptions (I assume because of some way it interacts with the payment processor).

Does anything need to be tweaked then other than the ng-if for the gem?

@Alys

This comment has been minimized.

Copy link
Contributor

commented Dec 5, 2014

Potentially anywhere that has an 'if' statement involving planId would need to be changed, hence my code information and question above about whether to change planId to customerId everywhere or just give a value to planId. However if this is the only remaining location where planId is used in a relevant 'if' statement, then editing it is clearly the best option now.

return cb?({code:401,message:"Must subscribe to purchase gems with GP"},req) unless user.purchased?.plan?.planId

@Alys

This comment has been minimized.

Copy link
Contributor

commented Dec 5, 2014

Where "'if' statement" can also mean "'unless' statement" of course.

@crookedneighbor

This comment has been minimized.

Copy link
Contributor

commented Dec 5, 2014

Oh of course.

Looks like @lefnire took care of it

I don't see any more relevant search results, so I think that's it.

@g2graman

This comment has been minimized.

Copy link

commented Dec 6, 2014

User id:
9bc07270-4c5a-4410-8030-1d41e6e81aa1

Group ID: 4889c225-b5ed-41b1-92c2-bbc595521e62
Browser: Chrome
OS: Windows 8.1

After being gifted a 3 month subscription, I was not given the option to buy gems with gold in the market, though other features seemed to be unlocked.

@Alys Alys closed this Dec 6, 2014

@Alys

This comment has been minimized.

Copy link
Contributor

commented Dec 6, 2014

g2graman This has been fully fixed now. If you reload the Market page do you see the gem icon and can you buy gems with gold when you click on it?

@g2graman

This comment has been minimized.

Copy link

commented Dec 6, 2014

Yes, I do now. I really just meant to migrate my comment over in case having more examples of the issue would help the developers debug it sooner. Thank you for being so helpful!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.