PayKKa Docs for Payments
v1.2 🇨🇳 (Current Release)
  • v1.2 🇨🇳 (Current Release)
  • v1.0 🇨🇳 (Release)
  1. 支付方式
PayKKa Docs for Payments
v1.2 🇨🇳 (Current Release)
  • v1.2 🇨🇳 (Current Release)
  • v1.0 🇨🇳 (Release)
  • 接入流程
  • 变更记录
  • 支付产品
    • 支付方式
    • API 支付
    • 收银台
  • 支付方式
    • Google Pay™
    • Apple Pay
  • API 参考
    • 开始
    • API认证
    • 系统响应码
    • 交易错误码
    • 交易
      • 发起交易
      • 交易查询
      • 交易请款
      • 交易撤销
      • token查询
      • token删除
      • 循环交易协议取消
      • 获取ApplePay会话
    • 收银台
      • 收银台创建
      • 收银台查询
    • 退款
      • 退款
      • 退款查询
    • 通知Webhook
      • 交易结果通知
      • 退款结果通知
  • 前端接入
    • PayKKa Checkout UI Component 使用文档
    • Fraud Detection SDK 使用文档
    • Encrypted Card 使用
  • 数据模型
    • Schemas
      • 响应
      • QueryPayResultReqDto
      • CardEncryptRespDto
      • WebAuthRequest
      • QueryOpenidRequest
      • OrderPayQrcodeRequest
      • EntryPayQrcodeRequest
      • CheckoutIdDto
      • BillRespDto
      • PaymentInfoRespDto
      • PaymentMethodRespDto
      • PaymentMethodsRespDto
      • TokenRespDto
      • BillReqDto
      • BrowserReqDto
      • CheckoutPaymentsReqDto
      • PaymentInfoReqDto
      • CheckoutPaymentQueryDto
      • PaymentMethodsReqDto
      • TokenAuthenticationDto
      • BalanceRespInPaymentsQuery
      • BalanceRespInPayments
      • PaymentLinkSessionReqDto
      • PaymentLinkPaymentsReqDto
      • PaymentLinkPaymentQueryDto
      • PaymentLinkIdDto
      • PaymentLinkQueryRespDto
      • SessionAppleApyReqDto
      • TokenRemoveReqDto
      • QueryTokenReqDto
      • PaymentCardInfoDto
      • QueryTokenRespDto
      • GoodsReqDto
      • SessionCreateReqDto
      • SessionPaymentInfoReqDto
      • ShippingReqDto
      • SessionRespDto
      • SessionQueryReqDto
      • RefundReqDto
      • RefundRespDto
      • RecurringCancelReqDto
      • CardInfoRespDto
      • QueryAddressStyleRespDto
      • CheckoutBillReqDto
      • CheckoutPaymentInfoReqDto
      • PaymentLinkPaymentInfoReqDto
      • SessionAuthenticationReqDto
      • SessionBillReqDto
      • SessionGoodsReqDto
      • SessionShippingReqDto
      • QueryRefundReqDto
      • AuthenticationRecordRespDto
      • QueryPaymentsReqDto
      • CheckoutQueryRespDto
      • CheckoutPaymentsRespDto
      • PaymentLinkPaymentsRespDto
      • PaymentsReqDto
      • AuthenticationRecordDto
      • PaymentsRespDto
      • AuthenticationReqDto
      • RefundNotifyReqDto
      • PaymentsNotifyReqDto
      • PaymentsVoidReqDto
      • PaymentsCaptureReqDto
      • CheckoutBrowserReqDto
      • SessionQueryRespDto
      • PaymentsQueryRespDto
      • BalanceResp
      • QueryPayResultRespDto
      • QueryMerchRequest
      • QueryMerchResponse
      • WebAuthResponse
      • QueryOpenidResponse
      • EntryPayQrcodeResponse
      • CardOrgEnum
      • ChannelConfig
      • SessionField
      • CheckoutThemeRespDto
      • CountryEnum
      • GoodsRespDto
      • Money
      • PaymentMethodEnum
      • PaymentTypeEnum
      • SessionModeEnum
      • SessionStatusEnum
      • CheckoutAuthenticationRecordDto
      • SessionApplePayReqDto
      • FramesLoadReqDto
      • FramesLoadRespDto
      • SuperPaymentMethodsRespDto
      • CardEncryptReqDto
      • CardInfoRespInCard
      • AuthenticationRecordRespInPaymentsQuery
      • CardInfoRespInPaymentsQuery
      • PaymentInfoRespInPaymentsQuery
      • DeviceOsEnum
      • PaymentDeviceTypeEnum
      • AuthenticationRecordRespInPayments
      • CardInfoRespInPayments
      • PaymentInfoRespInPayments
      • TerminalTypeEnum
      • AuthenticationRecordInNotify
      • BalanceRespInNotify
      • CardInfoRespInNotify
      • SessionAuthenticationRecordDto
      • PaymentInfoRespInNotify
      • SessionOrderStatusEnum
      • PaymentModeEnum
      • ApplePaySessionRespDto
      • BatchQueryDictReqDto
      • BatchQueryDictRespDto
      • DataDictResp
      • DataDictValueItem
      • OldPlaceOrderQrcodeRequestV2
      • OldPlaceOrderQrcodeResponseV2
      • OldPosQueryOrderRequestV2
      • OldPosQueryOrderResponseV2
      • OldCollectPayQrcodeRequestV2
      • OldCollectPayQrcodeResponseV2
      • OldPlaceOrderQrcodeRequest
      • OldPlaceOrderQrcodeResponse
      • OldPosQueryOrderRequest
      • OldPosQueryOrderResponse
      • OldCollectPayQrcodeRequest
      • OldCollectPayQrcodeResponse
      • PlaceOrderQrcodeRequest
      • PlaceOrderQrcodeResponse
      • DeviceActivateRequestV2
      • DeviceActivateResponseV2
      • DeviceActivateRequest
      • DeviceActivateResponse
      • CollectPayQrcodeRequest
      • CollectPayQrcodeResponse
      • CurrencyEnum
      • RefundQueryReqDto
      • WechatCallbackRespDto
      • AlipayCallbackRespDto
      • Result
      • CardTokenUsageEnum
      • ChallengeIndicatorEnum
      • ApiPaymentMethodEnum
      • CustomerReqDto
      • ThreedSecureExemptionEnum
      • GatewayOrderStatusEnum
      • SessionCustomerReqDto
      • PaymentsQueryReqDto
      • GatewayRefundOrderStatusEnum
      • QueryRefundResultReqDto
      • QueryRefundResultRespDto
      • QueryTransResultReqDto
      • AddressStyleDto
      • ThreedSecureModeEnum
      • DataDictRespDto
      • PagedDataDictValueItem
      • DeviceSignInReqDto
      • DeviceSignInRespDto
      • PosCurrency
      • DeviceSignInRequestV2
      • DeviceSignInResponseV2
      • DeviceSignInRequest
      • DeviceSignInResponse
  1. 支付方式

Google Pay™

概览#

要开始处理 Google Pay 支付,您必须先与 Google 进行直接集成。集成完成后,您可以将 Google Pay 按钮添加到结账页面,并开始请求客户的加密支付信息。
Google Pay 的集成和支付可以简化为以下三个步骤:
1.
集成 Google Pay API
在您的网站或应用中集成 Google Pay API,完成必要的身份验证和支付设置。
2.
展示 Google Pay 按钮,并获取google加密预支付数据
在结账页面上添加 Google Pay 按钮,允许客户选择 Google Pay 进行支付。
3.
处理支付请求
使用google的加密token数据处理交易。

接入步骤#

1、集成 Google Pay API
Google Pay 和 Wallet 控制台
有关集成 Google Pay 的信息,请首先参考Google Pay API 指南
当您向 Google API 提交支付数据请求时,请确保包含以下参数:
'gateway': 'paykkaeu'
'gatewayMerchantId': '<your merchant id>'
注意:
根据您的公司注册地区,"gateway" 参数的值会有所不同:
欧洲公司:使用 "paykkaeu"
香港公司:使用 "paykka"
示例:
{
  "type": "CARD",
  "parameters": {
    "allowedAuthMethods": ["PAN_ONLY", "CRYPTOGRAM_3DS"],
    "allowedCardNetworks": ["AMEX", "DISCOVER", "MASTERCARD", "VISA"]
  },
  "tokenizationSpecification": {
    "type": "PAYMENT_GATEWAY",
    "parameters": {
      "gateway": "paykkaeu",
      "gatewayMerchantId": "<YOUR_MERCHANT_ID>"
    }
  }
}
2、展示 Google Pay 按钮,并获取google加密预支付数据
指定您的 Google Pay API 版本。
选择支付的令牌化方法。
指定支持的支付卡网络。
说明您允许的付款方式。
加载 Google Pay API JavaScript 库。
创建 PaymentDataRequest 对象,创建PaymentsClient API对象。
拉起 Google Pay 收银台并填充PaymentDataRequest信息
选择银行卡支付调用google pay js sdk获取paymentData数据
了解更多关于 Google Pay 支付请求的信息,请阅读 Google Pay 对象参考。
3、处理支付请求
现在您已经拥有了令牌,接下来是授权支付。将令牌放入您应用或网站后端服务器的卡片令牌支付请求的请求体中。并使用paykka支付服务商发起[API交易]

3D Secure#

Google Pay 提供两种认证模式:
1.
PAN_ONLY-卡片存储在您客户的 Google 帐号中。因此,支付凭证不绑定于 Android 设备(例如,桌面或非 Android 移动网页)。
2.
CRYPTOGRAM_3DS-Google Pay 通过将支付凭证绑定到 Android 设备,并允许发卡行将认证委托给 Google,以实现 SCA 合规性,从而支持该设备上的所有后续支付。
以下是您如何在 PAN_ONLY 场景中遵守 SCA 要求的方法。
** 责任转移 **
经过 3DS 认证的 Google Pay 交易可以在以下场景中受益于责任转移:
持卡人将其卡片直接添加到 Google Chrome 或 Google 产品中:该卡将作为资金主账号(FPAN)保存,并将支持经过 3DS 明确认证的交易的责任转移。
持卡人使用 Android 设备将其卡片添加到原生 Google Pay 应用中:该卡将作为设备主账号(DPAN)保存,并将支持责任转移,因为在添加卡片时已完成认证。
尽管 ECI 值表明在认证过程中发生了降级,卡组织在授权阶段仍可能降级交易的责任转移。责任转移的结果是在授权后确定的。
Visa 设备令牌的欺诈责任保护
3DS示例:
{
    "version": "v1.0",
    "merchant_id": "18000000000000",
    "payment_type": "PURCHASE",
    "trans_id": "m16093507243369",
    "timestamp": 1710329021387,
    "currency": "JPY",
    "amount": "1690",
    "notify_url": "https://myserver/callback",
    "return_url":"xxxxxx",
    "payment": {
        "payment_method": "GOOGLE_PAY",
        "token_data": "GOOGLE PAY TOKEN DATA"
    },
  "authentication":{
    "attempt":"AUTO",
    "exemption":"LOW_VALUE"
  }
}

使用Google Pay token支付#

您可以在我们的 [API 参考]中找到完整的列表以及完整的请求和响应示例。
示例:
{
    "version": "v1.0",
    "merchant_id": "18000000000000",
    "payment_type": "PURCHASE",
    "trans_id": "m16093507243369",
    "timestamp": 1710329021387,
    "currency": "JPY",
    "amount": "1690",
    "notify_url": "https://myserver/callback",
    "payment": {
    "payment_method": "GOOGLE_PAY",
        "token_data": "GOOGLE PAY TOKEN DATA"
    }
}
响应:
{
    "ret_code": "000000",
    "ret_msg": "Success",
    "data": {
        "version": "v1.0",
        "error_code": "0000",
        "error_description": "request success",
        "merchant_id": 18000000000000,
        "trans_id": "m1793xxx95791",
        "order_id": "GW201650334620472773",
        "status": "SUCCESS",
        "amount": 1690,
        "currency": "JPY",
        "shopper_reference": "RXIJ"
    }
}
如果 ret_code字段为 0000 且 status 字段为 SUCCESS,则表示您的授权成功。如果授权未成功,可能是因为支付使用了无效/过期的卡片,或使用了有效卡片但可用余额不足。

通过Hosted Payment Page方式接入Google Pay#

如果您使用PayKKa的托管结账页面来接入Google Pay, 只需要在开通商户过程中支持Google Pay并接受Google Pay支付, PayKKa将在幕后处理与Google Pay的所有交易。这种集成方案,最为便捷。您需要调用发起收银台请求,获取PayKKa的收银台的跳转地址。
1.
调用[收银台创建]接口
{
    "version": "v1.0",
    "merchant_id": "18000000000000",
    "payment_type": "PURCHASE",
    "trans_id": "t202311081113",
    "timestamp": 1700805506000,
    "currency": "USD",
    "amount": 1250,
    "session_mode": "HOST",
    "display_merchant_name": "PayKKa Merchant",
    "display_locale": "zh-CN",
    "allowed_payment_methods": [
        "GOOGLE_PAY"
    ]
}
其中指定session_mode 字段值为HOST, allowed_payment_methods允许支持GOOGLE_PAY。

通过Embedded Element方式接入Google Pay#

您可以在自己的付款页面集成Google Pay 付款元素, 这种解决方案让您的客户不需要跳转到第三方付款页面,就可以在您的当前页面完成支付,体验更丝滑。但是这种方式,您需要提供您的付款页面所在的域名,在PayKKa上进行绑定验证。操作步骤:
1.
引入PayKKa Checkout UI Component组件库
具体使用步骤可参考PayKKa Checkout UI Component 使用文档 - PayKKa Docs for Payments
2.
调用[收银台创建]接口
{
    "version": "v1.0",
    "merchant_id": "18000000000000",
    "payment_type": "PURCHASE",
    "trans_id": "t202311081113",
    "timestamp": 1700805506000,
    "currency": "USD",
    "amount": 1250,
    "session_mode": "EMBEDDED",
    "display_merchant_name": "PayKKa Merchant",
    "display_locale": "zh-CN",
    "allowed_payment_methods": [
        "GOOGLE_PAY"
    ]
}
其中指定session_mode 字段值为EMBEDDED, allowed_payment_methods允许支持GOOGLE_PAY。

商家PSP解密#

如果您的开发能力很强,自行完成了Google Pay的token的解密。那么只需要发起PayKKa的支付API请求,传递解密后的交易卡信息,即可完成交易。
1.
调用[发起交易]接口
{
  "payment": {
    "payment_method": "GOOGLE_PAY",
    "exp_year": "2027",
    "exp_month": "08",
    "holder_name": "Ocie Vititoe",
    "card_no": "5204240493889658",
    "token_authentication": {
        "cryptogram": "ALbOGff2RLbTADtP3BuIAoABFA==", ##必填
        "token_format": "CRYPTOGRAM_3DS", ##必填
        "eci": "02",
        "account_verified": true,
        "card_holder_authenticated": true ##必填
    }
  }
}
其中, exp_year, exp_month, card_no, cryptogram, token_format , eci, account_verified, card_holder_authenticated 字段值来自于解密后的明文信息,但是有些字段并不是每次都会返回。

测试Google Pay#

要测试 Google Pay 支付,您必须首先创建一个测试 paykka.com 账户。
然后,您将能够在沙盒环境中使用我们的测试卡模拟不同的支付流程。Google 还提供了模拟测试卡,您可以将其添加到您的钱包中。
如果您在 Google 的测试环境中使用真实卡片进行支付,Google Pay 会在加密支付数据中提供一张测试卡。这确保不会发生实际交易。
修改于 2025-03-17 10:16:18
上一页
收银台
下一页
Apple Pay
Built with