S++Business systems language
DEMO SOURCE · SPP / APP / PHYRead the book

petshop-scene-payShopOrder.spp

petshop/payment/petshop-scene-payShopOrder.spp

Download original file · Petstore source contents

1domain petshop;23Scenario serial payShopOrder(Buyer, Merchant, ShopOrder, PaymentAgreement) {4    checkBuyerCredential;5    initializePaymentAgreement;6    configureMerchantLookup;7    parallel {8        findBuyer;9        findMerchant;10    }11    identify(Buyer);12    identify(Merchant);13    findShopOrder;14    identify(ShopOrder);15    checkOrderOwner;16    checkPaymentEligibility;17    preparePayment;18    preparePaymentAgreementReceipt;19    transaction {20        transaction REQUIRED {21            payOrderFunds bounds {22                Buyer.wallet: [0, null];23                Merchant.cash: [0, null];24            };25        }26        updateShopOrder;27        insertReceipt(PaymentAgreement.receipt);28    }29}