<!--
{
  "availability" : [

  ],
  "documentType" : "symbol",
  "framework" : "ApplePayontheWeb",
  "identifier" : "/documentation/ApplePayontheWeb/ApplePaySession/completePaymentMethodSelection",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Apple Pay on the Web"
    ],
    "preciseIdentifier" : "instm/ApplePaySession/completePaymentMethodSelection"
  },
  "title" : "completePaymentMethodSelection"
}
-->

# completePaymentMethodSelection

Completes the selection of a payment method with an update.

```
undefined completePaymentMethodSelection(
	ApplePayLineItem newTotal,
	sequence<ApplePayLineItem> newLineItems
);
```

## Discussion

This method must be called by [`onpaymentmethodselected`](/documentation/ApplePayontheWeb/ApplePaySession/onpaymentmethodselected) .

The parameter for the Apple Pay JS API version 3 is an [`ApplePayPaymentMethodUpdate`](/documentation/ApplePayontheWeb/ApplePayPaymentMethodUpdate) instance. Use the [`newLineItems`](/documentation/ApplePayontheWeb/ApplePayShippingMethodUpdate/newLineItems) only if you have new or updated costs or discounts, otherwise pass an empty array or null. Set the [`newTotal`](/documentation/ApplePayontheWeb/ApplePayPaymentMethodUpdate/newTotal) argument with the total cost of all the purchased items.

### completePaymentMethodSelection in Apple Pay JS API versions 1 and 2

The parameters for [`completePaymentMethodSelection`](/documentation/ApplePayontheWeb/ApplePaySession/completePaymentMethodSelection) in API versions 1 and 2 are:

`newTotal`

An [`ApplePayLineItem`](/documentation/ApplePayontheWeb/ApplePayLineItem) dictionary representing the total price for the purchase. Set the `label` to the merchant’s name, and the `amount` to the total price. The `amount` must be greater than zero.

`newLineItems`

A sequence of [`ApplePayLineItem`](/documentation/ApplePayontheWeb/ApplePayLineItem) dictionaries. Use these line items to represent all other costs or discounts.

Do not use line items to represent the individual items purchased by the user. Instead, combine all the purchases into a single subtotal item. Use additional line items to represent other costs or discounts (tax, shipping, coupons, and so forth.).

## See Also

[`supportsVersion`](/documentation/ApplePayontheWeb/ApplePaySession/supportsVersion)

Detects whether a web browser supports a particular Apple Pay version.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)