Place an order with WeChat Pay

Overview

Use the placeOrder method to create an order and collect the payment from WeChat.

Requirements

WeChat Pay is available only for orders with a minimum value of 0.01 USD, placed by shoppers in China or Hong Kong and using one of the supported currencies. You are required to include the following text when using Avangate API and to make it visible for your customers in the ordering interface.

Order processed by Avangate, authorized reseller and merchant of the products and services offered within this store.

Supported currencies

CNY

USD

HKD

Workflow

Shoppers select WeChat as payment option in the interface you provide to them.

Create the order object. Use WE_CHAT_PAY as the type of the PaymentDetails object, and include ReturnURL and CancelURL.

Use the placeOrder method to send the data to Avangate.

Once you place the order, Avangate logs it into the system. At this point in time, the status of the order is PENDING.

Avangate returns an Order object as the output of the placeOrder method.

Use the PaymentMethod object to create a redirect URL for the shoppers, concatenating the values of the Href and avng8apitoken parameters. Here's an example of the redirect URL: