iOS PassKit框架 第二章—— PKPaymentRequest

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/HDFQQ188816190/article/details/81539359

PKPaymentRequest 此类配置弹出的apple pay控制器中各内容要素

// 返回支付系统
+ (NSArray<PKPaymentNetwork> *)availableNetworks;

//
+ (NSError *)paymentContactInvalidErrorWithContactField:(PKContactField)field localizedDescription:(nullable NSString *)localizedDescription;

// 
+ (NSError *)paymentShippingAddressInvalidErrorWithKey:(NSString *)postalAddressKey localizedDescription:(nullable NSString *)localizedDescription;

// 
+ (NSError *)paymentBillingAddressInvalidErrorWithKey:(NSString *)postalAddressKey localizedDescription:(nullable NSString *)localizedDescription;

//
+ (NSError *)paymentShippingAddressUnserviceableErrorWithLocalizedDescription:(nullable NSString *)localizedDescription;

// 商家标识
@property (nonatomic, copy) NSString *merchantIdentifier;

// 国家码 eg. 美国US、中国CN
@property (nonatomic, copy) NSString *countryCode;

// 支付系统 eg. PKPaymentNetworkChinaUnionPay中国银联卡
@property (nonatomic, copy) NSArray<PKPaymentNetwork> *supportedNetworks;

// 商家支付能力 eg. PKMerchantCapabilityEMV EMV卡
@property (nonatomic, assign) PKMerchantCapability merchantCapabilities;// 订单信息要素
@property (nonatomic, copy) NSArray<PKPaymentSummaryItem *> *paymentSummaryItems;
{
    + (instancetype)summaryItemWithLabel:(NSString *)label amount:(NSDecimalNumber *)amount;
    + (instancetype)summaryItemWithLabel:(NSString *)label amount:(NSDecimalNumber *)amount type:(PKPaymentSummaryItemType)type;
    {
        PKPaymentSummaryItemType 
        PKPaymentSummaryItemTypeFinal // 最终的费用
        PKPaymentSummaryItemTypePending // 预算的费用或未知的费用
    }
}

    // 商品名
    @property (nonatomic, copy) NSString *label;

    // 价格
    @property (nonatomic, copy) NSDecimalNumber *amount;

    // 默认 PKPaymentSummaryItemTypeFinal
    @property (nonatomic, assign) PKPaymentSummaryItemType type;
}

//货币代码 eg. 人民币CNY  美元USD
@property (nonatomic, copy) NSString *currencyCode;

// 账单地址
@property (nonatomic, strong, nullable) PKContact *billingContact;
{
    @property (nonatomic, strong, nullable) NSPersonNameComponents *name; // 名字(foundation框架中的)
    @property (nonatomic, strong, nullable) CNPostalAddress *postalAddress; // 地址(contacts框架)
    @property (nonatomic, strong, nullable) CNPhoneNumber   *phoneNumber; // 手机号(contacts框架)
    @property (nonatomic, strong, nullable) NSString        *emailAddress; // 邮编
}

// 账单地址信息(11.0后可用)
@property (nonatomic, strong) NSSet<PKContactField> *requiredBillingContactFields;
{
        PKContactField;
        PKContactFieldPostalAddress;
        PKContactFieldEmailAddress;
        PKContactFieldPhoneNumber;
        PKContactFieldName;
        PKContactFieldPhoneticName;
}

// 10.0后被上一属性代替
@property (nonatomic, assign) PKAddressField requiredBillingAddressFields;

// 运送地址
@property (nonatomic, strong, nullable) PKContact *shippingContact;

// 运送地址信息
@property (nonatomic, strong) NSSet<PKContactField> *requiredShippingContactFields;

// 10.0后被上一属性代替
@property (nonatomic, assign) PKAddressField requiredShippingAddressFields;

// 运送方式数组
@property (nonatomic, copy, nullable) NSArray<PKShippingMethod *> *shippingMethods;

// 运送方式,8.3可用
@property (nonatomic, assign) PKShippingType shippingType;
{
    typedef NS_ENUM(NSUInteger, PKShippingType) {
        PKShippingTypeShipping,// 第三方运送
        PKShippingTypeDelivery,// 卖家运送
        PKShippingTypeStorePickup,// 上门取货
        PKShippingTypeServicePickup // 服务收件
    } ;
}

// 
@property (nonatomic, copy, nullable) NSData *applicationData;

// Set of two-letter ISO 3166 country codes. 能支持的国家码(11.0后可用)
@property (nonatomic, copy, nullable) NSSet<NSString *> *supportedCountries;

-- NORMAL --

猜你喜欢

转载自blog.csdn.net/HDFQQ188816190/article/details/81539359