I am integrating an IP-Restricted API from a company called XendPay. They allowed requests from the Server IP only. I know PHP scripts run on server but I am not getting response when I request data. Here is an example:
$jsonRequestURL = 'http://uat.xendpay.com/partner/api/1.0/{partner_key}/quote?countryFrom=PL&countryTo=GB¤cyFrom=PLN¤cyTo=GBP&deliveryType=BANK_TRANSFER&paymentMethod=banktransferlocal&amount=1000.00&amountCurrency=PLN&indent=true';
json_decode ( file_get_contents ( $jsonRequestURL ) );
It sometimes stuck here or after waiting quite long, gives the following error:
A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
I am not sure but I assume that request is not being sent through Server IP as I have called above mentioned json_decode() on pageload.
Can anyone suggest what should I do?