EARS: When a seller pays for order items, the system shall accept the payment only if it is made before the items' payment time limits and its requested amounts add up to their price, and shall charge each payment method its requested amount plus its surcharge.
Story: As an airline, I want each payment checked against the items it pays for, so that items are paid in full and on time, and each method is charged its amount plus its surcharge.
Acceptance criteria:
-
ONE-304.1: When the airline accepts a payment, the system shall charge each payment method its requested amount plus its surcharge.
-
ONE-304.2: If the requested amounts of a payment do not add up to the price of the order items it covers, then the system shall reject the payment.
-
ONE-304.3: When the airline accepts a payment, the system shall charge in total the price of the order items it covers plus the surcharges of its payment methods.
-
ONE-304.4: If a payment is made at or after the payment time limit of an order item it covers, then the system shall reject the payment.
-
ONE-304.5: If a payment uses the commitment method with an amount other than zero, then the system shall reject the payment.
-
ONE-304.6: If a payment uses the commitment method for order items with an amount to pay, then the system shall reject the payment.
-
ONE-304.7: If a payment has no payment method, then the system shall reject the payment.
The checks run in this order: payment time limits, a payment method present, currencies, commitment amounts, commitments for items with an amount to pay, and the requested total. The result is the amount charged to each method, in the order of the methods.