Ming Han Chung Posted May 10 Share Posted May 10 We're having an issue using the Sage SDK PHP library in which at times we get a Bad Gateway response. This seemed to trigger a retry and ended up doubling up the transaction as it actually went through on the sage side eventhough we got the Bad Gateway on the response. Are there anyways that we can prevent this double up? <html> <head><title>502 Bad Gateway</title></head> <body> <center><h1>502 Bad Gateway</h1></center> <hr><center>cloudflare</center> </body> </html> Link to comment Share on other sites More sharing options...
Members Sterio, Louis Posted May 13 Members Share Posted May 13 If you are still having this issue. Please open up a case with a sample XML request and the response as well as providing the RAY ID from cloudflare. Link to comment Share on other sites More sharing options...
Ming Han Chung Posted June 4 Author Share Posted June 4 The question I have (as i've verified sometimes we just get this 502) is that since it doesn't return a success or fail -> we had assumed fail -> the system retried and doubled up the invoices as the sage side did process it. Is there anyway to make sure if it gets retried that it doesn't double up a data send? Link to comment Share on other sites More sharing options...
Members Sterio, Louis Posted June 11 Members Share Posted June 11 @Ming Han Chung What you can do is set the unique ID field to true and pass a unique value in the controlid attribute. Once successfully consumed it will return an error if you attempt to use it again. <?xml version="1.0" encoding="iso-8859-1"?> <request> <control> <senderid>*******</senderid> <password>*****</password> <controlid>ControlIdHere</controlid> <uniqueid>true</uniqueid> <dtdversion>3.0</dtdversion> <includewhitespace>true</includewhitespace> </control> <operation transaction='false'> <authentication> <login> <userid>****</userid> <companyid>*****</companyid> <password>**********</password> </login> </authentication> <content> <function controlid="12345675"> <readByQuery> <object>APBILL</object> <fields>*</fields> <query></query> <returnFormat>xml</returnFormat> <pagesize>100</pagesize> </readByQuery> </function> </content> </operation> </request> Link to comment Share on other sites More sharing options...
Recommended Posts