Open API
English
  • English
  • 简体中文
API DOC
API DOC
English
  • English
  • 简体中文
English
  • English
  • 简体中文
  1. Open API
  • Open API
    • Document Revision History
    • Overview of Study Abroad Payment API Access
    • API Call Address
    • Request for serial number generation instructions
    • API Request Parameter Description
    • API Response Parameter Description
    • Interface encryption and signing steps
    • Interface decryption and verification process
    • Constant Description
      • pay_type description
      • order_status description
      • status_code description
      • fee_type description
      • attachment_type description
      • country_code description
      • currency_code description
      • Gender Description
      • ID type Description
      • Funding Source Description
    • API
      • Order interface
      • Attachment upload interface
      • Interface for obtaining payment address
      • Order batch query interface
      • Get exchange rate interface
      • Obtain estimated amount
      • Refund application interface
    • [Legacy] Asynchronous notification description v1
      • [Successful Payment] Asynchronous notification parameter description for successful payment
      • Explanation of Asynchronous Notification Signature Generation Process
    • Asynchronous notification description v2
      • Asynchronous Notification Description
      • Asynchronous Notification Signature Generation Process
      • [Successful Payment] Asynchronous notification parameter description for successful payment
      • [Order Status Change] Asynchronous notification parameter description for order status change
      • Asynchronous notification of refund result
  • Schemas
    • 模型-英文
      • 通用请求数据英文模版
      • 通用响应数据模板-英文
      • 基础下单模型-英文
      • 下单模型-英文
      • 查询订单详情模型-英文
      • 支付方式模型tuition_rmb_list-英文
      • 获取支付地址pay_config_list-英文
    • 模型-中文
      • 通用请求数据模板
      • 通用响应数据模板
      • 基础下单模型
      • 下单模型
      • 查询订单详情模型
      • 支付方式模型tuition_rmb_list
      • 获取支付地址-pay_config_list
      • 【第三方跳转下单】敏感数据
      • 【第三方支付通知】敏感数据
      • 【订单付款操作通知】敏感数据
      • 【申请退款】请求数据
      • 印度下单数据模型
API DOC
API DOC
English
  • English
  • 简体中文
English
  • English
  • 简体中文
  1. Open API

Interface encryption and signing steps

Encryption process#

sensitive_data field data:
{
	"merchant_order_id": "20231204204337871860ET82009",
	"merchant_user_key": "2312312addsadsaasdsadsadadcdsacadsas",
	"country_code": "GBR",
	"currency_code": "GBP",
	"tuition": 130,
	"merchant_service_fee": 130,
	"order_tuition": 0,
	"name_ch": "\u6d4b\u8bd5\u6d4b\u8bd5\u6d4b\u8bd5",
	"student_id_number": "130633199302285495",
	"student_address": "\u7684\u6492\u6240\u591a\u591a\u6492\u5927\u6240\u5927",
	"apartment_name": "\u5b9e\u65bd\u5927\u5931\u8d25222\u8fc7\u8d1f\u8377222\u4e3a",
	"student_email": "162455379cds7@qq.com",
	"student_mobile": "19935437csd743",
	"wechat_number": "199354377csd43",
	"city_name_en": "Belfast",
	"city_name_ch": "\u4f26\u6566",
	"school_name": "University of London",
	"fee_type_list": [{
		"fee_type": 7,
		"fee_type_desc": "\u623f\u79df"
	}],
	"notify_url": "xxxxxxx",
	"back_jump_url": ""
}

1.Sensitive_ If data has no value, it is an empty string and does not need to be encrypted. If there is a value, it needs to be encrypted. The following are the encryption rules#

1.1.Convert sensitive_data to json format data, use aes-128-cbc for symmetric encryption, generate aes key KeyStr (random value generation 16-bit byte), offset IVStr (using KeyStr) as two parameters, encrypt the data using these two parameters to generate ciphertext Cipher, convert Cipher to base64 encoding, and fill CipherBase64 into sensitive_data.
1.2Use the public key (the public key of ET) to perform RSA (PKCS V1.5 OEAP) encryption with SHA256 on keystr to obtain Cipher_keystr
1.3Cipher_keystr is converted to base64 encoding to obtain base64_keystr, and finally the base64_keystr is filled into aeskey
Filled data:
{
"serial_number": "20231204204337871860ET82009",
"merchant_number": "ET82009",
"sub_merchant_number": "ET82009S001",
"server_type": "add_special_rent_order",
"callback_process": 1,
"version": "2.0.0",
"data": "{}",
"return_info": "",
"extend_info": "",
"sensitive_data": "gWyCgwZUInUOei+1mfWgbD1FKs3jFH3qzQzVGu/UKp3vNNHVB/fHh4rwkmPLvj/WeZUVF6Wml/0CHrE4zHWMFh2ERZVSIZjgU5Mbpv0Yq3CMiMiu2Nc7nDxqmowjhROQvmc+sUqtw/ODUPLaB8xj4QeAT/iewwxnvnM/VKwU3m3DdeAgoiuC0bn4Enm5ZXe7znNfrwrAhVhluDf7swB9wBSG4ZcybZ20GKVJmjlL5zUyD19s38P0EypNsXEeP3jfNAuiq1AN8IOrlhSXO+M7xcfWN5mRMnCdOmids1enIHB6BcOE/B+uJ8414I08U1YEZS/7L5jHOF/iNQ3CU5KnIo2vy+bSFL41EBhKNxj1p6W083nBf9XLWWJwVoS3EjkeOmfpAKFqc8HYqY6DrPTIHJLfWfGvGJf046JtAod8+aJWFQ+KB4il/2XVgO1Sdt4ZLqgMNNza5fRscqyfuAuXkBg+UiuK/0gI6vjP3lpZKdy3/LYLg0NdyigOgSABYAcYRdX1Sd9MTvLuUYg0+0YlERhPECA5Hq/tfPHFM6mUW0b+rY4roMahwbOtf0xHBg4yPpwPcQb8v4pVyXcEnrNdnaMzEwKn8+YjRzpATUns+xpJdZuGe1U9USPv+6PLR4uxyxUefCaAyJaqVK/aZtlAspF4RYcsWDWIO2TA69/xSCVBa1OUVzEKJpfd+Q76xDlZaO/jz0PHVMWOgBEU6G88wH7ed1eAObGbzfKA9ASk2QCMdXXV0RiWePSoOPvt72f0vEutKXCcplmBTNYhMs0mmpqK7rdhbaPougH0wYq2sRMunDAgXnXiWWlYt57HlYtLRJC1YjWqt4Wz1apNiYP/yeE1MnVUyt9zZnN7WrF1Psb1HXcnYf0dudf0vK8ezewequre6azJ8v4ymfr8Z8qO+IYv3S1Z4N57jJbX74FOcXv6k1CyY8CHPkkHL5P+MLYJhxAXTrp9VpGgbAzj17Kv7P2nfxBY/2TaDnlZIJVyQoxmS8WGygH28iXLIbvFeT+f",
"aeskey": "iWRwvJXElKlehwz5Bvc2+GryrYISJdJhSMG1N697K9/3nikzRxGC85I6i14Kh6hCvrwlPPHV1o1Qy6s4ugzgConYef78meMRbWX3j/JgDB1ZZS5XxkyB2Vt+kFCqNV85dslL2j+rknEC+OcqW9fGjYs7GG19fQ0wynQ0gl7guXU="}

2.Signature#

1.
Concatenate String
Sort all fields (except sign) alphabetically (a-z) by field name
Join key-value pairs using & separator
Example:
aeskey=iWRwvJXElKle...&callback_process=1&data={}&extend_info=&merchant_number=ET82009&return_info=&sensitive_data=gWyCgwZU...&serial_number=20231204204337871860ET82009&server_type=add_special_rent_order&sub_merchant_number=ET82009S001&version=2.0.0
2.
Calculate Signature
Convert the string to bytes (UTF-8 encoding)
Calculate SHA1 digest to get a 40-character hexadecimal string
Calculate the SHA1 digest of the string to be signed
Sign the digest obtained in the previous step using the merchant's private key
Signature algorithm: SHA256withRSA (PKCS#1 v1.5 padding)
Note: No need to calculate SHA256 hash again
Convert the signature result to Base64 encoding
Python Signature Example:
Modified at 2025-10-27 07:22:20
Previous
API Response Parameter Description
Next
Interface decryption and verification process
Built with