# Payment Request API

## :white\_check\_mark: Payment Request API Link

The link for payment button on merchant's web page to allow customer to activated WeChat Pay Wallet payment process.&#x20;

:point\_right: Once WeChat Pay payment process finished,  web browser will be redirected to the following **newURL** defined by the merchant according to its own business needs with receiving Alipay payment result.&#x20;

### :ballot\_box\_with\_check: API Link Data Format

```
http://qrpay.ottpay.com/h5Pay?merCode=××××&orderld=××××&amount=××&newURL=××
```

### :ballot\_box\_with\_check: Prefixed URL

```
http://qrpay.ottpay.com/h5Pay?  
```

### :ballot\_box\_with\_check: Request Parameters(need to be encoded)&#x20;

#### :asterisk\_symbol: merCode

**merCode** is the merchant payment key. Once a merchant accept OTT Pay WeChat Official Account service , OTTPay operation team will send this code through welcome email.

#### :asterisk\_symbol: orderId

**orderId** is a customized order ID provided by merchant. Once an order is placed, merchant need to send this order ID.

#### :asterisk\_symbol: amount

Amount of the order. Merchant need to send the amount to OTT server.&#x20;

:point\_right: **Note: The number is based on cents, which means 100 for 1.00 dollar.**&#x20;

#### :asterisk\_symbol: newURL&#x20;

**newURL** should be the web page URL for merchants to present the order processing result.  It is set by merchant website URL to be called from OTTPAY API with payment process result. &#x20;

#### :ballot\_box\_with\_check: Payment Link Request Example (after parameter encoding)

```
http://qrpay.ottpay.com/h5Pay?merCode=e5085aba653acef2d78a2efbd66ed707&orderId=2020041515603O145O4357&operId=0000020156&amount=1&newURL=https%3A%2F%2Fezshops.ott.ca%2Fmobile%2FwxpayOTTPAY_h5_callback.php
```

## :white\_check\_mark: Payment Result URL Link

After payment process finished,  the result will be sent back by redirecting to the following payment result Web Page URL link.

### :ballot\_box\_with\_check:Redirect URL Link Format(to be called from OTT API server)

```
newURL?amount=XXXX&orderID=XXXX&tranID=XXXX&status=XXXX
```

### :ballot\_box\_with\_check: Redirect URL Parameters (need be URL decoded)

#### :asterisk\_symbol: newURL

***newURL*** is a customized page for pay order process result receiving from OTTPAY and present to consumers who made the order payment.

#### :asterisk\_symbol:  amount

amount is the request amount of the order from the merchant. Number, 1.00 for 1.00 dollar.

#### :asterisk\_symbol: orderID

orderID is the requested order ID, from the merchant's request.

#### :asterisk\_symbol: tranID

tranID is the order number returned from WeChat Pay.

#### :asterisk\_symbol: Status

status shows the result of the payment. Payment succeed returns " **success**", payment failed return "**fail**".

#### :ballot\_box\_with\_check: Redirect URL Link Example&#x20;

```
https://ezshops.ott.ca/mobile/wxpayOTTPAY_h5_callback.php?amount=0.01&orderId=2020041515603O145O4357&tranId=1586976258203514&status=success
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.ottpay.com/payment-api/wechat-official-account/untitled-1.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
