topshelfcraft/credits

A simple starter framework for implementing credits/accounts with Craft Commerce.

Installs: 32

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 3

Forks: 1

Type:craft-plugin

3.0.1 2019-03-26 20:15 UTC

This package is auto-updated.

Last update: 2024-11-27 09:30:11 UTC


README

A simple starter framework for implementing credits/accounts with Craft Commerce.

A Top Shelf Craft creation
Michael Rog, Proprietor

Interacting with Credits accounts via command line

The Credits plugin provides commands for an admin to manually check or manipulate the balance of a credits account.

To check a balance:

./craft credits/accounts/check-balance --user=767

./craft credits/accounts/check-balance --accountId=1

./craft credits/accounts/check-balance --reference=b8d0e46d40767228493d84283fe5ac1e

To credit/debit/adjust an account:

./craft credits/accounts/credit --user=767 --amount=100

./craft credits/accounts/debit --accountId=767 --amount=100

./craft credits/accounts/adjust --reference=b8d0e46d40767228493d84283fe5ac1e --amount=-100

(As a convention, the amounts of Credits and Debits will always be positive. The amount of an Adjustment may be positive or negative.)

These adjustment actions may also include an optional note:

./craft credits/accounts/credit --user=767 --amount=100 --note="Here, have a hundo."

./craft credits/accounts/adjust --user=767 --amount=-100 --note="Oops, need that hundo back."

./craft credits/accounts/debit --user=767 --amount=100 --note="Something offline cost a hundo."

Note: The system will not object if an admin debits an account to a balance below zero.