<Back to the list

What is a “idempotent” design in Alipay system?

In short, that means same parameters get same result, but, be noticed,  no matter how many times you call, you only make one trade that is the first one. The buyer only pay once.

Considering following several scenarios:     

Scenario 1:
    step 1) you made one trade successfully
    step 2) use all the same parameters to call Alipay again and again, you should get all same result. (Exactly same parameters)
    Results: Same parameters get same result, but, be noticed,  no matter how many times you call, you only make one trade that is the first one. The buyer only pay once.
    

Scenario 2:
    step 1) you made one trade successfully
    step 2) you only change barcode, which come from same buyer, to call alipay again and agin, you should get same result too. (barcode identifies the same person)
    Results: again, you only make one trade, buyer only pay once.
   

Scenario 3:
    step 1) you made one trade successfully
    step 2) you only change barcode, which come from different buyer, to call alipay again, you should get one error result, for barcode identifies a different person.
    Results: This one is different, buyer changed. Error code is "TRADE_BUYER_NOT_MATCH". After several minitues, you do step two again, you get different error code "SOUNDWAVE_PARSER_FAIL", Because the barcode is expired.

 

Not helpful?  Contact Us

客服小机器人

NEED HELP ?