Skip to main content

User credits

Feature: new user gets 10$ credit when signed up via referral link

Scenario: new user signs up via referral link to get 10$ credit and when he upgrades, referred user gets 10$ too

Given new user is signed in via referral link Then new user should get 10$ credit When new user upgrades localDev plugin to monthly plan Then new user is subscribed to monthly plan with 4.99 And new user should be charged 0$ And referred user should get 10$ credit And new users 4.99 credits should be spent with 5.01 remaining credits Then on the 2nd month new user should be charged 0$ and 4.97$ credits, and 0.02 credits remained Then on 3rd month user should be charged 4.97$ and 0.02$ credits, and no more credits left Then on 4th month later user should be charged at normal rate of 4.99$

Scenario: new user subscribes to yearly plan and part of the payment is paid from his 10$ credits Given new user is signed up via referral link And upgraded to yearly plan for localDev plugin Then new pro subscription with 53.89$ is created (taking 10% yearly discount into account) And 10$ credit should be spent And there should be no user credits left And user should be charged 43.89$ this time -(10$ credit and 10% yearly discount) Then next year user should be charged by 53.89$ (only 10% yearly discount is taken)

Scenario: user uses 15$ credit from different sources (2 credits :10$ and 5$) Given user has 10$ credit and 5$ credit When user upgrades to yearly plan for localDev plugin Then 15$ credit should be spent (not only 10$ or 5$ seperately, they should accumulate and spent) And there should be no credits left And user should be charged 38.89$ (-10% yearly discount, -15$ credit) from card

Scenario: user uses 2 3$ credits to pay for 4.99 monthly plan Given user has 2 credits (3$ each) When user upgrades to monthly plan for localDev plugin (4.99$ cost) Then 3$ credit is used in total and 1.99$ is used from other 3$ credits And there should be 1.01$ credits left And user should be charged 0$