---
title: "paymentAuthorizationViewController(_:didChangeCouponCode:handler:)"
framework: passkit
role: symbol
role_heading: Instance Method
path: "passkit/pkpaymentauthorizationviewcontrollerdelegate/paymentauthorizationviewcontroller(_:didchangecouponcode:handler:)"
---

# paymentAuthorizationViewController(_:didChangeCouponCode:handler:)

Tells the delegate that the user entered or updated a coupon code.

## Declaration

```swift
optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didChangeCouponCode couponCode: String, handler completion: @escaping @Sendable (PKPaymentRequestCouponCodeUpdate) -> Void)
```

```swift
optional func paymentAuthorizationViewController(_ controller: PKPaymentAuthorizationViewController, didChangeCouponCode couponCode: String) async -> PKPaymentRequestCouponCodeUpdate
```

## Parameters

- `controller`: The payment authorization view controller.
- `couponCode`: The coupon code.
- `completion`: The completion handler to call with the updated payment summary items and shipping methods.
