We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 42035
    • 90 Posts
    Hello

    I am working on the project, I want the following functionality

    -> User can buy the credit using Paypal.

    Means when user buy 10credits paying $10 using paypal, Then in modx user 10 should be credited in the user's account. By using of this credits user can buy article.

    Ex. If user has 10 credits in the account, when user buy article (price 3 credits), than 3 should be debited from the account and 7credit should be in the account.

    I am Using minishop2 to purchase the credits.

    Is it feasible in Modx Revolution with minishop2 ? Or
    Any idea about other extra which works same as per my requirement ? Or

    Any instruction how to create this whole functionality from scratch ?

    Thank You
    Vinod Joshi
      Arkalp.com
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      I would use the user's Extended Fields to store his credits, I presume that minishop2 has a post-hook system for performing actions after a purchase.

      You can use snippets or plugins to get and to set the user's Extended Fields, they are presented as an array when accessed with the MODX APIs. So if you have $extended['credits'], you can increment/decrement that value whenever you need to.
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 42035
        • 90 Posts
        Thank You Sottwell,
        I will try as you said.
          Arkalp.com