37
- [Introduction](./1) - [Payment Flow and User Experience](./3) - [Quick start](./64) - [Pay Flow](./57) - [Refund Flow](./58) - [Query Flow](./59) - [Reconciliation Flow](./67) - [Secondary Merchant Maintenance Flow](./68) - [Integration](./42) - [Preparing keys](./48) - [Downloading Demo Code](./66) - [Calling APIs](./65) - [Creating the Pre-sign String](./75) - [Signing the Request and Creating the Request URL](./50) - [Processing Notifications](./51) - [Verifying the Asynchronous Notification](./52) - [Verifying the Synchronous Notification](./53) - [Testing in Sandbox](./44) - [Prerequisites](./43) - [Deploying in Sandbox](./45) - [Running Demo Code in Sandbox](./46) - [Going Live](./55) - [API list](./6) - [Create_forex_trade](./6) - [Request Parameters](./6) - [Sync Response](./7) - [Samples](./8) - [Async Notification](./9) - [Error Codes](./10) - [Change History](./74) - [Forex_refund](./11) - [Request Parameters](./11#Request) - [Sync Response](./11#Response) - [Samples](./11#Samples) - [Error Codes](./12#Errors) - [Async Notification](./70) - [Single_trade_query](./13) - [Request Parameters](./13#QueryRequest) - [Sync Response](./13#QueryResponse) - [Samples](./13#QuerySamples) - [Error Codes](./14#Errors) - [Forex_compare_file](./15) - [Request Parameters](./15#Forex_compare_file_Request) - [Sync Response](./15#Forex_compare_file_Response) - [Samples](./15#Forex_compare_file_Samples) - [Error Codes](./16) - [Forex_liquidation_file](./17) - [Request Parameters](./17#Forex_liquidation_file_Request) - [Sync Response](./17#Forex_liquidation_file_Response) - [Samples](./17#Forex_liquidation_file_Samples) - [Error Codes](./18) - [Forex_rate_file](./19) - [Request Parameters](./19#Forex_rate_file_Request) - [Sync Response](./19#Forex_rate_file_Response) - [Samples](./19#Forex_rate_file_Samples) - [Error Codes](./20) - [alipay.overseas.secmerchant.online.maintain](./37) - [Request Parameters](./37#request) - [Sync Response](./37#sync) - [Samples](./37#samples) - [Error Codes](./37#error) - [Change History](./37#history) - [alipay.overseas.secmerchant.maintain.queryStatus](./73) - [Request Parameters](./73#request) - [Sync Response](./73#sync) - [Samples](./73#samples) - [Error Codes](./73#error) - [Change History](./73#history) - [Reconciliation files](./34) - [Obtaining Reconciliation Files](./35) - [API](./35#API) - [Alipay global site](./35#Global) - [SFTP](./35#SFTP) - [Reconciliation File Contents](./36) - [Transaction file](./36#TransactionFile) - [Settlement file](./36#SettlementFile) - [Digital Signature](./69) - [Preparing Keys](./48) - [Creating the Pre-sign String](./75) - [Signing the Request](./50) - [Verifying the Signature of Asynchronous Response](./52) - [Verifying the Signature of Synchronous Response](./53) - [FAQ](/help/online)
New Cross-border Website Payment

alipay.overseas.secmerchant.online.maintain

Call this interface to register online secondary merchants information into Alipay system. For frequently asked questions about this interface, see About the alipay.overseas.secmerchant.online.maintain API.

The gateway URL:

Environment HTTPS request URL
Production environment https://intlmapi.alipay.com/gateway.do
Test environment https://mapi.alipaydev.com/gateway.do

If you want to use Alipay sandbox to test the integration, see the sandbox handbook for details.

  • If you are still using the previous sandbox gateway https://openapi.alipaydev.com, please use the https://mapi.alipaydev.com/gateway.do gateway instead. This gateway adjustment is caused by a system difference between the Alipay international sandbox test environment and the Alipay domestic sandbox test environment.
  • For a GET request or POST request, if the value of request parameters contains special characters or Chinese characters, you need to URL encode values of all the parameters in the request URL.
  • For a POST request, you need to include the _input_charset field in the gateway URL. For example,if the value of request parameters contains Chinese characters, the gateway URL is: https://intlmapi.alipay.com/gateway.do?_input_charset=utf-8

Request Parameters

Parameter

Type (length in bytes)

Description

Optional

Example

Basic Parameter

service

String

Service Name

N

alipay.overseas.secmerchant.online.maintain

partner

String(16)

A unique partner ID to identify a contracted Alipay Account.

A 16 digit number starts with 2088.

N

2088101142878662

_input_charset

String

The charset on partner website, such as utf-8, gbk, gb2312 etc.

N

gbk

sign_type

String

DSA, RSA, or MD5, capital letter

N

MD5

sign

String

The value of sign.

N

2118ac8fad6bc1d9e88a6cd017c18d37

timestamp

String

The time when the merchant server sends request, in GMT + 8, format: yyyy-MM-dd HH:mm:ss.

By default, the request expires in 30 minutes.

N

2012-12-21 17:11:16

Business Parameter

secondary_merchant_name

String(64)

Registration legal name of the secondary merchant, which is shown in the wallet and reconciliation file to identify a secondary merchant.

Note: If the secondary merchant type is INDIVIDUAL, specify the full legal name of the business owner to this field.

N

Alipay.com Co.,Ltd

secondary_merchant_id

String(64)

A unique ID assigned by the partner to identify a secondary merchant. The ID can contain letters, numbers, and underscores.

N

63472327348

secondary_merchant_industry

String(4)

Business category code of the secondary merchant. See MCC list.

N

MCC list.

register_country

String(2)

Registration country of the secondary merchant, specified by a 2-letter code defined in ISO 3166. For more details about the 2-letter country code, see ISO 3166.

N

HK

register_address

String(256)

Business registration address specified on the business registration document. Use mailing address format.

N

No.278, Road YinCheng, Shanghai, China

site_infos

String

This field is in JSON format and can contain up to 5 website URLs or app download URLs. See site_infos for details.

URLs in this field cannot be updated incrementally. To add or remove URLs, re-pass the value again.

N

Secondary merchant website URL or app download URL. Format: [{"site_type":"WEB","site_url":"https://alipay.com","site_name":"websit"},

{"site_type":"APP","site_url":"https://alipay.com","site_name":"websit"}]

secondary_merchant_type

String

Secondary merchant type, the value can be INDIVIDUAL for the sole proprietorship or ENTERPRISE for the limited company, private company, partnership, limited liability partnership (LLP), limited liability company (LLC), S corporation (S Corp), C corporation (C Corp), trust, or nonprofit organization (NPO)

N

INDIVIDUAL

registration_no

String(128)

Business registration number specified on the business registration document.

Note: This field is not required when the secondary merchant type is INDIVIDUAL and no registration number exists.

N

012345678

shareholder_name

String(128)

Legal name of the primary shareholder of the secondary merchant. Specify this field only when the secondary merchant type is ENTERPRISE.

Y

Jack Li (if the shareholder is an individual), Alipay.com Co.,Ltd (if the shareholder is an enterprise)

shareholder_id

String(128)

ID or passport number, or business registration number of the primary shareholder of the secondary merchant. Specify this field only when the secondary merchant type is ENTERPRISE.

Y

G53453888 (if the shareholder is an individual), 012345678 (if the shareholder is an enterprise)

representative_name

String(128)

Full legal name of the business owner. Specify this field only when the secondary merchant type is INDIVIDUAL. This field is optional if the secondary merchant type is ENTERPRISE.

N

Tom Li

representative_id

String(128)

ID or passport number of the business owner. Specify this field only when the secondary merchant type is INDIVIDUAL. This field is optional if the secondary merchant type is ENTERPRISE.

N

123456789

settlement_no

String(64)

Settlement bank account number of the secondary merchant, letters and numbers only

N

2600100000

contact_no

String(64)

Contact phone number of the secondary merchant, numbers and special characters +-() only

N

+86139xxxx7893

contact_email

String(128)

Contact email address of the secondary merchant

N

tomli@gmail.com

cs_no

String(64)

Customer service phone number of the secondary merchant, numbers and special characters +-() only

Y

0213355xxx89

cs_email

String(128)

Customer service email address of the secondary merchant

Y

customerservice@xxxcompany.com

Sub-parameter

site_infos

Parameter

Type (length in bytes)

Description

Optional

Example

site_type

String

Site type. Website URL must be WEB, and app download URL must be APP. Use uppercase.

N

WEB

site_url

String(256)

Site URL.

  • When site_type is WEB, pass the URL in this format: http/https + SLD + TLD, for example, https://www.alipay.com.
  • When site_type is APP, pass the APP download URL starting with http/https, for example, https://itunes.apple.com/cn/app/id333206289.
  • N

    https://www.alipay.com

    site_name

    String(512)

    Site name

    Y

    xx Store

    Some parameters of String type have no length limit and the system will not check their length.

    Sync Response

    The response is in XML format.

    Parameter

    Type (length in bytes)

    Description

    Optional

    Example

    Basic Parameter

    is_success

    String

    Request succeeds or not. Successful request does not mean the business request is accepted and processed successfully.

  • T means success
  • F means failure
  • N

    T

    sign_type

    String

    The value can be one of DSA, RSA, or MD5. Uppercase must be used.

    Y

    MD5

    sign

    String

    The value of sign

    Y

    3afc92ac4708425ab74ecb2c4e58ef56

    error

    String

  • If the request succeeds, this parameter does not exist.
  • When a request fails, the value of this parameter is the error code. See Access Errors and System Errors for details.
  • Y

    PARAM_ILLEGAL

    result_code

    String

    Request result code. This field is returned only when the is_success field is T.

    Y

    SUCCESS

    The synchronous response may have more parameters due to the upgrade on the Alipay server side. You can ignore parameters that are not included in this API document.

    Samples

    Request succeeds and the registration succeeds.

    
    <?xml version="1.0" encoding="utf-8"?>
    <alipay>
    <is_success>T</is_success>
    <request>
        <param name="secondary_merchant_industry">5935</param>
        <param name="_input_charset">UTF-8</param>
        <param name="sign">8457f906bf89a5e444a6e5c28f8da499</param>
        <param name="site_infos">
            [{"site_type":"WEB","site_url":"https://alipay.com","site_name":"websit"}]
        </param>
        <param name="secondary_merchant_id">100510000031</param>
        <param name="register_address">No.278, Road YinCheng, Shanghai, China</param>
        <param name="partner">2088131089302823</param>
        <param name="service">alipay.overseas.secmerchant.online.maintain</param>
        <param name="secondary_merchant_name">test1</param>
        <param name="register_country">HK</param>
        <param name="sign_type">MD5</param>
        <param name="timestamp">2018-10-09 16:04:16</param>
        <param name="secondary_merchant_type">INDIVIDUAL</param>
        <param name="registration_no">012345678</param>
        <param name=“representative_name”>Tom Li</param>
        <param name=“representative_id”>123456789 Li</param>
        <param name="settlement_no">2600100000</param>
        <param name="contact_no">+86139xxxx7893 </param>
        <param name="contact_email">tomli@gmail.com </param>
    </request>
    <response>
        <alipay>
            <result_code>SUCCESS</result_code>
        </alipay>
    </response>
    <sign>744a87f0e3b40e6a8cd8f9705ce61511</sign>
    <sign_type>MD5</sign_type>
    </alipay>
    

    Request succeeds but the registration fails:

    
    <alipay>
        <is_success>F</is_success>
        <error>PARAM_ILLEGAL</error>
        <sign>ba101b7ffb43afde9ba63c0de335218e</sign>
        <sign_type>MD5</sign_type>
    </alipay>
    

    Request fails or the access data are wrong:

    
    <?xml version="1.0" encoding="utf-8"?>
    <alipay>
        <is_success>F</is_success>
        <error>ILLEGAL_PARTNER</error>
    </alipay>
    

    Error Codes

    Business Logic Errors

    Returned result

    Description

    MCC_CAN_NOT_MODIFY

    The MCC passed in cannot match the original MCC. Please ensure that the passed MCC is the original MCC.

    REGISTER_COUNTRY_FORBIDDEN

    For anti-money laundering reasons, the country or region in register_country cannot be registered.

    PARAM_ILLEGAL

    The parameter is illegal. The parameter is too long, parameter format is wrong, or a required parameter is not passed. Please check and rectify the parameter according to the API document.

    SYSTEM_ERROR

    Alipay system error

    DUPLICATE_REQUEST

    Duplicate request submitted. The previous registration request is still in process.

    MERCHANT_TYPE_ILLEGAL

    Illegal secondary merchant type. The value of the secondary_merchant_type field can only be ENTERPRISE or INDIVIDUAL.

    Access Errors

    Returned result

    Description

    ILLEGAL_SIGN

    Illegal signature

    ILLEGAL_DYN_MD5_KEY

    Dynamic key information is incorrect

    ILLEGAL_ENCRYPT

    Encryption is incorrect

    ILLEGAL_ARGUMENT

    Incorrect parameter

    ILLEGAL_SERVICE

    Service Parameter is incorrect

    ILLEGAL_USER

    User ID is incorrect

    ILLEGAL_PARTNER

    Incorrect Partner ID

    ILLEGAL_EXTERFACE

    Interface configuration is incorrect

    ILLEGAL_PARTNER_EXTERFACE

    Partner's interface information is incorrect

    ILLEGAL_SECURITY_PROFILE

    Matching private key configuration is not found

    ILLEGAL_AGENT

    Agency ID is incorrect

    ILLEGAL_SIGN_TYPE

    The signature type is incorrect

    ILLEGAL_CHARSET

    The character set is illegal

    HAS_NO_PRIVILEGE

    Has no right to visit

    INVALID_CHARACTER_SET

    The character set is invalid

    System Errors

    When system error occurs, please contact Global Merchant Technical Support .

    Returned result

    Description

    SYSTEM_ERROR

    Alipay system error

    SESSION_TIMEOUT

    Session timeout

    ILLEGAL_TARGET_SERVICE

    Wrong target service

    ILLEGAL_ACCESS_SWITCH_SYSTEM

    Merchant is not allowed to visit system of this type

    EXTERFACE_IS_CLOSED

    The interface is closed

    Change history

    Date

    Modifications

    2019.02.18

    • Added the following fields: secondary_merchant_type, registration_no, shareholder_name, shareholder_id, representative_name, representative_id, settlement_no, contact_no, contact_email, cs_no, cs_email
    • Updated the following fields: The site_name field is changed to optional. The register_address field is changed to required.
    • Updated the description of the secondary_merchant_name field.
    • Added the DUPLICATE_REQUEST error code.

    2019.02.28

    Added the result_code field in the Sync Response part.

    To verify whether all API requests and responses are correctly handled, and whether user experiences are as expected, you can test Alipay payment features integrated with your applications in sandbox environment before going live in the production environment.

    Sandbox environment is an environment where you can mimic the characteristics of the production environment and create simulated responses from all APIs the application relies on before going live. You can make API tests based on your own requirements including making a transaction, cancel, or refund a transaction, and so on. Before you access the Alipay Sandbox Portal to start the test, you need to make some preparations. See Prerequisites for details.

    Before you test Alipay payment features in sandbox, you need to get the following preparations:

    Creating an Alipay merchant account:

    1. Go to the Alipay for Business website: https://global.alipay.com
    2. In the top-right corner of the homepage, click Sign Up.
    3. Enter your email, enter the code displayed, and then click Continue.
    4. Follow the instructions to complete the account creation.

    Use your merchant account to log in to the Alipay Sandbox Portal, if you don’t have the account, see Prerequisites.

    Alipay sandbox gateway

    Use the Alipay sandbox gateway for testing. The URL of the sandbox gateway is:
    https://mapi.alipaydev.com/gateway.do?

    Alipay sandbox test accounts

    There are two types of test account: merchant test account and buyer test account.

    Merchant test accounts:

    Find the merchant test account information in the Alipay sandbox portal under Sandbox Accounts > Merchant. More than one test accounts are provided, and the accounts are sorted by payment feature. Find the correct one to use according to the payment feature you want to test. For example, to test the Alipay Auto Debit feature, use the account information provided under Alipay Auto Debit.

    • Login password: Use this password to login to the Alipay for Business website in the sandbox environment.
    • Signature key: Only MD5 signature is supported in the sandbox environment. RSA signature is not supported at this time.

      For more information about the MD5 signature, see Digital Signature.

    Buyer test account:

    Use the buyer test account to login to the Alipay sandbox app.
    The buyer test account information can be found in the Alipay sandbox portal under Sandbox Accounts > Buyer.

    Account balance: You can click Top Up to top up the buyer test account.

    Download the Alipay sandbox app

    The Alipay sandbox app supports only Android at this time.

    1) In the Alipay sandbox portal, click Alipay Sandbox App from the menu on the left.
    2) Take one of the following steps:

    To log in to the Alipay sandbox app, use the buyer test account and login password that are provided in the portal under Sandbox Accounts > Buyer.

    To generate a digital signature, normally a key is required to sign the data. You must prepare the MD5 private key or the RSA/DSA private and public key pair to generate and verify a digital signature.

    MD5 sign type

    MD5 private key is required for generating and verifying MD5 signatures. The MD5 secret key is the 32-byte string which is composed of English letters and numbers. You can log in to the Global Portal to view the private key:

    1. Log in with your user ID.
    2. Click My Technical Service and enter your payment password. If you don't know your payment password, please contact Global Merchant Business Support
    3. Check your MD5 Key. For example, the following graphic is an example of an MD5 Key:

    RSA/DSA sign type

    An RSA/DSA key pair contains the private key and the public key. The private key is required for generating the signature, while the public key is used for verifying the signature. The following steps assume that you are using RSA sign type, similar steps applied for generating and uploading DSA key pair.

    Generating the private/public key pair

    Many tools can be used to generate the RSA key pair. The following example illustrates the steps to generate the RSA key pair by using OpenSSL.

    1. Install OpenSSL
      • For linux system, use the following command:
        sudo apt-get install openssl
      • For windows system, download and then install OpenSSL from OpenSSL site.
    2. Generate RSA key pair.
      For linux system, use the following command:
      $ openssl
      OpenSSL> genrsa -out rsa_private_key.pem 1024 ##generating  private key
      OpenSSL> pkcs8 -topk8 -inform PEM -in rsa_private_key.pem  -outform PEM -nocrypt ##transform private key into PKCS8 format
      OpenSSL> rsa -in rsa_private_key.pem -pubout -out  rsa_public_key.pem ##Generate public key
      OpenSSL> exit          
      

      For windows system, use the following command:
      C:\Users\Hammer>cd C:\OpenSSL-Win32\bin ##enter OpenSSL directory
      C:\OpenSSL-Win32\bin>openssl.exe ##enter OpenSSL
      OpenSSL> genrsa -out rsa_private_key.pem 1024  ##generating private key
      OpenSSL> pkcs8 -topk8 -inform PEM -in rsa_private_key.pem  -outform PEM -nocrypt ##transform private key into PKCS8 format
      OpenSSL> rsa -in rsa_private_key.pem -pubout -out  rsa_public_key.pem ##Generate public key
      OpenSSL> exit 

    After that, you can see two files under current folder, rsaprivatekey.pem and rsapublickey.pem. The former is the private key and the latter is the public key.

    Notes:

    The following are the examples of the key pair:

    Exchange the public key

    You need to exchange your public key with Alipay. Contact Global Merchant Technical Support and provide your PID and public key information. Alipay will then make configurations accordingly, and provide you Alipay public key.

    For a transaction that has been successfully paid, the customer can request the merchant for refunding as long as the refunding period is still valid, and the merchant can make use of the refunding interface to complete the refunding, as illustrated.

    For the integration of the refunding service, we would like to highlight:

    1. The refunding service name is: alipay.acquire.overseas.spot.refund(REFUND);
    2. To refund a transaction, the interface REVERSE is only applicable at the same day of the payment (GMT +8, Beijing time); on the other hand, the interface REFUND is applicable as long as the refunding period has not expired yet;
    3. the refunding of a transaction can be full or partial, i.e. the refunding amount can respectively be the same as or less than the original transaction amount that has been paid; furthermore, for a transaction, multiple refunding request is allowed provided the sum of the amount of the multiple refunding request is less than or equal with the original transaction amount. 

    Except for "sign" and "sign_type", all other parameters used need to be signed.

    Generating the pre-sign string for request

    For the following parameter array:

    string[]  parameters={"partner=\"208861122157****\"",
    "seller_id=\"208861122157****\"",
    "out_trade_no=\"0811172929-1013\"",
    "subject=\"test\"",
    "body=\"test\"",
    "currency=\"HKD\"",
    "total_fee=\"0.1\"",
    "notify_url=\"http://0ee96cd2.ngrok.io/notify.htm\"",
    "service=\"mobile.securitypay.pay\"",
    "payment_type=\"1\"",
    "_input_charset=\"utf-8\"",
    "appenv=\"system=java^version=1.8\"",
    "forex_biz=\"FP\""
      };
    Combine all array values in the format of key= “value” and then link them up by the character “&” in an alphabetical order. For example:

    _input_charset="utf-8"&appenv="system=java^version=1.8"&body="test"¤cy="HKD"&forex_biz="FP"¬ify_url="http://0ee96cd2.ngrok.io/notify.htm"&out_trade_no="0811172929-1013"&partner="208861122157****”&payment_type="1"&seller_id="208861122157****”&service="mobile.securitypay.pay"&sign="$$$"&sign_type="RSA"&subject="test"&total_fee="0.1"

    Generating the pre-sign string for synchronous notification

    The following sample illustrates the content of a synchronous notification:

    resultStatus={9000};memo={};result={partner="2088101568358171"&seller_id="xxx@alipay.com"&out_trade_no="0819145412-6177"&subject="test"&body="testtest"&total_fee="0.01"&notify_url="http://notify.msp.hk/notify.htm"&service="mobile.securitypay.pay"&payment_type="1"&_input_charset="utf-8"&it_b_pay="30m"&show_url="m.alipay.com"&success="true"&sign_type="RSA"&sign="hkFZr+zE9499nuqDNLZEF7W75RFFPsly876QuRSeN8WMaUgcdR00IKy5ZyBJ4eldhoJ/2zghqrD4E2G2mNjs3aE+HCLiBXrPDNdLKCZgSOIqmv46TfPTEqopYfhs+o5fZzXxt34fwdrzN4mX6S13cr3UwmEV4L3Ffir/02RBVtU="}

    Take out the part of result, remove "sign" and "sign_type" parameters:

    partner="2088101568358171"&seller_id="xxx@alipay.com"&out_trade_no="0819145412-6177"&subject="test"&body="testtest"&total_fee="0.01"&notify_url="http://notify.msp.hk/notify.htm"&service="mobile.securitypay.pay"&payment_type="1"&_input_charset="utf-8"&it_b_pay="30m"&show_url="m.alipay.com"&success="true"

    Generating the pre-sign string for asynchronous notification

    The following sample illustrates the contents of an asynchronous notification:

    http://0ee96cd2.ngrok.io/notify.htm? buyer_id=208812287878****¤cy=HKD&forex_rate=0.85420000¬ify_id=e5f5c6a77034fcd111e373e7e61dcbegdy¬ify_type=trade_status_sync¬ify_time=2017-08-11 17:31:39&out_trade_no=0811172929-1013&rmb_fee=0.09&seller_id=208861122157****&trade_no=2017081121001003050274536539&total_fee=0.10&trade_status=TRADE_FINISHED&sign_type=RSA&sign=$$$

    Remove sign and sign_type, sort other parameters in alphabetical order, and then link up all array values by the character of “&”:

    buyer_id=208812287878****¤cy=HKD&forex_rate=0.85420000¬ify_id=e5f5c6a77034fcd111e373e7e61dcbegdy¬ify_type=trade_status_sync¬ify_time=2017-08-11 17:31:39&out_trade_no=0811172929-1013&rmb_fee=0.09&seller_id=208861122157****&trade_no=2017081121001003050274536539&total_fee=0.10&trade_status=TRADE_FINISHED

    • Parameters without value don't need to be transmitted, nor to be included in the data to be signed;
    • At signing, the character set used to change the character into byte stream must be consistent with that specified in _input_charset;
    • If the parameter _input_charset is transmitted, it shall also be included in the data to be signed.
    MD5 sign type

    After the pre-sign string is generated:

    1. Append the MD5 secret key to the pre-sign string to generate a new string.
    2. Calculate the new string with the MD5 signature algorithm (by using the MD5 signature function).
    The result 32-byte string is the signature, which is used as the value of the “sign” parameter.

    RSA/DSA sign type

    After the pre-sign string is generated, perform the following steps to generate the signature:

    1. Use the RSA/DSA algorithm and the merchant private key to generate the signature.
    2. Encode the signature to a string.
    Then, use the string as the value of the “sign” parameter.

    MD5 sign type

    After receiving the character string of the response or notification from Alipay system, similar to the steps taken in Signing the data, append the MD5 secret key to the character string to generate a new string. Then, calculate this new string with the MD5 signature algorithm. After the 32-byte signature result string is generated, verify whether the value is equal to the value passed in the sign parameter. If Yes, the verification is passed.

    RSA/DSA sign type

    After receiving a response or notification, perform the following steps to verify the signature:

    1. Generate the pre-sign string as described in Generating Pre-sign String.
    2. Use the RSA/DSA algorithm to calculate a message digest.
    3. Use the RSA/DSA public key to de-sign the signature (the value of the sign field) to a message digest.
    4. Compare the two message digests obtained in step 2 and step 3. If the digests are the same, then it indicates that the signed data has not been changed.

    The gateway URL:

    Environment HTTPS request URL
    Production environment https://intlmapi.alipay.com/gateway.do
    Test environment https://mapi.alipaydev.com/gateway.do

    If you want to use Alipay sandbox to test the integration, see the sandbox handbook for details.

    客服小机器人

    NEED HELP ?