Skip to content

simplestore: auto-complete fully digital orders once files are delivered #768

Description

@karamble

Motivation

When an order is paid, invoiceSettled
(client/resources/simplestore/simplestore.go) sends the order's digital files
and sets the status to paid. For an order that contains only digital
downloads, there is nothing left for the merchant to do once delivery succeeds,
but the order stays paid and has to be advanced to completed by hand. The
admin status flow is geared toward physical fulfillment
(placed -> shipped -> completed), so a purely digital store ends up with
orders sitting at paid indefinitely.

Proposal

After the files are sent in invoiceSettled, auto-advance the order to
completed when it is fully digital and fully delivered:

  • all items are digital (every cart item has a SendFilename) AND every file
    sent successfully -> completed
  • any physical item (an item with no SendFilename) -> stay paid (merchant
    ships and completes)
  • a file failed to send -> stay paid

The status advance re-reads the order and only completes it if it is still
paid, so a merchant status change during delivery is not overwritten.

Notes

  • Delivery already happens in invoiceSettled; this only adds the
    post-delivery completion for purely digital orders, leaving physical
    fulfillment to the merchant as today.
  • I have a patch ready and can open a PR.

Version

Present on master and v0.2.4.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions