文章出处:http://blog.csdn.net/sz_vcp2007/article/details/52524616
(1)PassKit.h
定义该框架下所有的类的引用
(2)PKAddPassButton.h
定义【添加到钱包】按钮,按钮定义了两种类型:1、PKAddPassButtonStyleBlack;2、PKAddPassButtonStyleBlackOutline
同时该类定义了两种构造方法:1、+ (instancetype)addPassButtonWithStyle:(PKAddPassButtonStyle)addPassButtonStyle;
2、- (instancetype)initWithAddPassButtonStyle:(PKAddPassButtonStyle)style NS_DESIGNATED_INITIALIZER;
(3)PKObject.h 直接继承于NSObject
(4) PKPaymentPass继承于PKPass
1、PKPaymentPassActivationState 枚举类型,包含:
PKPaymentPassActivationStateActivated,(已激活)
PKPaymentPassActivationStateRequiresActivation,(需要被激活)
PKPaymentPassActivationStateActivating,(正在激活)
PKPaymentPassActivationStateSuspended, (挂起)
PKPaymentPassActivationStateDeactivated (停用)
2、包含的属性:
primaryAccountIdentifier :主账户标识
primaryAccountNumberSuffix:主账户的后缀,一般是后面4到5个数字
deviceAccountIdentifier:特定于设备的帐号的唯一标识符。(只读)
deviceAccountNumberSuffix:设备账号的后缀,一般是后面4到5个数字
activationState:上面PKPaymentPassActivationState枚举值之一
(4)PKPass.h 继承于PKObject.h
1、PKPassType:枚举类型,包含:
PKPassTypeBarcode:条码
PKPassTypePayment:支付
PKPassTypeAny:其它类型
构造方法:- (instancetype)initWithData:(NSData *)data error:(NSError **)error;
2、属性:
(1)PKPassType:Pass类型
(2)PKPaymentPass:PKPaymentPass对象类型
(3)serialNumber:标识pass的唯一值
(4)passTypeIdentifier:pass类型的唯一值
(5)webServiceURL:更新pass的URL地址
(6)localizedName:pass模板的本地名称
(7)localizedDescription:本地化描述
(8)organizationName:组织名称
(9)relevantDate:时间
(10)icon:图标
(11)userInfo:用户信息
(12)passURL:在pass APP里面打开pass的地址,作为URL的参数调用openURL: method of UIApplication.
(13)remotePass:指示pass是否存储在本地iOS设备上
(14)deviceName:设备名称
(5)PKConstants.h
包含以下几种类型:
1、PKEncryptionSchemeECC_V2 :支持Apple pay卡加密
2、PKPaymentNetworkAmex:美国运通
3、PKPaymentNetworkChinaUnionPay:中国银联
4、PKPaymentNetworkDiscover:discover网络
5、PKPaymentNetworkInterac:interac网络
6、PKPaymentNetworkMasterCard:万事达卡
7、PKPaymentNetworkPrivateLabel
8、PKPaymentNetworkVisa:visa
(6)PKContact.h
1、name:NSPersonNameComponents类型,名字
2、postalAddress:CNPostalAddress类型,邮编
3、emailAddress:邮件
4、phoneNumber:CNPhoneNumber类型,手机号码
5、supplementarySubLocality:
(7)PKError.h
错误码:PKPassKitErrorCode,枚举类型:
PKUnknownError、
PKInvalidDataError、
PKUnsupportedVersionError、
PKInvalidSignature
(8)PKPassLibrary.h
当把pass添加到pass libarary后的状态:PKPassLibraryAddPassesStatus,类型:
PKPassLibraryDidAddPasses、
PKPassLibraryShouldReviewPasse、
PKPassLibraryDidCancelAddPasses
PKAutomaticPassPresentationSuppressionResult 枚举值:
PKAutomaticPassPresentationSuppressionResultNotSupported、
PKAutomaticPassPresentationSuppressionResultAlreadyPresenting、
PKAutomaticPassPresentationSuppressionResultDenied、
PKAutomaticPassPresentationSuppressionResultCancelled、
PKAutomaticPassPresentationSuppressionResultSuccess
请求令牌:PKSuppressionRequestToken
构造方法:
+ (BOOL)isPassLibraryAvailable
pass library是否可用
+ (PKSuppressionRequestToken)requestAutomaticPassPresentationSuppressionWithResponseHandler:(void(^)(PKAutomaticPassPresentationSuppressionResult result))responseHandler
当设备遇到非接字段时,临时使自动展示不可用
+ (void)endAutomaticPassPresentationSuppressionWithRequestToken:(PKSuppressionRequestToken)requestToken
重新使Apple pay接口可用
+ (BOOL)isSuppressingAutomaticPassPresentation
指示系统是否支持 Apple Pay passes的自动展示.
- (BOOL)isPaymentPassActivationAvailable
支付pass是否可激活
- (NSArray<PKPass *> *)passes;
返回本地标题为可访问的pass
- (nullable PKPass *)passWithPassTypeIdentifier:(NSString *)identifier serialNumber:(NSString *)serialNumber;
返回指定pass的类型
- (NSArray<PKPass *> *)passesOfType:(PKPassType)passType
返回所有的pass
- (NSArray<PKPaymentPass *> *)remotePaymentPasses
移除pass
- (void)removePass:(PKPass *)pass
判断是否包含pass
- (BOOL)containsPass:(PKPass *)pass
替换pass
- (BOOL)replacePassWithPass:(PKPass *)pass
添加pass,完成后把添加的状态回调传回
- (void)addPasses:(NSArray<PKPass *> *)passes withCompletionHandler:(nullable void(^)(PKPassLibraryAddPassesStatus status))completion
打开支付安装流程
- (void)openPaymentSetup
// 支持在当前设备或附件添加主账户不存在的卡
- (BOOL)canAddPaymentPassWithPrimaryAccountIdentifier:(NSString *)primaryAccountIdentifier
// 下面2个方法激活pay pass
- (void)activatePaymentPass:(PKPaymentPass *)paymentPass withActivationData:(NSData *)activationData completion:(nullable void(^)(BOOL success, NSError* error))completion __WATCHOS_PROHIBITED NS_AVAILABLE_IOS(8_0);
- (void)activatePaymentPass:(PKPaymentPass *)paymentPass withActivationCode:(NSString *)activationCode completion:(nullable void(^)(BOOL success, NSError* error))completion __WATCHOS_PROHIBITED NS_DEPRECATED_IOS(8_0, 9_0, "Use activatePaymentPass:withActivationData:completion: instead");
// 下面是2个通知
extern NSString * const PKPassLibraryDidChangeNotification NS_AVAILABLE_IOS(6_0);
extern NSString * const PKPassLibraryRemotePaymentPassesDidChangeNotification NS_AVAILABLE_IOS(9_0);
其中,PKPassLibraryDidChangeNotification有下面一些key:
PKPassLibraryAddedPassesUserInfoKey、
PKPassLibraryReplacementPassesUserInfoKey、
PKPassLibraryRemovedPassInfosUserInfoKey、
PKPassLibraryPassTypeIdentifierUserInfoKey、
PKPassLibrarySerialNumberUserInfoKey
(9)PKPayment.h
代表了付款结果
包含下面几个属性:
1、token:包含加密后的支付凭证
2、PKContact *billingContact:计费地址
3、shippingContact:邮递地址
4、shippingMethod:邮递方式
(10)PKPaymentAuthorizationViewController.h
PKPaymentAuthorizationStatus 枚举值:
PKPaymentAuthorizationStatusSuccess 支付授权成功
PKPaymentAuthorizationStatusFailure 支付授权失败
PKPaymentAuthorizationStatusInvalidBillingPostalAddress 计费地址错误
PKPaymentAuthorizationStatusInvalidShippingPostalAddress 投递地址错误
PKPaymentAuthorizationStatusInvalidShippingContact 提供联系信息是不够的
PKPaymentAuthorizationStatusPINRequired 需要PIN 个人身份唯一标识
PKPaymentAuthorizationStatusPINIncorrect 错误的PIN
PKPaymentAuthorizationStatusPINLockout PIN被锁
代理:PKPaymentAuthorizationViewControllerDelegate
必须要执行的方法:
当用户支付请求时候执行
1、- (void)paymentAuthorizationViewController:(PKPaymentAuthorizationViewController *)controller
didAuthorizePayment:(PKPayment *)payment
completion:(void (^)(PKPaymentAuthorizationStatus status))completion
当支付完成的时候
2、- (void)paymentAuthorizationViewControllerDidFinish:(PKPaymentAuthorizationViewController *)controller
可选的执行方法:
1、- (void)paymentAuthorizationViewControllerWillAuthorizePayment:(PKPaymentAuthorizationViewController *)controller
当选择了新的邮递方式之后
2、- (void)paymentAuthorizationViewController:(PKPaymentAuthorizationViewController *)controller
didSelectShippingMethod:(PKShippingMethod *)shippingMethod
completion:(void (^)(PKPaymentAuthorizationStatus status, NSArray<PKPaymentSummaryItem *> *summaryItems))completion
3、重新选择联系地址后
- (void)paymentAuthorizationViewController:(PKPaymentAuthorizationViewController *)controller
didSelectShippingContact:(PKContact *)contact
completion:(void (^)(PKPaymentAuthorizationStatus status, NSArray<PKShippingMethod *> *shippingMethods,
NSArray<PKPaymentSummaryItem *> *summaryItems))completion NS_AVAILABLE_IOS(9_0);
4、重新选择支付卡
- (void)paymentAuthorizationViewController:(PKPaymentAuthorizationViewController *)controller
didSelectPaymentMethod:(PKPaymentMethod *)paymentMethod
completion:(void (^)(NSArray<PKPaymentSummaryItem *> *summaryItems))completion NS_AVAILABLE_IOS(9_0);
方法:
测试设备是否能支付
1、+ (BOOL)canMakePayments;
测试是否支持支付网络
2、+ (BOOL)canMakePaymentsUsingNetworks:(NSArray<NSString *> *)supportedNetworks;
测试是否支持支付网络和支付类别,类别在PKMerchantCapability枚举中查看
3、+ (BOOL)canMakePaymentsUsingNetworks:(NSArray<NSString *> *)supportedNetworks capabilities:(PKMerchantCapability)capabilties NS_AVAILABLE_IOS(9_0);
构造方法
- (instancetype)initWithPaymentRequest:(PKPaymentRequest *)request
(10)PKPaymentButtonStyle.h
PKPaymentButtonStyle 样式类型枚举
PKPaymentButtonStyleWhite
PKPaymentButtonStyleWhiteOutline
PKPaymentButtonStyleBlack
PKPaymentButtonType 类型枚举
PKPaymentButtonTypePlain
PKPaymentButtonTypeBuy
PKPaymentButtonTypeSetUp
构造方法:
+ (instancetype)buttonWithType:(PKPaymentButtonType)buttonType style:(PKPaymentButtonStyle)buttonStyle;
- (instancetype)initWithPaymentButtonType:(PKPaymentButtonType)type paymentButtonStyle:(PKPaymentButtonStyle)style
(11)PKPaymentMethod.h
1、枚举类型:PKPaymentMethodType
PKPaymentMethodTypeUnknown、
PKPaymentMethodTypeDebit、借记
PKPaymentMethodTypeCredit、 贷记
PKPaymentMethodTypePrepaid、预付
PKPaymentMethodTypeStore
属性:
1、displayName:显示名称
2、network:支付网络
3、type :刚才定义的PKPaymentMethodType其中一个值
4、paymentPass:
(12)PKPaymentRequest.h
PKMerchantCapability枚举:商户支持的支付方式
PKMerchantCapability3DS、 Merchant supports 3DS
PKMerchantCapabilityEMV、
PKMerchantCapabilityCredit、
PKMerchantCapabilityDebit
PKAddressField:地址字段
PKAddressFieldNone、
PKAddressFieldPostalAddress、
PKAddressFieldPhone、
PKAddressFieldEmail、
PKAddressFieldName、
PKAddressFieldAll
PKShippingType:邮递方式
PKShippingTypeShipping、
PKShippingTypeDelivery、
PKShippingTypeStorePickup、
PKShippingTypeServicePickup
PKPaymentSummaryItemType:支付总的信息
PKPaymentSummaryItemTypeFinal、
PKPaymentSummaryItemTypePending
PKPaymentSummaryItem接口:定义一个单项的付款明细
+ (instancetype)summaryItemWithLabel:(NSString *)label amount:(NSDecimalNumber *)amount;
+ (instancetype)summaryItemWithLabel:(NSString *)label amount:(NSDecimalNumber *)amount type:(PKPaymentSummaryItemType)type NS_AVAILABLE(NA, 9_0);
包含属性:
1、label:item的简单描述
2、amount:item的金额
3、type:PKPaymentSummaryItemType其中类型
PKShippingMethod接口:PKPaymentSummaryItem
1、identifier、邮递标识
2、detail、邮递明细
PKPaymentRequest.h接口
1、merchantIdentifier:商家和苹果协议好的商家标志
2、countryCode、国际区号
3、supportedNetworks、支付的网络
4、merchantCapabilities、商家支付方式
5、paymentSummaryItems、支付总信息
6、currencyCode、货币吗
7、requiredBillingAddressFields:购买地址
8、billingContact:如果商家有购买地址,则写在这里
9、requiredShippingAddressFields:邮寄地址需要
10、shippingContact:邮寄联系人
11、shippingMethods: 邮寄方法
12、shippingType:邮寄方式
13、applicationData:应用程序数据
(13)PKPaymentToken
1、paymentMethod、支付方式
2、transactionIdentifier、交易标识
3、paymentData、加密数据
(2)PKAddPassButton.h
定义【添加到钱包】按钮,按钮定义了两种类型:1、PKAddPassButtonStyleBlack;2、PKAddPassButtonStyleBlackOutline
同时该类定义了两种构造方法:1、+ (instancetype)addPassButtonWithStyle:(PKAddPassButtonStyle)addPassButtonStyle;
2、- (instancetype)initWithAddPassButtonStyle:(PKAddPassButtonStyle)style NS_DESIGNATED_INITIALIZER;
(3)PKObject.h 直接继承于NSObject
(4) PKPaymentPass继承于PKPass
1、PKPaymentPassActivationState 枚举类型,包含:
PKPaymentPassActivationStateActivated,(已激活)
PKPaymentPassActivationStateRequiresActivation,(需要被激活)
PKPaymentPassActivationStateActivating,(正在激活)
PKPaymentPassActivationStateSuspended, (挂起)
PKPaymentPassActivationStateDeactivated (停用)
2、包含的属性:
primaryAccountIdentifier :主账户标识
primaryAccountNumberSuffix:主账户的后缀,一般是后面4到5个数字
deviceAccountIdentifier:特定于设备的帐号的唯一标识符。(只读)
deviceAccountNumberSuffix:设备账号的后缀,一般是后面4到5个数字
activationState:上面PKPaymentPassActivationState枚举值之一
(4)PKPass.h 继承于PKObject.h
1、PKPassType:枚举类型,包含:
PKPassTypeBarcode:条码
PKPassTypePayment:支付
PKPassTypeAny:其它类型
构造方法:- (instancetype)initWithData:(NSData *)data error:(NSError **)error;
2、属性:
(1)PKPassType:Pass类型
(2)PKPaymentPass:PKPaymentPass对象类型
(3)serialNumber:标识pass的唯一值
(4)passTypeIdentifier:pass类型的唯一值
(5)webServiceURL:更新pass的URL地址
(6)localizedName:pass模板的本地名称
(7)localizedDescription:本地化描述
(8)organizationName:组织名称
(9)relevantDate:时间
(10)icon:图标
(11)userInfo:用户信息
(12)passURL:在pass APP里面打开pass的地址,作为URL的参数调用openURL: method of UIApplication.
(13)remotePass:指示pass是否存储在本地iOS设备上
(14)deviceName:设备名称
(5)PKConstants.h
包含以下几种类型:
1、PKEncryptionSchemeECC_V2 :支持Apple pay卡加密
2、PKPaymentNetworkAmex:美国运通
3、PKPaymentNetworkChinaUnionPay:中国银联
4、PKPaymentNetworkDiscover:discover网络
5、PKPaymentNetworkInterac:interac网络
6、PKPaymentNetworkMasterCard:万事达卡
7、PKPaymentNetworkPrivateLabel
8、PKPaymentNetworkVisa:visa
(6)PKContact.h
1、name:NSPersonNameComponents类型,名字
2、postalAddress:CNPostalAddress类型,邮编
3、emailAddress:邮件
4、phoneNumber:CNPhoneNumber类型,手机号码
5、supplementarySubLocality:
(7)PKError.h
错误码:PKPassKitErrorCode,枚举类型:
PKUnknownError、
PKInvalidDataError、
PKUnsupportedVersionError、
PKInvalidSignature
(8)PKPassLibrary.h
当把pass添加到pass libarary后的状态:PKPassLibraryAddPassesStatus,类型:
PKPassLibraryDidAddPasses、
PKPassLibraryShouldReviewPasse、
PKPassLibraryDidCancelAddPasses
PKAutomaticPassPresentationSuppressionResult 枚举值:
PKAutomaticPassPresentationSuppressionResultNotSupported、
PKAutomaticPassPresentationSuppressionResultAlreadyPresenting、
PKAutomaticPassPresentationSuppressionResultDenied、
PKAutomaticPassPresentationSuppressionResultCancelled、
PKAutomaticPassPresentationSuppressionResultSuccess
请求令牌:PKSuppressionRequestToken
构造方法:
+ (BOOL)isPassLibraryAvailable
pass library是否可用
+ (PKSuppressionRequestToken)requestAutomaticPassPresentationSuppressionWithResponseHandler:(void(^)(PKAutomaticPassPresentationSuppressionResult result))responseHandler
当设备遇到非接字段时,临时使自动展示不可用
+ (void)endAutomaticPassPresentationSuppressionWithRequestToken:(PKSuppressionRequestToken)requestToken
重新使Apple pay接口可用
+ (BOOL)isSuppressingAutomaticPassPresentation
指示系统是否支持 Apple Pay passes的自动展示.
- (BOOL)isPaymentPassActivationAvailable
支付pass是否可激活
- (NSArray<PKPass *> *)passes;
返回本地标题为可访问的pass
- (nullable PKPass *)passWithPassTypeIdentifier:(NSString *)identifier serialNumber:(NSString *)serialNumber;
返回指定pass的类型
- (NSArray<PKPass *> *)passesOfType:(PKPassType)passType
返回所有的pass
- (NSArray<PKPaymentPass *> *)remotePaymentPasses
移除pass
- (void)removePass:(PKPass *)pass
判断是否包含pass
- (BOOL)containsPass:(PKPass *)pass
替换pass
- (BOOL)replacePassWithPass:(PKPass *)pass
添加pass,完成后把添加的状态回调传回
- (void)addPasses:(NSArray<PKPass *> *)passes withCompletionHandler:(nullable void(^)(PKPassLibraryAddPassesStatus status))completion
打开支付安装流程
- (void)openPaymentSetup
// 支持在当前设备或附件添加主账户不存在的卡
- (BOOL)canAddPaymentPassWithPrimaryAccountIdentifier:(NSString *)primaryAccountIdentifier
// 下面2个方法激活pay pass
- (void)activatePaymentPass:(PKPaymentPass *)paymentPass withActivationData:(NSData *)activationData completion:(nullable void(^)(BOOL success, NSError* error))completion __WATCHOS_PROHIBITED NS_AVAILABLE_IOS(8_0);
- (void)activatePaymentPass:(PKPaymentPass *)paymentPass withActivationCode:(NSString *)activationCode completion:(nullable void(^)(BOOL success, NSError* error))completion __WATCHOS_PROHIBITED NS_DEPRECATED_IOS(8_0, 9_0, "Use activatePaymentPass:withActivationData:completion: instead");
// 下面是2个通知
extern NSString * const PKPassLibraryDidChangeNotification NS_AVAILABLE_IOS(6_0);
extern NSString * const PKPassLibraryRemotePaymentPassesDidChangeNotification NS_AVAILABLE_IOS(9_0);
其中,PKPassLibraryDidChangeNotification有下面一些key:
PKPassLibraryAddedPassesUserInfoKey、
PKPassLibraryReplacementPassesUserInfoKey、
PKPassLibraryRemovedPassInfosUserInfoKey、
PKPassLibraryPassTypeIdentifierUserInfoKey、
PKPassLibrarySerialNumberUserInfoKey
(9)PKPayment.h
代表了付款结果
包含下面几个属性:
1、token:包含加密后的支付凭证
2、PKContact *billingContact:计费地址
3、shippingContact:邮递地址
4、shippingMethod:邮递方式
(10)PKPaymentAuthorizationViewController.h
PKPaymentAuthorizationStatus 枚举值:
PKPaymentAuthorizationStatusSuccess 支付授权成功
PKPaymentAuthorizationStatusFailure 支付授权失败
PKPaymentAuthorizationStatusInvalidBillingPostalAddress 计费地址错误
PKPaymentAuthorizationStatusInvalidShippingPostalAddress 投递地址错误
PKPaymentAuthorizationStatusInvalidShippingContact 提供联系信息是不够的
PKPaymentAuthorizationStatusPINRequired 需要PIN 个人身份唯一标识
PKPaymentAuthorizationStatusPINIncorrect 错误的PIN
PKPaymentAuthorizationStatusPINLockout PIN被锁
代理:PKPaymentAuthorizationViewControllerDelegate
必须要执行的方法:
当用户支付请求时候执行
1、- (void)paymentAuthorizationViewController:(PKPaymentAuthorizationViewController *)controller
didAuthorizePayment:(PKPayment *)payment
completion:(void (^)(PKPaymentAuthorizationStatus status))completion
当支付完成的时候
2、- (void)paymentAuthorizationViewControllerDidFinish:(PKPaymentAuthorizationViewController *)controller
可选的执行方法:
1、- (void)paymentAuthorizationViewControllerWillAuthorizePayment:(PKPaymentAuthorizationViewController *)controller
当选择了新的邮递方式之后
2、- (void)paymentAuthorizationViewController:(PKPaymentAuthorizationViewController *)controller
didSelectShippingMethod:(PKShippingMethod *)shippingMethod
completion:(void (^)(PKPaymentAuthorizationStatus status, NSArray<PKPaymentSummaryItem *> *summaryItems))completion
3、重新选择联系地址后
- (void)paymentAuthorizationViewController:(PKPaymentAuthorizationViewController *)controller
didSelectShippingContact:(PKContact *)contact
completion:(void (^)(PKPaymentAuthorizationStatus status, NSArray<PKShippingMethod *> *shippingMethods,
NSArray<PKPaymentSummaryItem *> *summaryItems))completion NS_AVAILABLE_IOS(9_0);
4、重新选择支付卡
- (void)paymentAuthorizationViewController:(PKPaymentAuthorizationViewController *)controller
didSelectPaymentMethod:(PKPaymentMethod *)paymentMethod
completion:(void (^)(NSArray<PKPaymentSummaryItem *> *summaryItems))completion NS_AVAILABLE_IOS(9_0);
方法:
测试设备是否能支付
1、+ (BOOL)canMakePayments;
测试是否支持支付网络
2、+ (BOOL)canMakePaymentsUsingNetworks:(NSArray<NSString *> *)supportedNetworks;
测试是否支持支付网络和支付类别,类别在PKMerchantCapability枚举中查看
3、+ (BOOL)canMakePaymentsUsingNetworks:(NSArray<NSString *> *)supportedNetworks capabilities:(PKMerchantCapability)capabilties NS_AVAILABLE_IOS(9_0);
构造方法
- (instancetype)initWithPaymentRequest:(PKPaymentRequest *)request
(10)PKPaymentButtonStyle.h
PKPaymentButtonStyle 样式类型枚举
PKPaymentButtonStyleWhite
PKPaymentButtonStyleWhiteOutline
PKPaymentButtonStyleBlack
PKPaymentButtonType 类型枚举
PKPaymentButtonTypePlain
PKPaymentButtonTypeBuy
PKPaymentButtonTypeSetUp
构造方法:
+ (instancetype)buttonWithType:(PKPaymentButtonType)buttonType style:(PKPaymentButtonStyle)buttonStyle;
- (instancetype)initWithPaymentButtonType:(PKPaymentButtonType)type paymentButtonStyle:(PKPaymentButtonStyle)style
(11)PKPaymentMethod.h
1、枚举类型:PKPaymentMethodType
PKPaymentMethodTypeUnknown、
PKPaymentMethodTypeDebit、借记
PKPaymentMethodTypeCredit、 贷记
PKPaymentMethodTypePrepaid、预付
PKPaymentMethodTypeStore
属性:
1、displayName:显示名称
2、network:支付网络
3、type :刚才定义的PKPaymentMethodType其中一个值
4、paymentPass:
(12)PKPaymentRequest.h
PKMerchantCapability枚举:商户支持的支付方式
PKMerchantCapability3DS、 Merchant supports 3DS
PKMerchantCapabilityEMV、
PKMerchantCapabilityCredit、
PKMerchantCapabilityDebit
PKAddressField:地址字段
PKAddressFieldNone、
PKAddressFieldPostalAddress、
PKAddressFieldPhone、
PKAddressFieldEmail、
PKAddressFieldName、
PKAddressFieldAll
PKShippingType:邮递方式
PKShippingTypeShipping、
PKShippingTypeDelivery、
PKShippingTypeStorePickup、
PKShippingTypeServicePickup
PKPaymentSummaryItemType:支付总的信息
PKPaymentSummaryItemTypeFinal、
PKPaymentSummaryItemTypePending
PKPaymentSummaryItem接口:定义一个单项的付款明细
+ (instancetype)summaryItemWithLabel:(NSString *)label amount:(NSDecimalNumber *)amount;
+ (instancetype)summaryItemWithLabel:(NSString *)label amount:(NSDecimalNumber *)amount type:(PKPaymentSummaryItemType)type NS_AVAILABLE(NA, 9_0);
包含属性:
1、label:item的简单描述
2、amount:item的金额
3、type:PKPaymentSummaryItemType其中类型
PKShippingMethod接口:PKPaymentSummaryItem
1、identifier、邮递标识
2、detail、邮递明细
PKPaymentRequest.h接口
1、merchantIdentifier:商家和苹果协议好的商家标志
2、countryCode、国际区号
3、supportedNetworks、支付的网络
4、merchantCapabilities、商家支付方式
5、paymentSummaryItems、支付总信息
6、currencyCode、货币吗
7、requiredBillingAddressFields:购买地址
8、billingContact:如果商家有购买地址,则写在这里
9、requiredShippingAddressFields:邮寄地址需要
10、shippingContact:邮寄联系人
11、shippingMethods: 邮寄方法
12、shippingType:邮寄方式
13、applicationData:应用程序数据
(13)PKPaymentToken
1、paymentMethod、支付方式
2、transactionIdentifier、交易标识
3、paymentData、加密数据