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:
service
service
field contains interface name which is a Fixed value.partner
partner
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_type
sign_type
field contains the signature type.sign
sign
field contains the signature content.notify_url
notify_url
field contains the asynchronous notification URL.out_trade_no
out_trade_no
field contains the unique order number in merchant website.subject
subject
contains the key word for the merchandise,transaction, order etc.payment_type
payment_type
field contains the payment type.seller_id
seller_id
field contains the seller's account.total_fee
total_fee
field contains the total amount of an order (RMB). Value range is [0.01, 100000000.00].body
body
field contains the description information of one transaction.goods_type
goods_type
field contains the merchandise type. 1: physical; 0: virtual.
it_b_pay
it_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:
success
success
field contains indication whether the transaction is successful. notify_id
notify_id
field contains the notification ID. notify_time
notify_time
field contains the notification time. notify_type
notify_type
field contains the notification type. sign_type
sign_type
field contains the signature type.sign
sign
field contains the signature content.out_trade_no
out_trade_no
field contains the order number in merchant website.subject
subject
field contains the key word for the merchandise,transaction, order etc .payment_type
payment
field contains the payment_type . trade_no
trade_no
field contains the order number of the transaction. trade_status
trade_status
field contains the trade status. seller_id
seller_id
field contains seller's account.seller_email
seller_email
field contains the seller's email.buyer_id
buyer_id
field contains the buyer ID to indentify the buyer's account.buyer_email
buyer_email
field contains the buyer's email.total_fee
total_fee
field contains total amount of an order (RMB).quantity
quantity
field contains the quantity of the merchandise. price
price
field contains the price of merchandise.body
body
field contains description of the merchandise.gmt_create
gmt_create
field contains the time of the creation of the transaction.gmt_payment
gmt_payment
field contains time of the payment.refund_status
refund_status
field contains the status of refund.gmt_refund
gmt_refund
field contains the time of refund.