Store/Purchase Flow

Purchase Flow

What happens from a click to a delivered reward, the commands and troubleshooting.

Posting a Panel

Run /store panel and pick:

OptionWhat to enter
panelThe panel ID. It autocompletes.
channelWhere to post it.

Panels keep working after restarts. If you change a panel's products, post it again.

What the Buyer Sees

  1. They pick a product. If they already have its role reward, or have bought it max_purchases times, they are told they already own it.
  2. They pick how to pay. Only when the product has more than one provider.
  3. They get a checkout link. A private message with a button to the provider's checkout page.
  4. They pay. On Stripe, PayPal, Razorpay, Polar or NOWPayments. After paying they are sent back to your server's invite link.
  5. The message changes to Paid. As soon as the provider's webhook arrives.
  6. They get their rewards and a receipt by DM.
ProviderCheckout
StripeStripe Checkout page
PayPalPayPal approval page
RazorpayRazorpay payment link
PolarPolar checkout page
CryptoNOWPayments invoice

When a Payment Completes

When the provider's webhook arrives, Store:

  1. Finds the product from the details saved with the checkout.
  2. Runs each reward.
  3. Saves the purchase.
  4. Updates the buyer's checkout message to Paid.
  5. DMs the buyer a receipt.
  6. Posts a log in store-logs.

If a reward fails, such as a role that no longer exists, the purchase is still saved as completed with errors and the log shows what went wrong. The provider still gets a success reply, so it does not keep retrying. Fix the problem and give the reward by hand.

Looking Up Purchases

/store lookup searches saved purchases. Use any of these together:

OptionFilters by
userThe buyer.
transactionidThe provider's transaction ID.
emailThe email the buyer paid with.
dateA day, as YYYY-MM-DD.

Commands

CommandWhat it does
/store panelPost a panel.
/store lookupSearch purchases.

Both need the store_command permission level.

Troubleshooting

ProblemFix
The checkout link never appearsCheck the console. The provider's keys are probably wrong or missing.
"Payment provider is not configured"The product uses a provider that is not in providers.
Paid but nothing happenedThe webhook did not reach AthenaBot. Check the provider's webhook log for errors, that the URL uses your domain, and that the reverse proxy points at port 3111.
Webhook returns 400 or 403The webhook secret does not match. Copy it again from the provider.
Webhook returns 500That provider's keys or webhook secret are missing from store.json5.
Role not givenAthenaBot's role must be above the reward role. The error is in store-logs.
No receipt DMThe buyer has DMs from server members turned off.