S++Core systems, human-reviewable
DEMO SOURCE · SPP / APP / PHYRead the book

petshop-05-checks.spp

petshop/payment/petshop-05-checks.spp

Download original file · Petstore source contents

1domain petshop;23atomic check checkPaymentEligibility(Buyer, ShopOrder) {4    require(shopOrder.status == OrderStatus.UNPAID, RejectionCode.ORDER_NOT_PAYABLE);5    require(buyer.wallet >= shopOrder.total, RejectionCode.INSUFFICIENT_FUNDS);6}