Skip to the content
Documentation
Help Start
Reading in:
  • German: 9,199 of 9,199 pages
About the help in other languages
All help pages

Architecture

expmkt_seller, expmkt_app, expmkt_purchase, expmkt_license, expmkt_refund, expmkt_payout, expmkt_review, expmkt_invoice, expmkt_strike, expmkt_stat, expmkt_mail, expmkt_event. One definition…

Download as PDF

Address: https://doc.exponential.earth/learninminutes/exphelp/viewer/ext/exp_app_market/ARCHITECTURE.md

On this page

Architecture

Parts

Class
expAppMarketsettings, the store, paid sales on or off, minimums, commission
expAppMarketMoney, expAppMarketSplit, expAppMarketTax, expAppMarketPricingpure rules: amounts, the split, tax, prices and promotions
expAppMarketPaymentProvider and expAppMarketStripe, expAppMarketPaypal, expAppMarketTronPayhosted payments, confirmation, webhooks, refunds, payouts
expAppMarketCheckouta purchase from start to license; renewals; the daily run
expAppMarketSeller, expAppMarketPartner, expAppMarketScoresellers, partner levels, the public score, strikes
expAppMarketApp, expAppMarketPurchase, expAppMarketLicense, expAppMarketInvoicethe persistent rows
expAppMarketRefund, expAppMarketPayout, expAppMarketReviewrefunds, payouts, reviews
expAppMarketIssuer (Local, Remote, Null)registry license keys
expAppMarketSignedURLsigned download links
expAppMarketMail, expAppMarketQueueHandler, expAppMarketSupportmail through expqueue, tickets
expAppMarketSchema, expAppMarketObjectthe tables on five engines
expAppMarketCommand, expAppMarketViewconsole commands, the views' shared code

Tables

expmkt_seller, expmkt_app, expmkt_purchase, expmkt_license, expmkt_refund, expmkt_payout, expmkt_review, expmkt_invoice, expmkt_strike, expmkt_stat, expmkt_mail, expmkt_event. One definition (expAppMarketSchema::definition()) generates share/db_schema.dba, sql/<engine>/schema.sql and sql/mongodb/schema.json; install-schema creates and upgrades them with the kernel's schema handler of the database. Money is in minor units (cents). The kernel shop's ezorder and ezproductcollection hold the checkout (account identifier appmarket); a purchase points at its order, which is activated and marked delivered when paid.

A purchase

  1. market/buy/<app>: tier, payment method, country, VAT id, coupon, acceptance of the terms.
  2. market/checkout (expAppMarketCheckout::start): the quote, the seller's tax for the buyer's country, a temporary kernel order, the purchase row, a claim token (its SHA-256 and the public key of a key pair derived from it are stored), the provider's hosted payment page.
  3. The buyer pays there. The provider's webhook (market/webhook/<provider>) or the return (market/return/<id>) completes the purchase (complete(), idempotent and guarded against a double run): the amount is checked; the split is computed with the provider's real fee; the order is activated; the license and its registry key are made; the key is sealed to the claim key pair (only the token opens it); the invoice in the seller's name is issued; the receipt with the key and the install commands is mailed (the mail's body is removed once sent).
  4. The return page opens the sealed key with the token in the buyer's session and shows it once. A purchase from a site's admin goes back to the site with the token instead; the site claims the key once at market/api/claim.
  5. Renewals come from the provider (invoice.paid, PAYMENT.SALE.COMPLETED): a new payment row, its split and invoice; the license and its key move to the new period end. Crypto subscriptions renew by hand on a reminder.
  6. The daily run: reminders, lapses, refunds past the seller's days, partner checks, security deadlines, crypto checks.

Security

  • No card data on the store: hosted pages only. Webhooks are verified (Stripe HMAC with a 5-minute tolerance, PayPal's verification API). Live keys are refused in test mode; live providers while paid sales are off.
  • No license key is stored readable: the registry keeps its SHA-256; the market keeps a sealed box that only the buyer's claim token opens; the receipt mail's body is removed after sending; the queue's payload has only an id.
  • Download links are HMAC-signed with an expiry, the buyer and the version; the license is checked on every use. Downloads are logged with a hashed address; many addresses for one license in a day raise a flag.

Something wrong on this page? Report an error

Documentation license

This page is part of the documentation of the extension exp_app_market and is distributed under the license of that extension.