S++Business systems language
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, "ORDER_NOT_PAYABLE");5    require(Buyer.wallet >= ShopOrder.total, "INSUFFICIENT_FUNDS");6}