Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
How to call an url from PHP
<?php
$url_config = 'https://www.payplug.fr/portal/ecommerce/autoconfig';
$process = curl_init($url_config);
$email = 'your_payplug_email@test.com';
$password = 'your_password';
curl_setopt($process, CURLOPT_USERPWD, $email.':'.$password);
curl_setopt($process, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($process, CURLOPT_SSLVERSION, 3);
$answer = curl_exec($process);
$error_curl = curl_errno($process);
curl_close($process);
if($error_curl == 0){
$json_answer = json_decode($answer);
if($json_answer->status == 200){
/* Ici, votre application doit sauvegarder les paramètres de configuration :
$json_answer->yourPrivateKey, $json_answer->payplugPublicKey,
$json_answer->url, $json_answer->amount_min, $json_answer->amount_max,
$json_answer->currencies */
}
else{
// Gestion des erreurs
}

Hi, i have an error with this code : Parse error: syntax error, unexpected end of file ** on line 22.
Add an } at start of line 20 to fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment