> ## Documentation Index
> Fetch the complete documentation index at: https://docs.payallglobal.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 付款查询



## OpenAPI

````yaml post /api/mapi/v1/payments/open/api/paymentOrderQry
openapi: 3.1.0
info:
  version: '1.0'
  title: PayAllGlobal开放平台接口文档
  summary: ''
  termsOfService: ''
  contact:
    name: 技术支持
    email: support@payallglobal.com
    url: ''
  license:
    url: https://www.apache.org/licenses/LICENSE-2.0.html
    name: Apache 2.0
servers:
  - url: https://mpgwpre.payallglobal.com/mp-gateway/
    description: 开发环境
  - url: https://mpgw.payallglobal.com/mp-gateway/
    description: 正式生产环境
security:
  - signature: []
tags:
  - name: 收单
  - name: 其他交易类型
  - name: 商户管理
  - name: 文件下载
  - name: 付款
paths:
  /api/mapi/v1/payments/open/api/paymentOrderQry:
    post:
      tags:
        - 付款
      summary: 付款查询
      operationId: post-api-mapi-paymentOrderQry
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PaymentOrderQryRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentOrderQryResponse'
      security:
        - signature: []
      servers:
        - url: https://mpgwpre.payallglobal.com/mp-gateway/
          description: 开发环境
        - url: https://mpgw.payallglobal.com/mp-gateway/
          description: 正式生产环境
components:
  schemas:
    PaymentOrderQryRequest:
      allOf:
        - $ref: '#/components/schemas/PayQryBaseRequest'
    PaymentOrderQryResponse:
      type: object
      properties:
        code:
          type: string
          description: 返回码，00000000代表成功。只代表接口请求成功，不代表订单状态。
          example: '00000000'
        msg:
          type: string
          description: 响应 'Success'
          example: Success
        data:
          $ref: '#/components/schemas/PaymentOrderQryResponseDataMy'
      required:
        - traceId
        - code
        - data
        - msg
    PayQryBaseRequest:
      type: object
      properties:
        charset:
          type: string
          description: 交互数据的编码【utf-8】
          default: UTF-8
          examples:
            - UTF-8
        version:
          type: string
          description: "接口版本，当前版本为【2.0.0】,目前只能传2.0.0，不能不传\t"
          examples:
            - 2.0.0
        transType:
          type: string
          enum:
            - PAY
            - CREDIT_CARD
            - 3D_PREAUTH_VOIDS
            - 3D_PREAUTH_COMPLETION
            - REFUND
            - VOIDS
            - QUERY
            - TRANSFER
            - DOWNLOAD
            - REGISTRATION
            - FILEUPLOAD
            - INQUIRYREGISTRATIONSTATUS
            - AUTHORIZE
          description: 交易类型
          default: QUERY
        accessType:
          type: string
          description: "接口访问类型\t"
          default: s2s
          examples:
            - s2s
        signType:
          type: string
          description: 报文签名类型
          examples:
            - RSA
        memberId:
          type: string
          description: "机构号\t"
          examples:
            - '2023010558663764'
        merchantId:
          type: string
          description: "商户号\t"
          examples:
            - '2023010558663764'
        outTradeNo:
          type: string
          description: 原商户订单号
          maxLength: 63
          example: outTradeNo16699809174221
      required:
        - charset
        - version
        - transType
        - accessType
        - signType
        - memberId
        - merchantId
      x-examples:
        Example 1:
          charset: UTF-8
          version: 2.0.0
          transType: string
          accessType: PAY
          signType: RSA
          memberId: stringstri
          merchantId: stringstri
    PaymentOrderQryResponseDataMy:
      type: object
      description: 查询返回的业务数据体
      properties:
        outTradeNo:
          type: string
          description: 商户订单号
          example: 394916B2ADFD4D6CAD6CC624C88990D0
        merchantId:
          type: string
          description: 商户ID
          example: '2022000000008454'
        tradeNo:
          type: string
          description: 支付平台交易号
          example: '111781085063240962'
        amount:
          type: string
          description: 付款金额
          example: '10.30'
        currency:
          type: string
          description: 付款币种
          example: PHP
        status:
          type: string
          description: 订单状态（success/fail/pending）
          example: success
        reference:
          type: string
          description: 参考信息
          example: test
        redeemCode:
          type: string
          description: 兑换码（若有）
          example: ''
        responseCode:
          type: string
          description: 业务响应码
          example: '00000000'
        responseMsg:
          type: string
          description: 业务响应信息
          example: Success
        payFinishTime:
          type: string
          nullable: true
          description: 支付完成时间，符合rfc3339规范，格式：yyyy-MM-dd'T'HH:mm:ss.SSSXXX
          example: 2024-04-17T06:35:09 +0000
        transId:
          type: string
          description: 收款银行/机构的交易单号
          example: 20240418SAARNBARNB1B44410558522170
      required:
        - outTradeNo
        - tradeNo
        - status
        - reference
        - responseCode
        - responseMsg
        - merchantId
        - amount
        - currency
  securitySchemes:
    signature:
      type: apiKey
      description: >-
        Example: MIIEpQIBAAKCAQEA...（Base64编码的签名字符串）

        ## 加签

        加签是开放平台和商户对于交互消息完整性的校验。加签行为主要发生两个部分：

        1. 商户服务器端针对向PayAllGlobal开放平台发送的请求报文进行加签；

        2. PayAllGlobal开放平台针对通知商户的异步消息进行加签。

        PayAllGlobal平台要求使用 RSA 私钥进行加签， 使用 RSA 公钥进行验签。 因此，在以上两部分描述的交互中，
        存在商户公私钥、PayAllGlobal 公私钥，开发者需要使用商户私钥，对第一部分报文进行加签，使用 PayAllGlobal
        公钥对第二部分消息进行验签。

        ### 加签规则如下: 

        使用商户私钥对请求体进行 SHA256withRSA 签名后，再进行 Base64 编码的结果。

        1. 使用 商户私钥对待 `request.body` 进行签名（SHA256WithRSA 计算原始数据的SHA-256哈希值。
        使用私钥对哈希值进行签名，即使用私钥对哈希值进行RSA加密。此时得到的加密结果就是数字签名。）；

        ```java

        Signature signature = Signature.getInstance("SHA256withRSA");

        signature.initSign(privateKey);

        // 计算 SHA256withRSA 签名时，需要以 utf-8 的编码转换 byte 流，否则可能导致含中文参数的签名计算不正确

        signature.update(request.body);

        byte[] signedHash = signature.sign();

        ```

        2. 将加签内容进行 Base64 编码；

        ```java

        String signature = Base64.getEncoder().encodeToString(signedHash);


        ```

        3. 将编码后的内容放在请求头部 signature 参数中。

        注意，加签是对 request.body 进行签名，当查询等 request.body 为空时，则无需加签。
      name: signature
      in: header

````