I have a simple Pay Now button, the code created through the button maker, with a "custom" hidden field added to identify it. I wonder if there is some additional hidden field I can add to tell PayPal that "This transaction should not be made twice".
<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="custom" value="{MYUNIQUEID}">
<input type="hidden" name="hosted_button_id" value="{MYHOSTEDBUTTONID}">
<input type="image" src="https://www.sandbox.paypal.com/en_US/i/btn/btn_paynowCC_LG.gif"
border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.sandbox.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>
As it is now it's unlikely that the customer should be able to pay twice, but I noticed that when the Sandbox had a glitch I succeeded in paying the same transaction twice. Something that I absolutely want to avoid. Not just for the customer, that could get refunded, sure, but also since I don't want my database messed up and I would like to avoid extensive coding to catch duplicate payments...
You would want to add a unique identifier to the "invoice" parameter;
<input type="hidden" name="invoice" value="your unique invoice ID">
and enable "Block duplicate payments" within the 'Profile' > 'My selling tools' section on your account at www.paypal.comThanks Robert! (above post)
I actually went so far that I was going to ask PayPal Merchant Technical Support about it and just before submitting my question there found a page with the answer -
Avoiding duplicate payments: https://ppmts.custhelp.com/app/answers/detail/a_id/165
Not sure if you have to log in to see above page so I'm quoting the page here for convenience: