---
title: "paymentAuthorizationController(_:didChangeCouponCode:handler:)"
framework: passkit
role: symbol
role_heading: Instance Method
path: "passkit/pkpaymentauthorizationcontrollerdelegate/paymentauthorizationcontroller(_:didchangecouponcode:handler:)"
---

# paymentAuthorizationController(_:didChangeCouponCode:handler:)

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

## Declaration

```swift
@MainActor optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didChangeCouponCode couponCode: String, handler completion: @escaping (PKPaymentRequestCouponCodeUpdate) -> Void)
```

```swift
@MainActor optional func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didChangeCouponCode couponCode: String) async -> PKPaymentRequestCouponCodeUpdate
```

## Parameters

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