MyMoney API
MyMoney alipay and wechat pay API
MyMoney API
Option | Description |
---|---|
Current Version | 1.0 |
Author | Mymoney LTD |
Created At | 2019-06-11 |
API Content
- Alipay API
API Name | Description | version |
---|---|---|
single_trade_query | Obtain the information of a particular transaction | 1.0 |
forex_rate_file | Obtain the exchange rate from Alipay. | 1.0 |
forex_refund | Refund a alipay transaction. | 1.0 |
create_forex_trade_pc | Initiate a website payment request. | 1.0 |
create_forex_trade_wap | Initiate a wap payment request. | 1.0 |
iOS Integration | ios intergration alipay | 1.0 |
- WechatPay API
API Name | Description | version |
---|---|---|
native_order | create an advance transaction in the WeChat by QR Code | 1.0 |
query_order | Obtain the information of orders made from WeChat | 1.0 |
jsapi_order | create an advance transaction in the WeChat by QR Code | 1.0 |
refund | Refund a wechat transaction. | 1.0 |
query_refund | After submitting Submit Refund, to check the refund status. | 1.0 |
query_exchage_rates | Obtain the exchange rate from Wechat. | 1.0 |
Specifies the WeChat payment order id number
Specifies the internal refund number, which is unique in the system. A single transaction can be processed as multiple partial refunds, with the total sum of the partial refunds being equal to the original one.
Specifies the total refund amount for a transaction. The units are expressed in cents and shall be an integer
Specifies the total order amount. The units are expressed in cents and must be an integer.
The value is 10 to the 8th power times of the exchange rate from foreign currency to RMB. For example, the exchange rate from foreign
The value is 10 to the 8th power times of the exchange rate from foreign currency to RMB. For example, the exchange rate from foreign
886930000
If not empty, this is the error description Signature failure Parameter format checking error
If not empty, this is the error description Signature failure Parameter format checking error
OK
Specifies communicating label instead of transaction label. The status of a transaction is determined by the value oftrade_state.
Specifies communicating label instead of transaction label. The status of a transaction is determined by the value oftrade_state.
SUCCESS
- SUCCESS: Payment successful
- REFUND: Order to be refunded
- NOTPAY: Order not paid
- CLOSED: Order closed
- REVOKED: Order revoked
- USERPAYING: Awaiting user to pay
Payment successful
Order to be refunded
Order not paid
Order closed
Order revoked
Awaiting user to pay
SUCCESS
Request parameters
The payment ID for the original payment transaction
Verification signature generated using API key.Signature Verification
Responses
Body
Specifies communicating label instead of transaction label. The status of a transaction is determined by the value oftrade_state.
If not empty, this is the error description Signature failure Parameter format checking error
SUCCESS or FAIL
Specifies the user id of the Payer provided by the WeChat system, it is unique to each appid instance
Specifies whether the payer follows the associated official account or not, with Y meaning ‘follows’ and N meaning ’not follows’.
Set to JSAPI, NATIVE, MICROPAY or APP
The value is 10 to the 8th power times of the exchange rate from foreign currency to RMB. For example, the exchange rate from foreign
{
"is_success": "T",
"msg": {
"return_code": "SUCCESS",
"return_msg": "OK",
"result_code": "SUCCESS",
"openid": "oeGOQxGMLoOe6_t3SZG3LQqd7YU8",
"is_subscribe": "N",
"trade_type": "MICROPAY",
"bank_type": "LQT",
"total_fee": "1",
"fee_type": "GBP",
"transaction_id": "4200000322201905103771992121",
"out_trade_no": "mm_00000069_20190510181700001",
"attach": {},
"time_end": "20190510163909",
"trade_state": "SUCCESS",
"cash_fee": "8",
"trade_state_desc": "支付成功",
"cash_fee_type": "CNY",
"rate": "886930000"
},
"sign": "41f7149bd8ae68abd21856b859e7ea62"
}
Request parameters
The payment ID for the original payment transaction
Verification signature generated using API key.Signature Verification
Responses
Body
{
"is_success": "T",
"msg": {
"return_code": "SUCCESS",
"return_msg": "OK",
"result_code": "SUCCESS",
"prepay_id": "wx061954047638834d2ec92b811599997900",
"trade_type": "NATIVE",
"code_url": "weixin://wxpay/bizpayurl?pr=W6acyUf"
},
"sign": "32878c40f7787f68ba8360be32f5c0a2"
}
Request parameters
The payment ID for the original payment transaction
Verification signature generated using API key.Signature Verification
Detailed product list described in JSON format. Please use CDATA tag to protect the JSON string when generating signature. goods_detail []: └ goods_id String Required 32 Goods ID └ wxpay_goods_id String Optional 32 The unified goods ID defined by WeChat └ goods_name String Required 256 Goods name └quantity Int Required Goods amount └ price Int Required Goods price, unit as cent Note: The goods price should be less than total_fee and it should be the favorable price.
Allow vendors an additional field to be returned in the payment notification after submitting a payment to the Query Order API
ISO-4217 standard compliant and be described by three characters based code.
Specifies the total order amount. The units are expressed in cents and must be an integer.
Specifies the terminal device ID assigned by WeChat Payment. This field is defined by the Vendor. Note: If the payment is performed based on PC web page or WeChatWeb-based page, please submit the field value as WEB.
Specifies the transaction creation time in the format yyyyMMddHHmmss, such as 20091225091010 for Dec 25, 2009 09:10:10 (UTC+08).
Specifies the transaction end time in the format yyyyMMddHHmmss, such as 20091227091010 for Dec 27, 2009 09:10:10 (UTC+08).
Specifies the label of goods, which is a parameter in the coupon feature for businesses.
Specifies the total order amount. The units are expressed in cents and must be an integer.
Set to JSAPI
This field is only required when trade_type is JSAPI. It is the only user identification under the current appid. About how to get openid, please refer to
This field is only required when trade_type
is JSAPI
. It is the only user identification under the current appid. Choose one of openid
or sub_openid
to submit, if sub_openid
is chosen, sub_appid
also need to be submitted.
Responses
Body
SUCCESS or FAIL Specifies communicating label instead of transaction label. The status of the transaction is determined by the value of the result_code field.
If not empty, the returned info is the error description. Signature failure Parameter format checking error
Service Result SUCCESS or FAIL
Specifies the advance transaction ID created by WeChat. It is used to call the WeChat Payment API later.
The transaction type submitted. The value could be JSAPI, NATIVE, or APP
{
"is_success": "T",
"msg": {
"return_code": "SUCCESS",
"return_msg": "OK",
"prepay_id": "wx06195846571889a145b71e381147349800",
"trade_type": "JSAPI",
}
"sign": "e0b10e161f9bb0f0aeb0ed2700694b22"
}
Request parameters
The payment ID for the original payment transaction
Verification signature generated using API key.Signature Verification
Specifies the total order amount. The units are expressed in cents and must be an integer.
Specifies the total refund amount for a transaction. The units are expressed in cents and shall be an integer
ISO-4217 standard compliant and be described by three characters based code. The refund currency type must be same with the bid currency type.
It will inform the shoppers the refund reason once merchants submit this field value.
Specifies the internal refund number, which is unique in the system. A single transaction can be processed as multiple partial refunds, with the total sum of the partial refunds being equal to the original one.
Specifies the WeChat payment order id number
Responses
Body
{
"return_code": "SUCCESS",
"return_msg": "OK",
"result_code": "SUCCESS",
"transaction_id": "4008450740201411110005820873",
"out_trade_no": "1415757673",
"out_refund_no": "1415701182",
"refund_id": "2008450740201411110000174436",
"refund_fee": "1"
}
{
"return_code": "SUCCESS",
"return_msg": "OK",
"result_code": "SUCCESS",
"transaction_id": "4008450740201411110005820873",
"out_trade_no": "1415757673",
"out_refund_no": "1415701182",
"refund_id": "2008450740201411110000174436",
"refund_fee": "1"
}
Request parameters
Verification signature generated using API key.Signature Verification
The payment ID for the original payment transaction
Specifies the internal refund number, which is unique in the system. A single transaction can be processed as multiple partial refunds, with the total sum of the partial refunds being equal to the original one.
Responses
Body
Specifies the WeChat payment order id number
Specifies an internal order number created by the Vendor’s system
Specifies the total order amount expressed in cents and must be an integer
ISO-4217 standard compliant and be described by three characters based code.
Specifies the cash payment amount expressed in cents and must be an integer.
Complies with ISO 4217 standards and uses CNY (Chinese yuan) by default. For more information
Specifies recorded refund counts
Vendor Refund Number
WeChat Refund Number
ORIGINAL: Refund to original payment account BALANCE: Refund to Balance OTHER_BALANCE: Refund to balance of other WeChat account since the original account is abnormal OTHER_BANKCARD: Refund to other bank card since the original bank card is abnormal
Specifies the total refund amount expressed in cents and must be an integer A refund can be processed as multiple partial refunds.
Refund Status: SUCCESS: Refunded successfully REFUNDCLOSE: Refund closed PROCESSING: Refund is pending CHANGE: Refund can’t be processed as the Payer’s bank card is either revoked or blocked. As a consequence, the refund will be transferred to the Vendor’s cash account. In this case, the refund must be processed offline via the help of the
Refunded successfully
Refund closed
Refund is pending
Refund can’t be processed as the Payer’s bank card is either revoked or blocked.
The account which finally received the refund: 1.Back to bankcard: {bank name}{bank type}{tail numbers} 2.Back to balance: 支付用户零钱 3.Back to merchant 商户基本账户Merchants’ basic account 商户结算银行账户Merchants’ bank account
Refund success time, only returned when the refund the successfully complete.
The value is 10 to the 8th power times of the exchange rate from foreign currency to RMB. For example, the exchange rate from foreign currency to RMB is 6.5, the value will be 650000000
{
"is_success": "T",
"msg": {
"return_code": "SUCCESS",
"return_msg": "OK",
"result_code": "SUCCESS",
"transaction_id": "1217752501201407033233368018",
"out_trade_no": "1217752501201407033233368018",
"total_fee": "100",
"fee_type": "GBP",
"cash_fee": "100",
"cash_fee_type": "CNY",
"refund_count": 1,
"out_refund_no_$n": "1217752501201407033233368018",
"refund_id_$n":"1217752501201407033233368018",
"refund_channel_$n": "ORIGINAL",
"refund_fee_$n": "100",
"refund_status_$n": "SUCCESS"
},
"sign": "e0b10e161f9bb0f0aeb0ed2700694b22"
}
Request parameters
Verification signature generated using API key.Signature Verification
Foreign currency type. ISO-4217 standard compliant and be described by three characters based code.
In the format of yyyyMMdd. For example, December 25, 2009 is expressed as 20091225 in the time zone (GMT+8).
Responses
Body
If not empty, this is the error description Signature failure Parameter format checking error
SUCCESS or FAIL Specifies communicating label instead of transaction label. The status of a transaction is determined by the value of result_code.
Foreign currency type. ISO-4217 standard compliant and be described by three characters based code.
In the format of yyyyMMdd. For example, December 25, 2009 is expressed as 20091225 in the time zone (GMT+8).In the format of yyyyMMdd. For example, December 25, 2009 is expressed as 20091225 in the time zone (GMT+8).
The value is 10 to the 8th power times of the exchange rate from foreign currency to RMB. For example, the exchange rate from foreign currency to RMB is 6.5, the value will be 650000000
{
"is_success": "T",
"msg": {
"return_code": "SUCCESS",
"return_msg": "OK",
"fee_type": "GBP",
"rate_time": "20190506",
"rate": "894600000"
},
"sign": "354817357aeb36616d485a1ed1555ebe"
}
Information about the trade industry. See trade_information for details.
A floating number in the range of 0.01 - 1000000.00. This parameter is used to replace the total_fee parameter if partners want to price their product in RMB. If total_fee is used, don’t set the rmb_fee parameter because they are mutually exclusive.
Number(8,2)
The default value is 12h. Contact Alipay Technical Support if you need to use other values. This parameter specifies the valid time from login to completion.
Supplier name, for page display purpose.
The code of the Alipay product you use. In this case, the value of this field is NEW_WAP_OVERSEAS_SELLER.
Split info in JSON format. For more details, see Split Detail Info
A floating number in the range of 0.01~1000000.00. If total_fee is not null, it means the transaction uses foreign currency and the product price will be calculated in RMB based on the exchange rate.
Number(8,2)
A unique transaction ID assigned by Alipay, with maximum length of 64 bytes and minimum length of 16 bytes. If both trade_no and out_trade_no appear, trade_no takes precedence. This parameter is required when out_trade_no is not provided.
The refund split detail is in JSON format, and includes the following parameters:Refund Split Detail Info
Settlement currency code that the merchant specifies in the contract. Use upper case. Supported Currency List for details.
A unique ID assigned by the partner to identify a secondary merchant. The ID can contain letters, numbers, and underscores. Note: This parameter is required for partners.
Authentication
The merchant can use this API to obtain the information of a particular transaction, such as the transaction ID, out_trade_no, and transaction status.
Request parameters
The payment ID for the original payment transaction
Verification signature generated using API key.Signature Verification
A unique transaction ID assigned by Alipay, with maximum length of 64 bytes and minimum length of 16 bytes. If both trade_no and out_trade_no appear, trade_no takes precedence. This parameter is required when out_trade_no is not provided.
Responses
Body
The status of the API call can be: T: success F: failed
Merchandise description. Special characters are not supported.
Buyer’s Alipay account
A unique buyer ID assigned by Alipay
The discount amount
This parameter indicates whether the trade transaction is locked. 1: the transaction is locked. 0: the transaction is not locked.
The time when the transaction is created. Format: yyyy-MM-dd HH:mm:ss. Use GMT+8.
The time when the transaction is paid by the buyer. Format: yyyy-MM-dd HH:mm:ss. Use GMT+8.
The operator role can be: B: Buyer S: Seller
A unique transaction ID
The payment type. See Payment Type for details.
The merchandise price in CNY. Value range: 0.01 - 100000000.00, accurate to two decimal places
The quantity of merchandises
Merchandise title. Special characters are not supported.
The accumulative refunded amount paid to the buyer
The accumulative amount paid to the seller
Transaction amount in CNY. It is the exact amount that the buyer has paid. Accurate to two decimal places
A unique transaction ID assigned by Alipay, with a maximum length of 64 bytes and minimum length of 16 bytes. If both trade_no and out_trade_no appear, trade_no takes precedence.
Transaction status, the value can be: TRADE_FINISHED WAIT_BUYER_PAY TRADE_CLOSED
This parameter indicates whether the Alipay coupon is used in the transaction. T: True F: False
{
"is_success": "T",
"msg": {
"trade": {
"body": "test body",
"buyer_email": "614***@qq.com",
"buyer_id": "2088802975799141",
"discount": "0.00",
"flag_trade_locked": "0",
"gmt_create": "2019-06-04 15:19:06",
"gmt_last_modified_time": "2019-06-04 15:19:25",
"gmt_payment": "2019-06-04 15:19:25",
"is_total_fee_adjust": "F",
"operator_role": "B",
"out_trade_no": "mm_19_001-201960414430000000000002",
"payment_type": "100",
"price": "0.09",
"quantity": "1",
"subject": "test",
"to_buyer_fee": "0.00",
"to_seller_fee": "0.09",
"total_fee": "0.09",
"trade_no": "2019060422001399141043411250",
"trade_status": "TRADE_FINISHED",
"use_coupon": "F"
}
},
"sign": "ced5aac2665180341c047e548f396c57"
}
{
"error": "merchant not exist",
"is_success": "F"
}
{
"error": "ILLEGAL_SIGN",
"is_success": "F"
}
The merchant can call this API to obtain the exchange rate from MyMoney. The exchange rate changes once a day between 9:00 and 11:00 GMT+8. In addition, you can call this interface for a maximum of 100 times each day.
Request parameters
Verification signature generated using API key.Signature Verification
Responses
Body
Rate releasing date: YYYYMMDD
Rate releasing time: HHMMSS
Abbreviated currency names.
Rate
{
"is_success": "T",
"msg": [
{
"date": "20190605",
"time": "100510",
"currency": "GBP",
"rate": "8.863120"
},
{
"date": "20190605",
"time": "093007",
"currency": "PHP",
"rate": "0.133981"
},
{
"date": "20190605",
"time": "100510",
"currency": "DKK",
"rate": "1.047000"
},
{
"date": "20190605",
"time": "100510",
"currency": "HKD",
"rate": "0.883300"
},
{
"date": "20190605",
"time": "100510",
"currency": "CAD",
"rate": "5.185700"
},
{
"date": "20190605",
"time": "093007",
"currency": "LKR",
"rate": "0.039341"
},
{
"date": "20190605",
"time": "100510",
"currency": "THB",
"rate": "0.220994"
},
{
"date": "20190605",
"time": "093007",
"currency": "ZAR",
"rate": "0.474500"
},
{
"date": "20190605",
"time": "100510",
"currency": "SGD",
"rate": "5.081400"
},
{
"date": "20190605",
"time": "093006",
"currency": "MYR",
"rate": "1.668869"
},
{
"date": "20190605",
"time": "100510",
"currency": "SEK",
"rate": "0.735900"
},
{
"date": "20190605",
"time": "100510",
"currency": "JPY",
"rate": "0.064210"
},
{
"date": "20190605",
"time": "100510",
"currency": "EUR",
"rate": "7.817900"
},
{
"date": "20190605",
"time": "093006",
"currency": "IDR",
"rate": "0.000487"
},
{
"date": "20190605",
"time": "093007",
"currency": "CZK",
"rate": "0.303993"
},
{
"date": "20190605",
"time": "100510",
"currency": "MOP",
"rate": "0.857400"
},
{
"date": "20190605",
"time": "100510",
"currency": "USD",
"rate": "6.928700"
},
{
"date": "20190605",
"time": "100510",
"currency": "AUD",
"rate": "4.857700"
},
{
"date": "20190605",
"time": "093007",
"currency": "AED",
"rate": "1.889362"
},
{
"date": "20190605",
"time": "100510",
"currency": "NZD",
"rate": "4.596900"
},
{
"date": "20190605",
"time": "100510",
"currency": "KRW",
"rate": "0.006050"
},
{
"date": "20190605",
"time": "100510",
"currency": "NOK",
"rate": "0.798700"
},
{
"date": "20190605",
"time": "112011",
"currency": "TWD",
"rate": "0.222216"
},
{
"date": "20190605",
"time": "100510",
"currency": "CHF",
"rate": "7.005300"
},
{
"date": "20190605",
"time": "093007",
"currency": "RUB",
"rate": "0.106539"
}
],
"sign": "6a77e0df72f579ad3bc29c976bdc7c46"
}
Call this interface to refund a transaction.
Request parameters
Verification signature generated using API key.Signature Verification
The amount to refund in settlement currency. The value is in the range of 0.01 – 1000000, with at most 2 digits after the decimal point. One of the following two parameters must be specified: return_amount return_rmb_amount
Use this field to refund in CNY. The value is in the range of 0.01 – 1000000, with at most 2 digits after the decimal point. One of the following two parameters must be specified: return_amount return_rmb_amount
Currency code. Even when the return_rmb_amount parameter is not null, currency is still the foreign currency, not CNY. Use upper case. See Supported Currency List for details.
Refund transaction time. Format: YYYYMMDDHHMMSS, Beijing Time
Reason for the refund
Product code, which is NEW_OVERSEAS_SELLER for website payment refund, and is NEW_WAP_OVERSEAS_SELLER for WAP or APP payment refund
To indicate that the refund request is processed synchronously or asynchronously with a value of Y or N. The default value is N, which means an asynchronous response from Alipay is returned to the merchant if the merchant has set the value of the notify_url field when sending the refund request. If the value is set as Y, it means only a synchronous response is returned to the merchant.
The refund split detail is in JSON format, and includes the following parameters:Refund Split Detail Info
The merchant can use this interface to initiate a website payment request.
Request parameters
Verification signature generated using API key.Signature Verification
Brief description of the transaction. Special characters are not supported. Note: The value of this field will be displayed to customers.
Detailed description about the goods. Special characters are not supported.
The payment ID for the original payment transaction
Settlement currency code that the merchant specifies in the contract. Use upper case. Supported Currency List for details.
After the payment is completed, the result is sent to this URL through URL redirect.
The default value is 12h. Contact Alipay Technical Support if you need to use other values. This parameter specifies the valid time from login to completion.
YYYY-MM-DD HH:MM:SS Use Beijing time to synchronize with Alipay system. This parameter can only be used with order_valid_time together to control the valid time from redirection to login
Order valid time in seconds. Max value is 2592000. This parameter can only be used with the order_gmt_create parameter to control the valid time. If the current time passes the time of order_gmt_create plus order_valid_time, the payment transaction will be closed.
A unique ID assigned by the partner to identify a secondary merchant. The ID can contain letters, numbers, and underscores. Note: This parameter is required for partners.
Industry classification identifier of sub-merchant which assigned by Alipay. For example: catering industry: 5812 department stores: 5311 lodging industry: 7011 taxi industry: 4121 For more details, see secondary merchant industry list. This parameter is required for partners. See more mcc code : MCC Code
Secondary merchant name, shown in the Alipay Wallet and the reconciliation file to identify a secondary merchant. Note: This parameter is required for partners.
Website of the secondary merchant
Product code. The value is fixed as NEW_OVERSEAS_SELLER in this interface
Split info in JSON format. For more details, see Split Detail info
Information about the trade industry. See trade_information for details.
Information about the trade industry. See trade_information for details.
A floating number in the range of 0.01~1000000.00. If total_fee is not null, it means the transaction uses foreign currency and the product price will be calculated in RMB based on the exchange rate.
Number(8,2)
A floating number in the range of 0.01 - 1000000.00. This parameter is used to replace the total_fee parameter if partners want to price their product in RMB. If total_fee is used, don’t set the rmb_fee parameter because they are mutually exclusive.
Number(8,2)
Responses
Body
{
"is_success": "T",
"msg": "https://mapi.alipay.com/gateway.do?service=create_forex_trade&_input_charset=UTF-8&partner=2088431618698950¬ify_url=http://8.208.9.37/~mymoney/api/v1/alipay/alipay_online_wap_notify&return_url=localhost/my_money_pay0506/api/v1/alipay_wap_return_url&subject=test&body=test body&out_trade_no=mm_19_001-201960414430000000000002¤cy=GBP&total_fee=0.01&rmb_fee=&timeout_rule=&auth_token=&supplier=&order_gmt_create=&order_valid_time=&product_code=NEW_OVERSEAS_SELLER&split_fund_info=&secondary_merchant_id=mm_19_001&secondary_merchant_name=Test LTD&secondary_merchant_industry=5311&sign_type=MD5&sign=dd3223abc04c1a4f2bd5672e94ac8389",
"sign": "5b75b4d59f78c2b3ddd2c900971b9753"
}
Request parameters
Verification signature generated using API key.Signature Verification
After the payment is completed, the result is sent to this URL through URL redirect.
Brief description of the transaction. Special characters are not supported. Note: The value of this field will be displayed to customers.
Detailed description about the goods. Special characters are not supported.
The payment ID for the original payment transaction
Settlement currency code that the merchant specifies in the contract. Use upper case. Supported Currency List for details.
A floating number in the range of 0.01~1000000.00. If total_fee is not null, it means the transaction uses foreign currency and the product price will be calculated in RMB based on the exchange rate.
Number(8,2)
A floating number in the range of 0.01 - 1000000.00. This parameter is used to replace the total_fee parameter if partners want to price their product in RMB. If total_fee is used, don’t set the rmb_fee parameter because they are mutually exclusive.
Number(8,2)
The default value is 12h. Contact Alipay Technical Support if you need to use other values. This parameter specifies the valid time from login to completion.
A unique ID assigned by the partner to identify a secondary merchant. The ID can contain letters, numbers, and underscores. Note: This parameter is required for partners.
Secondary merchant name, shown in the Alipay Wallet and the reconciliation file to identify a secondary merchant. Note: This parameter is required for partners.
Industry classification identifier of sub-merchant which assigned by Alipay. For example: catering industry: 5812 department stores: 5311 lodging industry: 7011 taxi industry: 4121 For more details, see secondary merchant industry list. This parameter is required for partners. See more mcc code : MCC Code
Website of the secondary merchant
Split info in JSON format. For more details, see Split Detail Info
The flag that is used to identify whether the transaction activates Alipay wallet app to process the payment. If Alipay wallet app is not installed, the payment will be processed by WAP page.
Information about the trade industry. See trade_information for details.
The refund split detail is in JSON format, and includes the following parameters:Refund Split Detail Info
Responses
Body
Industry classification identifier of sub-merchant which assigned by Alipay. For example: catering industry: 5812 department stores: 5311 lodging industry: 7011 taxi industry: 4121 For more details, see secondary merchant industry list. This parameter is required for partners. See more mcc code : MCC Code
线上商户对应的ID
Secondary merchant name, shown in the Alipay Wallet and the reconciliation file to identify a secondary merchant. Note: This parameter is required for partners.
Alipay supports currencies in the following table:
Abbreviation | Currency | Decimal numbe |
---|---|---|
GBP | Great Britain Pound | 2 |
HKD | Hong Kong Dollar | 2 |
USD | U.S. Dollar | 2 |
CHF | Confederation Helvetica Franc | 2 |
SGD | Singapore Dollar | 2 |
SEK | Swedish Krona | 2 |
DKK | Danish Krone | 2 |
NOK | Norwegian Krone | 2 |
JPY | Japanese Yen | 0 |
CAD | Canada Dollar | 2 |
AUD | Australian Dollar | 2 |
EUR | Euro | 2 |
NZD | New Zealand Dollar | 2 |
KRW | Korea Won | 0 |
THB | Thai Baht | 2 |
What is MCC?
The Merchant Category Code (MCC) is a four-digit number assigned to describe a merchant’s primary business. For an Alipay payment transaction, if secondary_merchant_industry is passed in, the parameter value must be one of the following MCC numbers. Otherwise, the payment transaction will be blocked.
The following table lists the MCCs used in Alipay:
MCC | Description |
---|---|
0742 | Veterinary services |
0743 | Wine producers |
0744 | Champagne producers |
0780 | Landscaping and horticultural services |
1711 | Heating, plumbing and air-conditioning contractors |
1731 | Electrical contractors |
1740 | Masonry, stonework, tile setting, plastering and insulation contractors |
1750 | Carpentry contractors |
1761 | Roofing, siding and sheet metal work contractors |
1771 | Concrete work contractors |
1799 | Special trade contractors - not elsewhere classified |
2741 | Miscellaneous publishing and printing services |
2791 | Typesetting, platemaking and related services |
2842 | Speciality cleaning, polishing and sanitation preparations |
4011 | Railroads |
4111 | Local and suburban commuter passenger transportation, including ferries |
4112 | Passenger railways |
4119 | Ambulance services |
4121 | Taxi-cabs and limousines |
4131 | Bus lines |
4214 | Motor freight carriers and trucking - local and long distance, moving and storage companies and local delivery |
4215 | Courier services - air and ground and freight forwarders |
4225 | Public warehousing and storage - farm products, refrigerated goods and household goods |
4411 | Steamships and cruise lines |
4457 | Boat rentals and leasing |
4468 | Marinas, marine service and supplies |
4511 | Airlines and air carriers |
4582 | Airports, flying fields and airport terminals |
4722 | Travel agencies and tour operators |
4784 | Tolls and bridge fees |
4789 | Transportation services - not elsewhere classified |
4812 | Telecommunication equipment and telephone sales |
4814 | Telecommunication services |
4815 | Monthly summary telephone charges |
4816 | Computer network information services |
4821 | Telegraph services |
4899 | Cable and other pay television services |
4900 | Utilities - electric, gas, water and sanitary |
5013 | Motor vehicle supplies and new parts |
5021 | Office and commercial furniture |
5039 | Construction materials - not elsewhere classified |
5044 | Office, photographic, photocopy and microfilm equipment |
5045 | Computers, computer peripheral equipment - not elsewhere classified |
5046 | Commercial equipment - not elsewhere classified |
5047 | Dental laboratory medical ophthalmic hospital equipment and supplies |
5051 | Metal service centres and offices |
5065 | Electrical parts and equipment |
5072 | Hardware equipment and supplies |
5074 | Plumbing and heating equipment and supplies |
5085 | Industrial supplies - not elsewhere classified |
5094 | Precious stones and metals, watches and jewellery |
5099 | Durable goods - not elsewhere classified |
5111 | Stationery, office supplies and printing and writing paper |
5122 | Drugs, drug proprietors |
5131 | Piece goods, notions and other dry goods |
5137 | Men’s, women’s and children’s uniforms and commercial clothing |
5139 | Commercial footwear |
5169 | Chemicals and allied products - not elsewhere classified |
5192 | Books, periodicals and newspapers |
5193 | Florists’ supplies, nursery stock and flowers |
5198 | Paints, varnishes and supplies |
5199 | Non-durable goods - not elsewhere classified |
5200 | Home supply warehouse outlets |
5211 | Lumber and building materials outlets |
5231 | Glass, paint and wallpaper shops |
5251 | Hardware shops |
5261 | Lawn and garden supplies outlets, including nurseries |
5271 | Mobile home dealers |
5300 | Wholesale clubs |
5309 | Duty-free shops |
5310 | Discount shops |
5311 | Department stores |
5331 | Variety stores |
5399 | Miscellaneous general merchandise |
5411 | Groceries and supermarkets |
5422 | Freezer and locker meat provisioners |
5441 | Candy, nut and confectionery shops |
5451 | Dairies |
5462 | Bakeries |
5499 | Miscellaneous food shops - convenience and speciality retail outlets |
5511 | Car and truck dealers (new and used) sales, services, repairs, parts and leasing |
5521 | Car and truck dealers (used only) sales, service, repairs, parts and leasing |
5531 | Auto and home supply outlets |
5532 | Automotive tyre outlets |
5533 | Automotive parts and accessories outlets |
5541 | Service stations (with or without ancillary services) |
5542 | Automated fuel dispensers |
5551 | Boat dealers |
5561 | Camper, recreational and utility trailer dealers |
5571 | Motorcycle shops and dealers |
5592 | Motor home dealers |
5598 | Snowmobile dealers |
5599 | Miscellaneous automotive, aircraft and farm equipment dealers -not elsewhere classified |
5611 | Men’s and boys’ clothing and accessory shops |
5621 | Women’s ready-to-wear shops |
5631 | Women’s accessory and speciality shops |
5641 | Children’s and infants’ wear shops |
5651 | Family clothing shops |
5655 | Sports and riding apparel shops |
5661 | Shoe shops |
5681 | Furriers and fur shops |
5691 | Men’s and women’s clothing shops |
5697 | Tailors, seamstresses, mending and alterations |
5698 | Wig and toupee shops |
5699 | Miscellaneous apparel and accessory shops |
5712 | Furniture, home furnishings and equipment shops and manufacturers, except appliances |
5713 | Floor covering services |
5714 | Drapery, window covering and upholstery shops |
5715 | Alcoholic beverage wholesalers |
5718 | Fireplaces, fireplace screens and accessories shops |
5719 | Miscellaneous home furnishing speciality shops |
5722 | Household appliance shops |
5732 | Electronics shops |
5733 | Music shops - musical instruments, pianos and sheet music |
5734 | Computer software outlets |
5735 | Record shops |
5811 | Caterers |
5812 | Eating places and restaurants |
5813 | Drinking places (alcoholic beverages) - bars, taverns, night-clubs, cocktail lounges and discothèques |
5814 | Fast food restaurants |
5815 | Digital Goods-Media, Books, Movies, Music |
5816 | Digital Goods-Games |
5817 | Furriers and fur shopsDigital Goods-Software Applications (excluding games) |
5818 | Digital Goods-Multi-Category |
5912 | Drug stores and pharmacies |
5921 | Package shops - beer, wine and liquor |
5931 | Used merchandise and second-hand shops |
5935 | Wrecking and salvage yards |
5937 | Antique reproduction shops |
5940 | Bicycle shops - sales and service |
5941 | Sporting goods shops |
5942 | Bookshops |
5943 | Stationery, office and school supply shops |
5944 | Jewellery, watch, clock and silverware shops |
5945 | Hobby, toy and game shops |
5946 | Camera and photographic supply shops |
5947 | Gift, card, novelty and souvenir shops |
5948 | Luggage and leather goods shops |
5949 | Sewing, needlework, fabric and piece goods shops |
5950 | Glassware and crystal shops |
5962 | Telemarketing - travel-related arrangement services |
5963 | Door-to-door sales |
5964 | Direct marketing - catalogue merchants |
5965 | Direct marketing - combination catalogue and retail merchants |
5966 | Direct marketing - outbound telemarketing merchants |
5967 | Direct marketing - inbound telemarketing merchants |
5968 | Direct marketing - continuity subscription merchants |
5969 | Direct marketing direct marketers - not elsewhere classified |
5970 | Artist supply and craft shops |
5971 | Art dealers and galleries |
5972 | Stamp and coin shops |
5973 | Religious goods and shops |
5975 | Hearing aids - sales, service and supplies |
5976 | Orthopaedic goods and prosthetic devices |
5977 | Cosmetic shops |
5978 | Typewriter outlets - sales, service and rentals |
5983 | Fuel dealers - fuel oil, wood, coal and liquefied petroleum |
5992 | Florists |
5993 | Cigar shops and stands |
5994 | Newsagents and news-stands |
5995 | Pet shops, pet food and supplies |
5996 | Swimming pools - sales, supplies and services |
5997 | Electric razor shops - sales and service |
5998 | Tent and awning shops |
5999 | Miscellaneous and speciality retail outlets |
7011 | Lodging - hotels, motels and resorts |
7032 | Sporting and recreational camps |
7033 | Trailer parks and camp-sites |
7210 | Laundry, cleaning and garment services |
7211 | Laundry services - family and commercial |
7216 | Dry cleaners |
7217 | Carpet and upholstery cleaning |
7221 | Photographic studios |
7230 | Beauty and barber shops |
7251 | Shoe repair shops, shoe shine parlours and hat cleaning shops |
7261 | Funeral services and crematoriums |
7273 | Dating and escort services |
7278 | Buying and shopping services and clubs |
7295 | Babysitting and housekeeping services |
7296 | Clothing rentals - costumes, uniforms and formal wear |
7297 | Massage parlours |
7298 | Health and beauty spas |
7299 | Miscellaneous personal services - not elsewhere classified |
7311 | Advertising services |
7333 | Commercial photography, art and graphics |
7338 | Quick copy, reproduction and blueprinting services |
7339 | Stenographic and secretarial support services |
7342 | Exterminating and disinfecting services |
7349 | Cleaning, maintenance and janitorial services |
7361 | Employment agencies and temporary help services |
7372 | Computer programming, data processing and integrated systems design services |
7375 | Information retrieval services |
7379 | Computer maintenance and repair services - not elsewhere classified |
7392 | Management, consulting and public relations services |
7393 | Detective agencies, protective agencies and security services, including armoured cars and guard dogs |
7394 | Equipment, tool, furniture and appliance rentals and leasing |
7395 | Photofinishing laboratories and photo developing |
7399 | Business services - not elsewhere classified |
7511 | Reserved for national use |
7512 | Automobile rentals |
7513 | Truck and utility trailer rentals |
7519 | Motor home and recreational vehicle rentals |
7523 | Parking lots and garages |
7531 | Automotive body repair shops |
7534 | Tyre retreading and repair shops |
7535 | Automotive paint shops |
7538 | Automotive service shops (non-dealer) |
7542 | Car washes |
7549 | Towing services |
7622 | Electronics repair shops |
7623 | Air conditioning and refrigeration repair shops |
7629 | Electrical and small appliance repair shops |
7631 | Watch, clock and jewellery repair shops |
7641 | Furniture reupholstery, repair and refinishing |
7692 | Welding services |
7699 | Miscellaneous repair shops and related services |
7829 | Motion picture and video tape production and distribution |
7832 | Motion picture theatres |
7841 | Video tape rentals |
7911 | Dance halls, studios and schools |
7922 | Theatrical producers (except motion pictures) and ticket agencies |
7929 | Bands, orchestras and miscellaneous entertainers - not elsewhere classified |
7932 | Billiard and pool establishments |
7933 | Bowling alleys |
7941 | Commercial sports, professional sports clubs, athletic fields and sports promoters |
7991 | Tourist attractions and exhibits |
7992 | Public golf courses |
7993 | Video amusement game supplies |
7994 | Video game arcades and establishments |
7996 | Amusement parks, circuses, carnivals and fortune tellers |
7997 | Membership clubs (sports, recreation, athletic), country clubs and private golf courses |
7998 | Aquariums, seaquariums and dolphinariums |
7999 | Recreation services - not elsewhere classified |
8011 | Doctors and physicians - not elsewhere classified |
8021 | Dentists and orthodontists |
8031 | Osteopaths |
8041 | Chiropractors |
8042 | Optometrists and ophthalmologists |
8043 | Opticians, optical goods and eyeglasses |
8049 | Podiatrists and chiropodists |
8050 | Nursing and personal care facilities |
8062 | Hospitals |
8071 | Medical and dental laboratories |
8099 | Medical services and health practitioners - not elsewhere classified |
8111 | Legal services and attorneys |
8211 | Elementary and secondary schools |
8220 | Colleges, universities, professional schools and junior colleges |
8241 | Correspondence schools |
8244 | Business and secretarial schools |
8249 | Trade and vocational schools |
8299 | Schools and educational services - not elsewhere classified |
8351 | Child care services |
8641 | Civic, social and fraternal associations |
8675 | Automobile associations |
8699 | Membership organizations - not elsewhere classified |
8734 | Testing laboratories (non-medical) |
8911 | Architectural, engineering and surveying services |
8931 | Accounting, auditing and bookkeeping services |
8999 | Professional services - not elsewhere classified |
9399 | Government Services - not elsewhere classified |
includes the following parameters:
Alipay userID that Alipay account for transfer refund fee . Alipay userID that composed of 16 digits beginning with 2088.
Split Amount. The format must be correct to the currency.
Split currency .The currency must be same with refund currency. If parameter (total_fee) was used, the split currency must be foreign currency and the same with settlement currency. If parameter (rmb_fee) was used, the split currency must be “CNY”. The parameter (total_fee and rmb_fee ) are mutual exclusive.
Split discretion
{
"transOut": "2088101126708402",
"amount": "0.10",
"currency": "USD",
"desc": "test1"
}
- The split detail is in JSON format, and includes the following parameters:
- You can own at most 10 domestic split accounts.
- You must own a domestic split account that has contracted successfully with Alipay. The domestic split account need to be linked with the global primary account. To check whether the link is successfully built, contact Global Merchant Technical Support (overseas_support@service.alibaba.com).
Alipay userID that Alipay account for deposit. Alipay userID that composed of 16 digits beginning with 2088.
Split Amount. The format must be correct to the currency.
Split currency. If parameter (total_fee) was used, the split currency must be foreign currency and the same with settlement currency. If parameter (rmb_fee) was used, the split currency must be “CNY”. The parameter (total_fee and rmb_fee ) are mutual exclusive.
- Alipay can only accept 4 types of funds for settlement in your designated Chinese Alipay bank account: (i) insurance fee (relating to the delivery), (ii) relevant tax, (iii) any delivery fee for goods and services; and (iv) any other fees directly related to a transaction submitted to Alipay.
Notes:
- In case a merchant wishes to price their products in RMB, the merchant can put the CNY payment amount in the rmb_fee field. In the same time, total_fee filed should be ignored. The payment amount will be displayed in RMB to the user.
- The merchant should not change the value of the currency field, which is the settlement currency which Alipay will pay the merchant in.
- The total_fee or rmb_fee fields are mutually exclusive. One and only one of them should be used.
- For the amount of charge in total_fee or rmb_fee field, the number should be in the form with 2 digits after the decimal point, for example, 100.30 USD. But for Japanese and Korean currency, the number should be 0 digit after the decimal point, like 1000 KRW and 1000 JPY. The system will return with exception for numbers in other formats, for example, USD 101.999.
- If both order_gmt_create + order_valid_time and timeout_rule are passed, order_gmt_create + order_valid_time will be used for order timeout control. Alipay suggests to use order_gmt_create + order_valid_time for order timeout control.
- The merchant could not attach parameters to return_url, and hoping them be passed by Alipay. Alipay will remove all extra parameters in the return_url field.
Business type. 5 types are supported. 1: Hotel 2: AIR 3: Overseas study consulting 4: Sales of goods 5: Others, including all the other business types that do not fall into the above 4 categories. For example, mobile data service recharge, airport pick up service, etc. If more than one type is involved, separate type values with vertical bar (|).
Hotel name that consists of numbers, letters, spaces, and special characters including ,.<>()[]/-,. If more than one hotel name exists, separate values with vertical bar (|). Specify this field only when business_type is 1 (Hotel).
Check-in time. Format: yyyy-MM-dd. Timezone: GMT +8. Specify this field only when business_type is 1 (Hotel).
Check-out time. Format: yyyy-MM-dd. Timezone: GMT +8. Specify this field only when business_type is 1 (Hotel).
Flight number. If flight transfer exists, separate flight numbers with vertical bar (|). Specify this field only when business_type is 2 (AIR).
Departure time. Format: yyyy-MM-dd HH:mm Timezone: GMT +8. If flight transfer exists, separate time values with vertical bar (|). Specify this field only when business_type is 2 (AIR).
If business_type is 3 (Overseas study consulting), the URL of admission notice (image) must be specified.
Goods information that includes SKU names and corresponding quantities, in the format of SKU_name^quantity. If more than one goods exists, separate values with vertical bar (|). Specify this field only when business_type is 4 (Sales of goods).
Total quantities of all goods in one order. Specify this field only when business_type is 4 (Sales of goods).
If business_type is 5 (Others), specify the business type in details.
Order payment Obtain SDK version number
Express pay SDK API on Android platform is shown in the following table:
API name | API description |
---|---|
PayTask | SDK provides object APIs of payment and inquiry. |
PayTask object mainly provides sellers with order payment function and obtains current SDK version number.
The client-side SDK can facilitate your integration with Alipay.
API name: AlipaySDK Description: AlipaySDK provides payment function. Alipay API provides sellers with order payment function. Methods provided by API are detailed in table 1 below:
Method name | Method description |
---|---|
+(Alipay *)defaultService; | Obtain payment service examples. |
-(BOOL)isLogined; | Check whether or not the seller is logged in locally. |
-(void)payOrder:(NSString )orderStr fromScheme:(NSString )schemeStr callback:(CompletionBlock)completionBlock; | Pay and get result via callback. |
- Express order payment iOS
- Processing Client Side Returned URL
- Callback API
Express order payment iOS
- Method name: Pay method
- Method prototype: (void)payOrder:(NSString )orderStr fromScheme:(NSString )schemeStr callback:(CompletionBlock)completionBlock;
- Method function: Pay method provides sellers with express order payment function.
Parameter Name | Parameter Description |
---|---|
NSString* scheme | URL protocol registered by seller program is for the use of seller callback program after payment has been completed. |
(CompletionBlock)completionBlock | Express pay SDK callback function returns with “no need to log in” and payment result. When the Alipay client side is not installed locally, or when the Alipay client side is not successfully called to make payment (via H5 cashier), it will return to payment result via completionBlock. Please refer to “synchronous response parameter” for more details on the relevant payment results. |
NSString* orderStr | Pay and get result via callback. |
Payment parameters examples are shown below, see “Request Parameters Description” for parameters description:
partner="2088101568358171"&seller_id="xxx@alipay.com"&out_trade_no="0819145412-6177"&subject="test"&body="testtest"&total_fee="0.01"¤cy="USD"&forex_biz="FP"¬ify_url="http://notify.msp.hk/notify.htm"&service="mobile.securitypay.pay"&payment_type="1"&_input_charset="utf-8"&it_b_pay="30m"&sign="lBBK%2F0w5LOajrMrji7DUgEqNjIhQbidR13GovA5r3TgIbNqv231yC1NksLdw%2Ba3JnfHXoXuet6XNNHtn7VE%2BeCoRO1O%2BR1KugLrQEZMtG5jmJIe2pbjm%2F3kb%2FuGkpG%2BwYQYI51%2BhA3YBbvZHVQBYveBqK%2Bh8mUyb7GM1HxWs9k4%3D"&sign_type="RSA"&secondary_merchant_id="834945"&secondary_merchant_industry="3435"&secondary_merchant_name="holiday"
Processing client side returned URL
- Method name: processing client method
- Method prototype: -(void)processOrderWithPaymentResult:(NSURL*)resultUrl standbyCallback:(CompletionBlock)completionBlock;
- Method function: Client side processing method processes the Alipay client side returned _url _when the device has installed Alipay app.
Note:
This method must be implemented, otherwise when Alipay app is installed, the payment result cannot be synchronously returned.
Parameter Name | Parameter Description |
---|---|
NSURL *resultUrl | url returned by Alipay client |
CompletionBlock completionBlock | When Alipay client is installed locally and Alipay client is successfully called to make payment, it will return payment result via completionBlock |
Note:
Please call this method - (BOOL)application:(UIApplication )application openURL:(NSURL )url sourceApplication:(NSString )sourceApplication annotation:(id)annotation in APPDelegate. In iOS9.0 and above versions (including iOS9.0), please call this method in - (BOOL)application:(UIApplication )app openURL:(NSURL )url options:(NSDictionary )options . See Demo for details.
Callback API
After the payment is completed, it will return the payment result synchronously via callbackBlock. Result returned needs to use value of the resultStatus and result fields to determine the payment result. When verifications of resultStatus=9000 and success=“true”, as well as sign=“xxx” are passed, payment is confirmed to be successful, otherwise, it may be regarded as failure. For circumstances of low security level, payment result can be determined by checking resultStatus and success=“true” only. An example of a successful order payment is shown below:
{ memo = ""; result = "partner=\"2088101568358171\"&seller_id=\"xxx@alipay.com\"&out_trade_no=\"0819145412-6177\"&subject=\"test\"&body=\"testtest\"&total_fee=\"0.01\"¤cy=\"USD\"&forex_biz=\"FP\"¬ify_url=\"http://notify.msp.hk/notify.htm\"&service=\"mobile.securitypay.pay\"&payment_type=\"1\"&_input_charset=\"utf-8\"&it_b_pay=\"30m\"&success=\"true\"&sign_type=\"RSA\"&sign=\"hkFZr+zE9499nuqDNLZEF7W75RFFPsly876QuRSeN8WMaUgcdR00IKy5ZyBJ4eldhoJ/2zghqrD4E2G2mNjs3aE+HCLiBXrPDNdLKCZgSOIqmv46TfPTEqopYfhs+o5fZzXxt34fwdrzN4mX6S13cr3UwmEV4L3Ffir/02RBVtU=\""; resultStatus = "9000"; }
Note:
The extraction of payment result must be obtained via CompletionBlock, and it prohibits developers from analysing payment results returned URL without permission. Key of the obtained value corresponds to resultStatus, memo and result (developers can analyse the value in the result at their own discretion);
In order to ensure the functioning of the existing seller’s SDK, the initial letter of return parameter ResultStatus is capitalized. For new SDKs, the conversion from ResultStatus to resultStatus has been implemented by unified tool classes, sellers can obtain resultStatus from CompletionBlock.
Decompress API compressed file (file name is WS_MOBILE_PAY_SDK_BASE.zip), find out iOS compressed file (file name is 支付宝钱包支付开发包标准版(iOS).zip). Perform the following steps to install and configure the SDK:
- Import code
- Remarks for Running Demo Code
- Configuration
- Example on logic of code
Import code
Step 1: Start the IDE such as Xcode, copy the files in the zip file into the folder and import them into the project.
AlipaySDK.bundle
AlipaySDK.framework
Add the dependencies in Build Phases / Link Binary With Libraries:
- The following scenarios would need special attention:
- If it is Xcode 7.0 and above,it needs to include libc++.tbd、libz.tbd;
- If it is Xcode version below 7.0,it needs to include libc++.dylib, libz.dylib.
Step 2: Add import to where AlipaySDK is required
Step 3: If the app is based on 9.0 compilation, due to the limitation of App Transport Security(ATS) on http in iOS9.0, we need to add exception for alipay.com, alipayobjects.com. in info.list.
<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>alipay.com</key>
<dict>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
<true/>
<key>NSTemporaryExceptionMinimumTLSVersion</key>
<string>TLSv1.0</string>
<key>NSTemporaryExceptionRequiresForwardSecrecy</key>
<false/>
</dict>
<key>alipayobjects.com</key>
<dict>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
<true/>
<key>NSTemporaryExceptionMinimumTLSVersion</key>
<string>TLSv1.0</string>
<key>NSTemporaryExceptionRequiresForwardSecrecy</key>
<false/>
</dict>
</dict>
</dict>
Step 4: Set up the payment request.
Verification signature generated using API key.Signature Verification
MyMoney merchant id
The payment ID for the original payment transaction
The unique refund ID for refund request
Signatures (MD5 digests) are used to verify incoming API requests and sign outgoing asynchronous notifications. An API key is required to generate the signature. The API key can be requested from Mymoney customer service.
For example: For the following data set: $pararameters = {“f”:456, “a”:null, “d”: “”, “e”: “mymoney”};
- Parameters should be Rearranged alphabetically so the $parameters = {“a”:null, “d”:"", “e”:“mymoney”,“f”:456};
- Delete parameters with empty value, null value so the $parameters = {“e”:“mymoney”, “f”:456}
- connect rearranged parameters with &, Generate a pre_str $pre_str = “e=mymoney&f=456”
- Add API key to the end of the query string. $temp_str = “e=mymoney&f=456{$api_key}”
- Generate a MD5 sinature and user this as the value of the common parameter name “sign” $sign = md5($temp_str);
对接渠道的code
需要mymoney 生成secret 给上游通道对接人员使用,验证是否是由mymoney发送过去的数据,利于数据安全,验证签名
对接支付宝
Request parameters
需要mymoney 生成secret 给上游通道对接人员使用,验证是否是由mymoney发送过去的数据,利于数据安全,验证签名
The transaction ID in the partner system, can be a sale order id and payment order id. Note: Partners are required to ensure the uniqueness of this parameter in each call. This parameter is also the key parameter for issue investigation
The name of the transaction, shown in the transaction record list.
The pricing currency, used for labelling the price of the transaction. This currency is also the settlement currency Alipay settled to the partner. Use upper case.
The transaction amount in the pricing currency. The value is in the range of 0.01 - 100000000.00 and with two decimal places.
Extended information, containing extended parameters and merchant business information. For more details, see extend_info
服务的名称:固定值
Responses
Body
Status of the API call, used to indicate whether the request is accepted by Alipay gateway. T: accepted F: rejected
["20190730100951","OVERSEAS_MBARCODE_PAY","UTF-8","barcode","157e625bce792646a66bda8fe3a039fc","2088131906583189","TEST","0.01","{\"secondary_merchant_name\":\"\\u7687\\u671dRoyal China (Baker Street)\",\"secondary_merchant_id\":\"35\",\"secondary_merchant_industry\":\"5812\",\"store_id\":\"F1C0CD1410\",\"store_name\":\"\\u7687\\u671dRoyal China (Baker Street) store\"}","1640473864361077","2088131906583189","alipay.acquire.overseas.spot.pay","GBP","287961709634870096","MD5"]
Alipay login ID of the buyer, can be an email address or mobile number. The ID is partially masked for privacy.
Alipay account number starting with 2088, unique in Alipay system
The time that the transaction was paid. Format: YYYYMMDDHHMMSS
On the partner payment request, the Alipay system creates a transaction ID to handle it. The alipay_trans_id has one-one association with partner + partner_trans_id
The currency used for labelling the price of the transaction
Conversion rate of the currency given in the request to CNY. The conversion happens at the time when Alipay trade order is created.
Equal to the partner_trans_id given in the request
Response status of a request. The value can be: SUCCESS: The payment succeeds. FAILED: The payment is failed. Merchants can show the corresponding failure result to the cashier. UNKNOW: The payment result is unknown. For offline mode, the partner system need to cancel this transaction immediately. For offline to online mode, the partner system is suggested to query the transaction status in a certain frequency until a clear status is returned, or merchants can cancel this transaction after a certain time.
Transaction amount in the pricing currency. The value of this parameter is in the range of 0.01 - 100000000.00 and with two decimal places.
Transaction amount in CNY. It is the exact amount that the buyer has paid.
Sign value. Note: This field is not returned if the error code is ILLEGAL_SIGN.
Sign type. DSA, RSA, and MD5 are supported. Use uppercase. Note: This field is not returned if the error code is ILLEGAL_SIGN.
Request parameters
需要mymoney 生成secret 给上游通道对接人员使用,验证是否是由mymoney发送过去的数据,利于数据安全,验证签名
fix value
The original partner transaction id given in the payment request
The refund order id on partner system. partner_refund_id cannot be same as partner_transaction_id partner_refund_id together with partner identify a refund transaction
Less than or equal to the original transaction amount and the left transaction amount if ever refunded.
The refund currency. Use upper case. See <a href="https://global.alipay.com/doc/integration/currency"target=_blank>Supported Currency List for details.
The refund request is processed synchronously or asynchronously. Value: Y or N. Default value is N, which means an asynchronous response from Alipay is returned to the merchant if the merchant has set the value of the notify_url field when sending the refund request. If the value is set as Y, it means only a synchronous response is returned to the merchant.
Responses
Body
["1640473864361077","2088131906583189","utf-8","alipay.acquire.overseas.spot.refund","3758e5e0c38f53e5595321389d88c375","0.01","GBP","1564478133","1640474222730505","MD5","1564478133"]
On the partner’s payment request, the alipay system creates a transaction id to handle it. The alipay_trans_id has one-one association with partner + partner_trans_id.
Refund currency
The rate of conversion the currency given in the request to CNY. The conversion happens at the time when Alipay’s trade order is created
The refund order id on partner system. partner_refund_id together with partner identify a refund transaction
Equal to the partner_trans_id given in the request
Less than or equal to the original transaction amount and the left transaction amount if ever refunded.
Refund amount in CNY. It is the exact amount that the Alipay has refunded.
To describe the response status of a request: SUCCESS, FAILED, UNKNOW.
Option | Description |
---|---|
secondary_merchant_id | A unique ID assigned by the partner to identify a secondary merchant. The ID can contain letters, numbers, and underscores. Max length: 64 bytes. |
secondary_merchant_name | Secondary merchant name, shown in the Alipay Wallet and the reconciliation file to identify a secondary merchant. Max length: 128 bytes.Note: This parameter is required for partners. |
secondary_merchant_industry | The industry classification identifier of sub-merchant is assigned by Alipay.For example:Catering industry: 5812 Department stores: 5311 Lodging industry: 7011 Taxi industry: 4121 For more details, see secondary merchant industry list. Note: This parameter is required for partners. |
store_name | Store name. The value of this parameter can be null only when the store information is verified. |
store_id | Store ID, used to identify the store of a merchant. The ID can only contain letters, numbers, and underscores.Max length: 64 bytes. If this parameter is not provided, the transaction is to be intercepted for risk control reasons. |
Request parameters
需要mymoney 生成secret 给上游通道对接人员使用,验证是否是由mymoney发送过去的数据,利于数据安全,验证签名
服务的名称-固定值:pos_pay_wechat
商户系统内部订单号,要求32个字符内,只能是数字、大小写字母_-|*@ ,且在同一个商户号下唯一。 transaction_id、out_trade_no二选一,如果同时存在优先级:transaction_id> out_trade_no
扫码支付授权码,设备读取用户微信中的条码或者二维码信息 (注:用户付款码条形码规则:18位纯数字,以10、11、12、13、14、15开头)
商品或支付单简要描述,格式要求:门店品牌名-城市分店名-实际商品名称
符合ISO 4217标准的三位字母代码,默认人民币:CNY,
支持IPV4和IPV6两种格式的IP地址。调用微信支付API的机器IP
Responses
Body
SUCCESS/FAIL 此字段是通信标识,非交易标识,交易是否成功需要查看result_code来判断
返回信息,如非空,为错误原因 签名失败 参数格式校验错误
服务商商户的APPID
调用接口提交的商户号
调用接口提交的子商户号
微信返回的随机字符串
微信返回的签名
SUCCESS/FAIL
用户在商户appid 下的唯一标识
用户是否关注公众账号,仅在公众账号类型支付有效,取值范围:Y或N;Y-关注;N-未关注
支付类型为MICROPAY(即扫码支付)
银行类型,采用字符串类型的银行标识,
订单总金额,单位为分,只能为整数,
符合ISO 4217标准的三位字母代码,默认人民币:CNY
微信支付订单号
商户系统内部订单号,要求32个字符内,只能是数字、大小写字母_-|*且在同一个商户号下唯一。
商家数据包,原样返回
支付完成时间,订单生成时间,格式为yyyyMMddHHmmss,如2009年12月25日9点10分10秒表示为20091225091010。
现金支付金额订单现金支付金额
货币类型,符合ISO 4217标准的三位字母代码
费率
版本号
Request parameters
需要mymoney 生成secret 给上游通道对接人员使用,验证是否是由mymoney发送过去的数据,利于数据安全,验证签名
服务的名称固定值:pos_refund_wechat
商户系统内部订单号,要求32个字符内,只能是数字、大小写字母_-|*@ ,且在同一个商户号下唯一。 transaction_id、out_trade_no二选一,如果同时存在优先级:transaction_id> out_trade_no
商户系统内部的退款单号,商户系统内部唯一,只能是数字、大小写字母_-|*@ ,同一退款单号多次请求只退一笔。
订单总金额,单位为分,只能为整数
退款总金额,单位为分,只能为整数,可部分退款
微信订单号
Responses
Body
SUCCESS/FAIL 此字段是通信标识,表示接口层的请求结果,并非退款状态。
返回信息,如非空,为错误原因 签名失败 参数格式校验错误
服务商商户的APPID
微信支付分配的商户号
微信支付分配的子商户号
随机字符串,不长于32位
SUCCESS/FAIL SUCCESS退款申请接收成功,结果通过退款查询接口查询 FAIL 提交业务失败
微信订单号
商户系统内部订单号,要求32个字符内,只能是数字、大小写字母_-|*@ ,且在同一个商户号下唯一。
商户系统内部的退款单号,商户系统内部唯一,只能是数字、大小写字母_-|*@ ,同一退款单号多次请求只退一笔
微信退款单号
退款总金额,单位为分,可以做部分退款
代金券退款金额<=退款金额,退款金额-代金券或立减优惠退款金额为现金
订单总金额,单位为分,只能为整数,
现金支付金额,单位为分,只能为整数,
订单金额货币类型,符合ISO 4217标准的三位字母代码,默认人民币:CNY
退款代金券使用数量
现金退款金额,单位为分,只能为整数
退款货币类型,需与支付一致,或者不填。符合ISO 4217标准的三位字母代码,默认人民币:CNY,
现金类型
现金退款类型
微信支付分配的子商户号
商户系统内部订单号,要求32个字符内,只能是数字、大小写字母_-|*@ ,且在同一个商户号下唯一。 transaction_id、out_trade_no二选一,如果同时存在优先级:transaction_id> out_trade_no
用户是否关注公众账号,仅在公众账号类型支付有效,取值范围:Y或N;Y-关注;N-未关注
用户是否关注公众账号,仅在公众账号类型支付有效,取值范围:Y或N;Y-关注;N-未关注
N
商户系统内部订单号,要求32个字符内,只能是数字、大小写字母_-|*且在同一个商户号下唯一。
商户系统内部订单号,要求32个字符内,只能是数字、大小写字母_-|*且在同一个商户号下唯一。
21269300920190730102453
服务的名称
Request parameters
需要mymoney 生成secret 给上游通道对接人员使用,验证是否是由mymoney发送过去的数据,利于数据安全,验证签名
微信订单号,微信的订单号,优先使用 微信订单号和商户订单号不能同时为空
Responses
Body
此字段是通信标识,非交易标识,交易是否成功需要查看trade_state来判断
返回信息,如非空,为错误原因 签名失败 参数格式校验错误
服务商商户的APPID
微信支付分配的商户号
微信支付分配的子商户号 微信分配的子商户公众账号ID
随机字符串,不长于32位
签名
业务结果
付款银行,银行类型,采用字符串类型的银行标识
支付完成时间
交易状态描述,对当前查询订单状态的描述和下一步操作的指引
支付成功
转入退款
未支付
已关闭
已撤销(刷卡支付)
用户支付中
支付失败(其他原因,如银行返回失败)
现金支付货币类型,货币类型,符合ISO 4217标准的三位字母代码,默认人民币:CNY,其他值列表详见货币类型
微信支付分配的子商户号
微信订单号,微信的订单号,优先使用 微信订单号和商户订单号不能同时为空
商户订单号,商户系统内部订单号,要求32个字符内,只能是数字、大小写字母_-|*@ ,且在同一个商户号下唯一。 微信订单号 和商户订单号不能同时为空
Request parameters
微信订单号,微信的订单号,优先使用 微信订单号和商户订单号不能同时为空
商户订单号,商户系统内部订单号,要求32个字符内,只能是数字、大小写字母_-|*@ ,且在同一个商户号下唯一。 微信订单号 和商户订单号不能同时为空
Responses
Body
Request parameters
商户订单号,商户系统内部订单号,要求32个字符内,只能是数字、大小写字母_-|*@ ,且在同一个商户号下唯一。 微信订单号 和商户订单号不能同时为空
Responses
Body
Request parameters
The payment ID for the original payment transaction
alipay online partner_id
Responses
Body
The status of the API call can be:T: successF: failed Example:T
["mm_2_001-201908260000000000001","2088431618698950","single_trade_query","utf-8"]
Merchandise description. Special characters are not supported.
Buyer’s Alipay account
A unique buyer ID assigned by Alipay
The discount amount
This parameter indicates whether the trade transaction is locked.1: the transaction is locked.0: the transaction is not locked.
The time when the transaction is created. Format: yyyy-MM-dd HH:mm:ss. Use GMT+8.
The last time when the value of total_fee is modified. Format: yyyy-MM-dd HH:mm:ss. Use GMT +8
The time when the transaction is paid by the buyer. Format: yyyy-MM-dd HH:mm:ss. Use GMT+8.
is_total_fee_adjust
The operator role can be:B: BuyerS: Seller
A unique transaction ID assigned by the partner
The payment type. See Payment Type for details.
The merchandise price in CNY. Value range: 0.01 - 100000000.00, accurate to two decimal places
The quantity of merchandises
Partner Alipay Account
A unique seller ID assigned by Alipay. This 16-digit number begins with 2088.
Merchandise title. Special characters are not supported.
The accumulative refunded amount paid to the buyer
The accumulative amount paid to the seller
Transaction amount in CNY. It is the exact amount that the buyer has paid. Accurate to two decimal places
A unique transaction ID assigned by Alipay, with a maximum length of 64 bytes and minimum length of 16 bytes. If both trade_no and out_trade_no appear, trade_no takes precedence.
Transaction status, the value can be:TRADE_FINISHED WAIT_BUYER_PAY TRADE_CLOSED
This parameter indicates whether the Alipay coupon is used in the transaction.T: TrueF: False
Request parameters
The URL for receiving asynchronous notifications after the payment is completed.
The URL for receiving asynchronous notifications after the payment is completed.
Brief description of the transaction. Special characters are not supported.Note: The value of this field will be displayed to customers.
Detailed description about the goods. Special characters are not supported.
Unique transaction ID specified by the merchant. If the ID is duplicated with the out_trade_no of a previous transaction, the payment fails and an error message is returned to indicate that the payment is duplicated.
Settlement currency code that the merchant specifies in the contract.Use upper case. See Supported Currencies for details.
A floating number in the range of 0.01~1000000.00. If total_fee is not null, it means the transaction uses foreign currency and the product price will be calculated in RMB based on the exchange rate.
A floating number in the range of 0.01 - 1000000.00. This parameter is used to replace the total_fee parameter if partners want to price their product in RMB. If total_fee is used, don’t set the rmb_fee parameter because they are mutually exclusive.
The default value is 12h. Contact Alipay Technical Support if you need to use other values. This parameter specifies the valid time from login to completion.
Supplier name, for page display purpose.
A unique ID assigned by the partner to identify a secondary merchant. The ID can contain letters, numbers, and underscores. Note: This parameter is required for acquirers and system integrators with secondary merchants.
Secondary merchant name, shown in the Alipay Wallet and the reconciliation file to identify a secondary merchant.Note: This parameter is required for acquirers and system integrators with secondary merchants.
Industry classification identifier of sub-merchant which assigned by Alipay. For example:catering industry: 5812department stores: 5311lodging industry: 7011taxi industry: 4121For more details, see secondary merchant industry list.Note: This parameter is required for acquirers and system integrators with secondary merchants.
Website of the secondary merchant
The code of the Alipay product you use. In this case, the value of this field is NEW_WAP_OVERSEAS_SELLER.
Split info in JSON format. For more details, see Split Detail info
The flag that is used to identify whether the transaction activates Alipay wallet app to process the payment. If Alipay wallet app is not installed, the payment will be processed by WAP page.
Information about the trade industry. See trade_information for details.
Responses
Body
Request parameters
The URL for receiving asynchronous notifications after the payment is completed.
After the payment is completed, the result is sent to this URL through URL redirect.
Brief description of the transaction. Special characters are not supported.Note: The value of this field will be displayed to customers.
Detailed description of the goods. Special characters are not supported.
Unique transaction ID specified by the partner. If the ID is duplicated with an earlier transaction’s out_trade_no, the payment will fail with a error message indicating that the payment is duplicated.
Settlement currency code that the merchant specifies in the contract.Use upper case. See Supported Currencies for details.
A floating number in the range of 0.01 - 1000000.00.If total_fee is not null, it means the transaction uses foreign currency and the product price will be calculated in RMB based on the
A floating number in the range of 0.01 - 1000000.00. This parameter is used to replace the total_fee parameter if partners want to price their product in RMB. If total_fee is used, don’t set the rmb_fee parameter because they are mutually exclusive.
The default value is 12h. Contact Alipay Technical Support if you need to use other values. This parameter specifies the valid time from login to completion.
YYYY-MM-DD HH:MM:SS Use Beijing time to synchronize with Alipay system. This parameter can only be used with order_valid_time together to control the valid time from redirection to login.
Order valid time in seconds.Max value is 2592000. This parameter can only be used with the order_gmt_create parameter to control the valid time. If the current time passes the time of order_gmt_create plus order_valid_time, the payment transaction will be closed.
Supplier name, for page display.
A unique ID assigned by the partner to identify a secondary merchant. The ID can contain letters, numbers, and underscores. Note: This parameter is required for acquirers and system integrators with secondary merchants.
Secondary merchant name, shown in the Alipay Wallet and the reconciliation file to identify a secondary merchant. Note: This parameter is required for acquirers and system integrators with secondary merchants.
Industry classification identifier of sub-merchant which is assigned by Alipay. For example:catering industry: 5812department stores: 5311lodging industry: 7011taxi industry: 4121 Note: This parameter is required for acquirers and system integrators with secondary merchants.
Website of the secondary merchant
Product code. The value is fixed as NEW_OVERSEAS_SELLER in this interface
Split info in JSON format. For more details, see Split Detail info
Information about the trade industry. [] See trade_information for details.
Responses
Body
Request parameters
After the payment is completed, the web page is redirected to this URL
The URL for receiving asynchronous notifications after the payment is completed.
A string used to identify client source. Parameter value is agreed as follows:appenv=“system=client platform name ^version=business system version”, for example:appenv="system=iphoneversion=3.0.1.2"appenv=“system=ipadversion=4.0.1.1”
Unique transaction ID specified by the merchant. If the ID is duplicated with the out_trade_no of a previous transaction, the payment fails and an error message is returned to indicate that the payment is duplicated.
Product title, transaction title, order title, or order keywords.
Payment type. The default value is 1 ( stands for purchase of goods)
A floating number in the range of 0.01 - 1000000.00.If total_fee is not null, it means the transaction uses foreign currency and the product price will be calculated in RMB based on the exchange rate.
A floating number in the range of 0.01 - 1000000.00. This parameter is used to replace the total_fee parameter if partners want to price their product in RMB. If total_fee is used, don’t set the rmb_fee parameter because they are mutually exclusive.
Detailed description about the goods. Special characters are not supported.
Use upper case. See Supported Currencies for details.
Specify FP to this field.
Use this parameter to specify the expiration time of unpaid transactions. The transaction is automatically closed if the transaction expires.The value can be:A period of time after which the transaction is to be closed. The value is in the range of 1m - 15d, m for minute, h for hour, d for day, 1c represents the current day. When 1c is specified, the transaction is closed at 0:00 whenever the transaction was created.The demical number is not supported. Convert the demical number to a whole number. For example, 1.5h can be converted into 90m. A date in the format of YYYY-MM-DD HH:MM:SS, after which the transaction is to be closed. For example: 2018-06-13 16:00:00.Note: If this field is specified, Alipay needs to be advised to set the close time
Token that includes account information, returned by open platform. With the authorization token, merchants can access some services of Alipay within a specified period.
A unique ID assigned by the partner to identify a secondary merchant. The ID can contain letters, numbers, and underscores. Note: This parameter is required for acquirers and system integrators with secondary merchants.
Secondary merchant name, shown in the Alipay Wallet and the reconciliation file to identify a secondary merchant. Note: This parameter is required for acquirers and system integrators with secondary merchants.
Industry classification identifier of sub-merchant which assigned by Alipay. For example:catering industry: 5812department stores: 5311lodging industry: 7011taxi industry: 4121 For more details, see secondary merchant industry list. Note: This parameter is required for acquirers and system integrators with secondary merchants.
The link to download the merchant app.
Product code. The value is NEW_WAP_OVERSEAS_SELLER
Split info in JSON format. For more details, see Split Detail info
Request parameters
The unique refund ID for refund request
The payment ID for the original payment transaction
The amount to refund in settlement currency. The value is in the range of 0.01 – 1000000, with at most 2 digits after the decimal point. One of the following two parameters must be specified: return_amount return_rmb_amount
Use this field to refund in CNY. The value is in the range of 0.01 – 1000000, with at most 2 digits after the decimal point. One of the following two parameters must be specified: return_amount return_rmb_amount
Currency code. Even when the return_rmb_amount parameter is not null, currency is still the foreign currency, not CNY.Use upper case.See Supported Currencies for details.
Refund transaction time. Format: YYYYMMDDHHMMSS, Beijing Time
Reason for the refund
Product code, which is NEW_OVERSEAS_SELLER for website payment refund, and is NEW_WAP_OVERSEAS_SELLER for WAP or APP payment refund.
To indicate that the refund request is processed synchronously or asynchronously with a value of Y or N.The default value is N, which means an asynchronous response from Alipay is returned to the merchant if the merchant has set the value of the notify_url field when sending the refund request. If the value is set as Y, it means only a synchronous response is returned to the merchant
Split info in JSON format. For more details, see Refund Split Detail Info.
需要mymoney 生成secret 给上游通道对接人员使用,验证是否是由mymoney发送过去的数据,利于数据安全,验证签名
Responses
Body
Status of the API call, with a value of T or F
alipay online partner_id
Request parameters
Request parameters
Responses
Body
It indicates that a request is accepted by Alipay gateway.T for accepted
["1639381707879634","2088131906583189","utf-8","alipay.acquire.overseas.query","ec18a28ffd583bad90aae039aafc9317","1566981063","MD5","1566981063"]
The buyer’s Alipay login Id, the id might be an email or mobile number.The id is partially masked for privacy.
This ID stands for each Alipay account number ,unique in Alipay system start with 2088.
The time of the transaction has been paid.Format: YYYYMMDDHHMMSS
On the partner’s payment request, the alipay system creates a transaction id to handle it.The alipay_trans_id has one-one association with partner + partner_trans_id.
The value for this field can be one of the following items:WAIT_BUYER_PAY: the system is waiting for the user to enter the password or waiting for the user to add the fund source. You need to call the query API to query the transaction result until you get a result of TRADE_SUCCESS or TRADE_CLOSED. TRADE_SUCCESS: the transaction succeeds. You can update your system with the latest transaction status.TRADE_CLOSED: the transaction was closed and in a status of non-success, caused by time out or a cancel request. You can close the transaction in your system.
The currency used for labeling the price of the transaction;
The rate of conversion the currency given in the request to CNY.The conversion happens at the time when Alipay’s trade order is created.
To describe the response status of a request:SUCCESS, FAIL
the transaction amount in the currency given above;Range: 0.01-100000000.00. Two digits after decimal point.
Transaction amount in CNY.It is the exact amount that the buyer has paid
Request parameters
Responses
Body
["mm_1_001-2019082822270000000001","2088131906583189","utf-8","alipay.acquire.overseas.spot.refund","5560a751b065df894d367589d32822dc","0.01","GBP","test info","N","MD5"]
partner id