# 查询可用支付方式

> 查询当前订单上下文可用的支付方式。

```yaml
openapi: 3.1.0
info:
  title: 查询可用支付方式
  version: 1.0.0
  description: 查询当前订单上下文可用的支付方式。
paths:
  /v1/txn/consultPaymentMethod:
    post:
      summary: 查询可用支付方式
      description: 查询当前订单上下文可用的支付方式。
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                appId:
                  type: string
                  description: Onerway 分配给商户应用或站点的标识，用于识别发起查询的应用。
                country:
                  type: string
                  description: 客户所在国家或地区代码，使用 [ISO 3166-1
                    alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)
                    两位字母代码，用于匹配该地区可用的支付方式。
                merchantNo:
                  type: string
                  description: Onerway 分配的商户号；获取方式参见[接入准备](/zh/payments/get-started/setup#获取凭证)。
                orderAmount:
                  type: string
                  description: 订单金额，使用与 `orderCurrency`
                    对应的十进制字符串；格式与最小金额要求详见[币种与金额校验](/zh/payments/get-started/currency-and-amount)。
                orderCurrency:
                  type: string
                  description: 订单币种，使用 [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217)
                    三位字母代码，需与 `orderAmount` 匹配。
                osType:
                  type: string
                  description: 移动端或 App 场景下的操作系统类型。
                  enum:
                    - IOS
                    - ANDROID
                  x-enum-descriptions:
                    IOS: iOS 设备。
                    ANDROID: Android 设备。
                  x-onerway-required: conditional
                  x-onerway-condition:
                    - 当 `paymentMode` 不是 `WEB` 时必填。
                paymentMode:
                  type: string
                  description: 交易平台或环境的支付模式；不传时默认按 `WEB` 处理。
                  enum:
                    - WEB
                    - APP
                    - WAP
                  x-enum-descriptions:
                    WEB: 桌面浏览器支付。
                    APP: 原生移动 App 支付；使用该模式时需同时传入 `osType`。
                    WAP: 移动浏览器支付；使用该模式时需同时传入 `osType`。
                sign:
                  type: string
                  description: 请求签名字符串；生成方式详见[请求签名](/zh/payments/get-started/request-signing)。
                subProductType:
                  type: string
                  description: 支付方式类别过滤条件；传入后仅返回支持该交易处理模式的支付方式，不传则按其他订单参数返回可用方式。
                  enum:
                    - DIRECT
                    - SUBSCRIBE
                    - INSTALLMENT
                    - TOKEN
                    - AUTO_DEBIT
                  x-enum-descriptions:
                    DIRECT: 直接支付。
                    SUBSCRIBE: 订阅支付。
                    INSTALLMENT: 分期支付。
                    TOKEN: token 支付。
                    AUTO_DEBIT: 代扣。
                  x-onerway-constraints:
                    - kind: consistency
                      text: 共享枚举仅表示值域字典；实际可用值仍取决于产品兼容性、商户开通配置和本次订单上下文。
              required:
                - appId
                - country
                - merchantNo
                - orderAmount
                - orderCurrency
                - sign
            examples:
              list-available-payment-methods:
                summary: 查询可用支付方式
                value:
                  appId: replace_with_app_id
                  country: US
                  merchantNo: replace_with_merchant_no
                  orderAmount: "99.99"
                  orderCurrency: USD
                  osType: IOS
                  paymentMode: APP
                  sign: "{{SIGN}}"
                  subProductType: DIRECT
      responses:
        "200":
          description: Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  respCode:
                    type: string
                    description: Onerway 返回的请求处理结果代码；`20000`
                      表示请求处理成功，其他代码表示失败或异常。完整码表见[响应码](/zh/payments/api-reference/response-codes)。
                  respMsg:
                    type: string
                    description: 请求处理结果的可读说明。
                  data:
                    type: array
                    description: 可用于当前订单上下文的支付方式列表。
                    items:
                      type: object
                      properties:
                        productType:
                          type: string
                          description: 支付方式所属的产品类别。
                          enum:
                            - ALL
                            - CARD
                            - LPMS
                            - PAYMENT_CODE
                            - ORDER_CODE
                          x-enum-descriptions:
                            ALL: 聚合收银台；仅用于收银台支付场景，表示打开聚合收银台。
                            CARD: 信用卡。
                            LPMS: 本地支付方式。
                            PAYMENT_CODE: 支付码；商家扫用户的支付码。
                            ORDER_CODE: 订单码；用户扫商家的订单码。
                          x-onerway-constraints:
                            - kind: consistency
                              text: 共享枚举仅表示值域字典；实际可用值仍取决于产品兼容性、商户开通配置和本次订单上下文。
                            - kind: rule
                              text: 钱包记录（`ApplePay`、`GooglePay`）返回 `LPMS`，仅用于分类；通过创建直连交易发起钱包支付时，传
                                `productType=CARD` 与 `subProductType=DIRECT`。
                        paymentMethod:
                          type: string
                          description: 支付方式标识符，用于区分具体卡组织、钱包或本地支付方式。
                        paymentMethodDetail:
                          type:
                            - object
                            - "null"
                          properties:
                            paymentMethodName:
                              type: string
                              description: 支付方式的品牌显示名称。
                            logos:
                              type: array
                              description: 支付方式标志列表，供商户界面展示支付方式品牌。
                              items:
                                type: object
                                properties:
                                  logoName:
                                    type: string
                                    description: 标志名称。
                                  logoUrl:
                                    type: string
                                    description: 标志图片 URL。
                                  logoPattern:
                                    type: string
                                    description: 标志模式或样式标识。
                                  logoWidth:
                                    type: string
                                    description: 标志推荐展示宽度，单位为像素。
                                  logoHeight:
                                    type: string
                                    description: 标志推荐展示高度，单位为像素。
                            promoNames[]:
                              type: string
                              description: 该支付方式的促销活动名称列表项，主要用于 Alipay+ 等支持营销展示的支付方式。每个列表项是一段 JSON
                                字符串，以语言代码为键、促销名称为值，供商户按客户语言展示。
                              x-onerway-constraints:
                                - kind: values
                                  text: 常用语言代码包含 `zh_CN`、`zh_HK`、`en_US`、`ko_KR`、`fil_PH`、`ms_MY`、`id_ID`、`th_TH`。
                          description: 支付方式的额外展示和配置信息。
                          x-onerway-value:
                            nullable: true
                            when:
                              en: Mainly returned when the payment method needs extra brand, logo, or
                                promotion display data. Other payment methods
                                usually return `null`.
                              zh: 主要在 Alipay+ 等需要额外品牌、标志或促销展示的支付方式返回；其他支付方式通常为 `null`。
                        countryCode:
                          type: string
                          description: 当前支付方式可用的国家或地区代码，采用 [ISO 3166-1
                            alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)
                            两位字母代码。钱包支付初始化时用于配置交易国家：Google Pay 对应
                            `PaymentDataRequest.transactionInfo.countryCode`，Apple
                            Pay 对应 `PKPaymentRequest.countryCode`。
                        gatewayName:
                          type:
                            - string
                            - "null"
                          description: 钱包支付令牌化所需的支付网关标识。Google Pay 接入时，将该值传入 Web SDK tokenization 的
                            `gateway` 参数。
                          x-onerway-value:
                            nullable: true
                            when:
                              en: Has a value when the returned wallet payment method needs a gateway
                                identifier or merchant-verification
                                configuration. It may be `null` when not
                                applicable. Both `ApplePay` and `GooglePay` can
                                return this field.
                              zh: 返回的钱包支付方式需要网关标识或商户验证配置时有值；不适用时可能为 `null`。`ApplePay` 和 `GooglePay` 均可返回该字段。
                        gatewayMerchantId:
                          type:
                            - string
                            - "null"
                          description: 钱包支付网关侧的商户标识。Google Pay 接入时，将该值传入 Web SDK tokenization 的
                            `gatewayMerchantId` 参数。
                          x-onerway-value:
                            nullable: true
                            when:
                              en: Has a value when the payment method needs a gateway merchant identifier. It
                                may be `null` when not applicable. `GooglePay`
                                can return this field, while `ApplePay` and
                                non-wallet methods can return `null`.
                              zh: 需要网关商户标识的支付方式有值；不适用时可能为 `null`。`GooglePay` 可返回该字段，`ApplePay` 和非钱包方式可为
                                `null`。
                        merchantId:
                          type:
                            - string
                            - "null"
                          description: 钱包支付初始化或商户验证所需的商户标识。Google Pay 接入时对应 `merchantInfo.merchantId`（详见
                            [Google Pay MerchantInfo
                            文档](https://developers.google.com/pay/api/web/reference/request-objects#MerchantInfo)）。Apple
                            Pay 接入时，为 Onerway 代为报备域名所用的 Onerway Merchant ID；使用自有
                            Apple Developer 账号的商户改用自己的 Merchant ID。
                          x-onerway-constraints:
                            - kind: rule
                              text: Google Pay 接入时，`merchantInfo.merchantId` 是 Google 颁发、用于生产环境验证的商户标识。由
                                Onerway 在其 Google Pay & Wallet Console
                                档案下报备商户域名的，`merchantInfo.merchantId`
                                用本字段值；商户自行注册 Google Pay & Wallet Console
                                并登记域名的，用自己的商户 ID，`gatewayName` /
                                `gatewayMerchantId` 仍取本接口返回值。生产环境本字段与
                                `gatewayMerchantId` 相同，沙盒环境两者可不同；Google 允许
                                `TEST` 环境省略 `merchantInfo.merchantId`。API
                                直连的网站报备见[上线前网站报备](/zh/payments/online-payments/payment-methods/google-pay#上线前网站报备)。
                          x-onerway-value:
                            nullable: true
                            when:
                              en: Has a value when the wallet payment method needs a merchant identifier or
                                merchant-verification configuration. It may be
                                `null` when not applicable. Both `ApplePay` and
                                `GooglePay` can return this field.
                              zh: 钱包支付方式需要商户标识或商户验证配置时有值；不适用时可能为 `null`。`ApplePay` 和 `GooglePay` 均可返回该字段。
                        subCardTypes[]:
                          type:
                            - string
                            - "null"
                          description: 钱包支付支持的银行卡网络列表项。该列表可用于 Google Pay `allowedCardNetworks` 或 Apple Pay
                            `supportedNetworks`。
                          x-onerway-constraints:
                            - kind: rule
                              text: 取值按各钱包要求的格式返回，可原样透传：`ApplePay` 记录使用 Apple `supportedNetworks`
                                的写法，`GooglePay` 记录使用 Google
                                `allowedCardNetworks` 的全大写写法。
                          x-onerway-value:
                            nullable: true
                            when:
                              en: Has a value when `GooglePay`, `ApplePay`, or another wallet payment method
                                needs to declare supported card networks. It may
                                be `null` when not applicable.
                              zh: "`GooglePay` 或 `ApplePay` 等钱包支付方式需要声明支持的卡组织时有值；不适用时可能为 `null`。"
```
