PKPaymentRequest
继承自NSObject,@import Passkit
这个类用来封装支付请求,包括支付处理能力,支付金额和运输信息
Setting Payment Information 支付信息
countryCode
为处理支付的国家,设置符合ISO 3166的两个字母的国家码。
currencyCode
为该支付请求设置符合ISO 4217的三个字母的货币代码。
merchantCapabilities
支付卡片性能的位字段
merchantIdentifier
商家标识 :该值必须与在app's的entitlements中用com.apple.developer.in-app-payments钥匙指定的标识之一相匹配。更多添加商家标识的信息,可查看在App Distribution Guide中的Configuring Apple Pay(iOS Only)。
paymentSummaryItems
一个典型的交易包括不同的概要内容:订单总价,运费,税金,最终的总价。
supportedNetworks
支持的支付系统
Requesting Billing and Shipping Addresses 请求账单和运送地址
billingContact
账单地址
requiredBillingAddressFields
处理交易的账单地址,默认值为PKAddressFieldNone。可能的值:PKAddressField
requiredShippingAddressFields
处理交易的运送地址,默认值为PKAddressFieldNone。可能的值:PKAddressField
shippingContact
运送地址
shippingMethods
运送方式的数组,默认为空
shippingType
运送方式,默认为PKShippingTypeShipping。
Adding Application Data 添加应用数据
applicationData
该数据包括加密的支付数据(PKPaymentToken类的属性paymentData)
Constants 常量
Payment Networks 支付系统
| Payment Networks | Description |
|---|---|
| NSString * const PKPaymentNetworkAmex | 美国运通卡 |
| NSString * const PKPaymentNetworkChinaUnionPay | 中国银联 |
| NSString * const PKPaymentNetworkDiscover | 发现卡 |
| NSString * const PKPaymentNetworkInerac | 加拿大Interac银行卡 |
| NSString * const PKPaymentNetworkMasterCard | 万事达卡 |
| NSString * const PKPaymentNetworkPrivateLabel | 信用卡和借记卡 |
| NSString * cosnt PKPaymentNetworkVisa | 维萨卡 |
PKMerchantCapability 商家支付能力
| MerchantCapability | Description |
|---|---|
| PKMerchantCapability3DS | 3DS卡 |
| PKMerchantCa2pabilityEMV | EMV卡 |
| PKMerchantCapabilityCredit | 信用卡 |
| PKMerchantCapabilityDebit | 借记卡 |
PKAddressField 地址
| AddressField | Description |
|---|---|
| PKAddressFieldNone | 空 |
| PKAddressFieldPostalAddress | 完整的邮寄地址 |
| PKAddressFieldPhone | 用户的手机号 |
| PKAddressFieldEmail | 用户的邮箱 |
| PKAddressFieldName | 用户的名字 |
| PKAddressFeildAll | 所有都包含 |
用户:购买这件商品的顾客
PKShippingType 运送方式
| ShippingType | Description |
|---|---|
| PKShippingTypeShipping | 第三方运送,为默认类型 |
| PKShippingTypeDelivery | 卖家运送 |
| PKShippingTypeStorePickup | 上门取货 |
| PKShippingTypeServicePickup | 服务收件 |
PKPaymentSummaryItemType 支付概要项展示类型
| PaymentSummaryItemType | Description |
|---|---|
| PKPaymentSummaryItemTypeFinal | 最终的费用 |
| PKPaymentSummaryItemTypePending | 预算的费用或未知的费用 |