After identifying the main actors and operations involved in the payment authorization workflow and with a single method to compute payment summary items, we are ready to delve into your responses to payment sheet messages initiated by the changes the user makes to shipping information.
Note that the correct functionality of the payment sheet is essential to the payment authorization workflow; in particular, the payment sheet must call its delegate methods consistently so that you can correctly gauge when these methods are called as a result of user interaction with the payment sheet. If you use iOS simulators to test your code and notice that the payment sheet delegate methods are not being called, quit and restart the Simulator app.