Adding refunds and coupons

Just like the other two topics, there is no reliable way to implement this without more context. Coupons can be based on a percentage or a flat amount; they may also only apply to some products. Similar to how we added the tax, we could also add couponAmount.

Likewise, with refunds, creating another refundAmount field will enable you to record the amount of an order that is refunded. The transaction itself could then technically be registered as a negative transaction in the OrderPayment.swift.

As you can see, there is a lot that can be done to extend this service and make it more usable. This section should have given you an idea of how it can be done and what it should look like. Let's now summarize the entire chapter.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.191.253.149