The Alipay payment method specification describes the data formats used by the PaymentRequest API [[!PAYMENTREQUESTAPI]] to support payment by Alipay.
This specification is a Alipay Payment Method Specification used by the PaymentRequest API [[!PAYMENTREQUESTAPI]] to support payment by Alipay. It is intended to provide compatibility for merchants who currently request card details from customers to ease adoption of the PaymentRequest API.
In the future, merchants should favor payment methods that provide a tokenized response.
This specification relies on several other underlying specifications.
The following payment method identifier strings are supported by the Alipay data formats.
| Identifier String | Description |
|---|---|
| alipay | Alipay |
This section describes payment method specific data that is supplied as part of the data
argument to the PaymentRequest constructor.
The following is the payment method specific data used by the PaymentRequest constructor when processing Alipay Payment methods.
dictionary PaymentMethodSpecificData {
required DOMString service;
required DOMString partner;
required DOMString _input_charset;
required DOMString sign_type;
required DOMString sign;
required DOMString notify_url;
DOMString out_trade_no;
DOMString subject;
DOMString payment_type;
DOMString seller_id;
DOMString total_fee;
DOMString body;
DOMString goods_type;
DOMString it_b_pay;
};
The PaymentMethodSpecificData dictionary contains the following fields:
serviceservice field contains interface name which is a Fixed value.partnerpartner field contains the merchant's account.input_charset_input_charset field contains the encoding type of merchant’s website, default value is utf-8.sign_typesign_type field contains the signature type.signsign field contains the signature content.notify_urlnotify_url field contains the asynchronous notification URL.out_trade_noout_trade_no field contains the unique order number in merchant website.subjectsubject contains the key word for the merchandise,transaction, order etc.payment_typepayment_type field contains the payment type.seller_idseller_id field contains the seller's account.total_feetotal_fee field contains the total amount of an order (RMB). Value range is [0.01, 100000000.00].bodybody field contains the description information of one transaction.goods_typegoods_type field contains the merchandise type. 1: physical; 0: virtual.
it_b_payit_b_pay field contains the time out value for unfinished transaction.The AlipayResponse dictionary contains the response from the
PaymentRequest API when a user accepts payment with a Alipay payment method.
dictionary AlipayPaymentResponse {
required DOMString success;
required DOMString notify_id;
required DOMString notify_time;
required DOMString notify_type;
required DOMString sign_type;
required DOMString sign;
DOMString out_trade_no;
DOMString subject;
DOMString payment_type;
DOMString trade_no;
DOMString trade_status;
DOMString seller_id;
DOMString seller_email;
DOMString buyer_id;
DOMString buyer_email;
DOMString total_fee;
DOMString quantity;
DOMString price;
DOMString body;
DOMString gmt_create;
DOMString gmt_payment;
DOMString refund_status;
DOMString gmt_refund;
};
The AlipayPaymentResponse dictionary contains the following fields:
successsuccess field contains indication whether the transaction is successful. notify_idnotify_id field contains the notification ID. notify_timenotify_time field contains the notification time. notify_typenotify_type field contains the notification type. sign_typesign_typefield contains the signature type.signsignfield contains the signature content.out_trade_noout_trade_no field contains the order number in merchant website.subjectsubject field contains the key word for the merchandise,transaction, order etc .payment_typepaymentfield contains the payment_type . trade_notrade_nofield contains the order number of the transaction. trade_statustrade_status field contains the trade status. seller_idseller_id field contains seller's account.seller_emailseller_email field contains the seller's email.buyer_idbuyer_id field contains the buyer ID to indentify the buyer's account.buyer_emailbuyer_email field contains the buyer's email.total_feetotal_fee field contains total amount of an order (RMB).quantityquantity field contains the quantity of the merchandise. priceprice field contains the price of merchandise.bodybody field contains description of the merchandise.gmt_creategmt_create field contains the time of the creation of the transaction.gmt_paymentgmt_payment field contains time of the payment.refund_statusrefund_status field contains the status of refund.gmt_refundgmt_refund field contains the time of refund.