Skip to content

Instantly share code, notes, and snippets.

@wvega
Last active December 19, 2015 15:29
Show Gist options
  • Save wvega/5976534 to your computer and use it in GitHub Desktop.
Save wvega/5976534 to your computer and use it in GitHub Desktop.

Credit System

AWPCP 3.0 or newer includes a feature that allow Ads and Subscriptions to be paid using credit. Each registered user has now a balance associated to his/her account. The balance starts at zero but users can purchase credit from the Admin Dashboard using regular payment methods or administrators can add (and remove) credit to the user's accounts.

How to enable the Credit System

The Credit System has to be enabled from the Payment Settings. Just check the Enable Credit System checkbox and save the settings.

screenshot

Please note that Charge Listing Fee has to be checked as well (Pay mode must be enabled) in order to have the Credit System enabled. AWPCP will automatically enable Pay mode for you if you forget to do it :).

The Credit System can also be enabled from the new Credit Plans submenu under Classifieds:

screenshot

How to setup Credit Plans

If you want your users to be able to add credit to the their accounts, you need to define Credit Plans. A credit plan is what allow users to exchange real money for credits in your website. Each plan is just package that gives to the buyer user, a number of credits for a certain price.

To create credit plans, go to the Credit Plans submenu, under Classifieds menu, and click the Ad Credit Button. Fill in the credit plan details: name, description, credits and price and then click the Add button.

screenshot-3

How to setup payment terms

The new Fees admin screen allows administrators to define the price in credits and in money for each registered Fee.

screenshot

The Subcription Plans admin screen also allows administrators to define a price in credits and a price in money.

screenshot

How to add credit to user accounts

An administrator can add or remove credit from user's accounts from the Manage Credit section, in the Admin Dashboard. Adding or removing credit from an user account is useful if you want to give a gift to one of your users or if you use offline payment methods, to name a couple of cases.

The Manage Credit section is the standard WP Users table, with an additional column to show each user's balance. To access the section go to the Manage Credit submenu under the Classifieds menu.

24937892-e9b5-11e2-9157-ef2b76677fde-3

Move the pointer over the Account Balance column and you'll see actions to Add Credit and Remove Credit:

users__awpcp_test_blog__wordpress

Clicking any of the actions will replace that row with a small form to Add or Remove credit from that user. Type the number of credits and click the blue button. The account balance for the selected user will be updated.

screenshot

How to purchase credit (for regular Users)

Regular users have a new item, Account Balance, in their version of the Admin Dashboard. The Account Balance section will show the current balance and allow users to purchase additional credit plans to increase their balance.

screenshot

Clicking the Add Credit button will start the checkout process showing a list of available Credit Plans:

screenshot

The rest of the process continues as any other purchase in AWPCP and in the end, if the payment is successful, the account balance will show the newly acquired credits.

How to Place Ads using credit

In AWPCP 3.0 or newer, users start the Place Ad process choosing a category and a payment term. The Payment Term controls the number of images that can be uploaded, the number of characters allowed in the Ad title and Ad details and the price the user has to pay. When the Credit System is enabled, the price of the payment term is shown both in money and in credits.

screenshot

When the user selects a category, the list of available payment terms updates itself showing those are suitable for the selected category only. The user then proceeds to select a payment term and a method of payment: credits or money. If the user selects money, the process continues normally and the user has to pay for the Ad using one of the available payment methods (PayPal, 2Checkout, Authorize.net and others).

The user can see the current account balance in the top part of the form.

screenshot

The user can purchase a credit plan while trying to place an Ad, all in the same transaction. This feature is very useful if the user has no enough credits to pay for the selected payment term. The number of credits in the selected credit plan, if any, added to the number of credits in the users's account, should be equal or greater than the cost of the payment term.

screenshot

If the user decides to purchase a credit plan in addition to the selected payment term. The user would have to go through the standard payment process and use one of the available payment methods to pay for the credit plan. At the end of process, if payment was successful the number of credits in newly acquired credit plan will be added to his/her account balance, and then, the cost of the payment term will be deducted. After that, the user continues entering the Ad details and uploading images.

screenshot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment