Cách tạo Signature

Hướng dẫn tạo Signature

- Sử dụng thuật toán HMAC_SHA256 để tạo Signature.

- Dữ liệu đầu vào của Signature bao gồm Checksum key và data.

- Data được tạo ra theo định dạng: key1=value1&key2=value2... (key1: tên field, value1 = giá trị của key1). Data của các trường dữ liệu mô tả ở dữ liệu truyền lên của mỗi API (không bao gồm Signature).

- Dữ liệu Signature sắp xếp theo key thứ tự Alphabet.

- Cấu trúc: hash_hmac ("sha256", string $data , string $checksumKey)

Ví dụ

- data: allowDomestic=true&amount=3000000&bankCode=&buyerAddress=18 Tam Trinh&buyerCity=Hà Nội&buyerCountry=Việt Nam&buyerEmail=virtual_buyer@alepay.vn&buyerName=Virtual Buyer&buyerPhone=0321654987&cancelUrl=https://alepay-v3-sandbox.nganluong.vn/cancel_url&cashback=&checkoutType=3&currency=VND&customMerchantId=20112000&installment=false&language=vi&month=&orderCode=ALE30_API_1110&orderDescription=Description&paymentHours=0.5&paymentMethod=&promotionCode=&returnUrl=https://alepay-v3-sandbox.nganluong.vn/return_url&tokenKey=SI85PMt00k9SfmIbupQinvHVPCHYUd&totalItem=1

- checksumKey: 3x2rBWqf0UYOx1OFwQvrtbK3PuK4cL

⇨ Signature: 885d6a832e90cbc06ad1596ee572378919e2863835442be19d99a0c4f24647bb