Contents

PKRecurringPaymentSummaryItem

An object that defines a summary item for a payment that occurs repeatedly at a specified interval, such as a subscription.

Declaration

class PKRecurringPaymentSummaryItem

Overview

PKRecurringPaymentSummaryItem is a subclass of PKPaymentSummaryItemType and inherits all properties of the parent class.

Add a summary item of this type to the paymentSummaryItems property of a PKPaymentRequest to display to the user a recurring payment in the summary items on the payment sheet.

To describe a recurring payment, set the summary item values as follows:

For example, the following code shows a summary item that specifies six monthly payments that start on the transaction date:

let recurringPayment = PKRecurringPaymentSummaryItem(label: "Total Payment",                                                  NSDecimalNumber(string: "199.99"))

// Payment starts today.
recurringPayment.startDate = nil

// Pay once a month.
recurringPayment.intervalUnit = .month
recurringPayment.intervalCount = 1

// Make 5 more payments for a total of 6 payments.
var dateComponent = DateComponents()
dateComponent.month = 5
recurringPayment.endDate = Calendar.current.date(byAdding: dateComponent, Date())

The payment interval is a combination of the intervalUnit and the intervalCount. For example, if you set the intervalUnit to .month and intervalCount to 3, then the payment interval is three months.

Topics

Setting the payment period

Setting the payment interval

See Also

Setting the payment summary items