---
title: completePayment
framework: applepayontheweb
role: symbol
role_heading: Instance Method
path: applepayontheweb/applepaysession/completepayment
---

# completePayment

Completes the payment authorization with a result.

## Declaration

```data
undefined completePayment();
```

## Parameters

- `result`: The result of the payment authorization, including its status and list of errors. See doc://com.apple.applepayontheweb/documentation/ApplePayontheWeb/ApplePayPaymentAuthorizationResult.

## Mentioned in

Apple Pay on the Web Version 3 Release Notes

## Discussion

Discussion This method must be called by onpaymentauthorized. Use status values of STATUS_SUCCESS or STATUS_FAILURE only.  You should pass in STATUS_FAILURE along with the errors. completePayment in Apple Pay JS API version 1 and 2 The parameter for completePayment in versions 1 and 2 is the following: status The status of the payment, whether it succeeded or failed. See Apple Pay Status Codes. The Apple Pay payment sheet is dismissed when this method is called with a status value of STATUS_SUCCESS or STATUS_FAILURE. Other status values display an error on the payment sheet to prompt the user to update the information and authenticate again.

## See Also

### Related Documentation

- [supportsVersion](applepayontheweb/applepaysession/supportsversion.md)

### Handling payment authorization

- [onpaymentauthorized](applepayontheweb/applepaysession/onpaymentauthorized.md)
- [ApplePayPaymentAuthorizedEvent](applepayontheweb/applepaypaymentauthorizedevent.md)
- [ApplePayPayment](applepayontheweb/applepaypayment.md)
- [ApplePayPaymentAuthorizationResult](applepayontheweb/applepaypaymentauthorizationresult.md)
