CollectionAsynchronousNotifications
# CollectionAsynchronousNotifications
Please note: The current business only has callback notification reception when the order is successfully paid.
When performing signature verification, use the
platform public key
provided inMerchant Platform - Collection and Payment Configuration - API Configuration
for decryption!!!Digital currency has two special situations: no order mode and payment amount does not match the order amount. For this reason, we have adjusted the asynchronous notification as follows:
1. If it is the above special situation, we will generate a new successful order for notification. You need to verify according to the notification information and generate a new order.
2. Query whether the order exists in your system according to the merchant order number (orderNum) in the notification. It is recommended that you also store our platform order number (platOrderNum) when the order is successfully placed for double verification.
3. Judge according to the parameter specialStatus (0-default, 1-special) in the notification. If it is 1, it is judged as the above special situation.
After TopPay result asynchronous notification, you need to respond with the
SUCCESS
stringOtherwise, TopPay will continue to initiate 5 notifications downstream
import com.google.gson.JsonObject;
public class TopPayNotify {
// testAccount
private static final String MCH_ID = "PH0000001"; // merchantNumber
private static final String PLAT_PUBLIC_KEY = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC2JoMfFqLsSJjAiCahEnlP3aRj8yCT+WHzR+VvPBTw9S1i7iYWb+MY09CG/HYuHF4+IxshXDJygmndxKf/esuwPybS8mAd//yubHpmZsmBqg1FffT8VH1APa6ZRWASUp4U01ZrbCCp35QA8FuWrJGMJxGx4xk7KUtV2yujxC8noQIDAQAB"; // platformPublicKey
public static void main(String[] args) throws Exception {
// collection
JsonObject notifyBody = new jsonObject();
boolean verifyResult = TopPayRequestUtil.verifySign(notifyBody,PLAT_PUBLIC_KEY);
if (verifyResult) {
// ... Signature verification passed, process normal business logic
} else {
// ... Signature verification error
}
}
}
# NotificationParameters
parameters | describe | example |
---|---|---|
platOrderNum | platOrderNum | BK_1563278763273 |
orderNum | merchantOrderNumber | T1231511321515 |
mchNo | mchNo | PH0000001 |
amount | amount | 100000 |
fee | theAmountOfTheHandlingFee | 500 |
status | status | SUCCESS , refer to order status |
hashCode | hashCode | 5e5c356af0ewrhgnf3d757h8a6a5506cc66354620 |
sendAddress | sendAddress | TDBbbeAB32WE576DVGE82GEC5BhsZs4 |
inAddress | inAddress | TDBbbeAB32WE576DVGE82GEC5BhsZs4 |
mchUserId | merchantUserId | M00001 |
specialStatus | specialStatus(0-default,1-special) | 0 |
currency | currency | USDT |
netWork | netWork | TRC20 |
version | version | 1 |
sign | signature | ja6R8eukQY9jc8zrhtf34654ungj7u8sdgdfjfs |