---
title: onshippingmethodselected
framework: applepayontheweb
role: symbol
role_heading: Instance Property
path: applepayontheweb/applepaysession/onshippingmethodselected
---

# onshippingmethodselected

An event handler to call when the user selects a shipping method.

## Declaration

```data
attribute EventHandler onshippingmethodselected;
```

## Discussion

Discussion This attribute must be set to a function that accepts an events argument; for example, session.onshippingmethodselected = function(event) {}. The event parameter contains the shippingMethod attribute. The onshippingmethodselected function must respond by calling completeShippingMethodSelection before the 30 second timeout, after which a message appears stating that the payment could not be completed.

## See Also

### Handling shipping method updates

- [completeShippingMethodSelection](applepayontheweb/applepaysession/completeshippingmethodselection.md)
- [ApplePayShippingMethodSelectedEvent](applepayontheweb/applepayshippingmethodselectedevent.md)
- [ApplePayShippingMethodUpdate](applepayontheweb/applepayshippingmethodupdate.md)
