php - Neteller Rest Api -
i have been using neteller's rest api. have been struggling right response authentication key, hoping point me in right direction.
$curl = curl_init(); curl_setopt($curl, curlopt_post, 1); curl_setopt($curl, curlopt_url, "https://api.neteller.com/v1/oauth2/token?grant_type=client_credentials"); curl_setopt($curl, curlopt_userpwd, "clientid:clientsecret"); curl_setopt($curl, curlopt_httpheader, array("content-type:application/json", "cache-control:no-cache")); curl_setopt($curl, curlopt_postfields, http_build_query("scope: default")); curl_setopt($curl, curlopt_followlocation, true); curl_setopt($curl, curlopt_returntransfer, true); $serveroutput = curl_exec($curl); echo $serveroutput;
the response getting "invalid_client". have checked clientid , secret , correct
thanks callum
i take illustration , it's working me:
$username = 'merchantxyz'; $password = 'b81dff9bb4020a89e8ac44cdfdcecd702151182fdc952272661d290ab2e5849e31bb03deede'; $curl = curl_init(); curl_setopt($curl, curlopt_post, 1); curl_setopt($curl, curlopt_url, "https://api.neteller.com/v1/oauth2/token?grant_type=client_credentials"); curl_setopt($curl, curlopt_userpwd, "$username:$password"); curl_setopt($curl, curlopt_httpheader, array("content-type:application/json", "cache-control:no-cache")); curl_setopt($curl, curlopt_postfields, array("scope"=>"default")); curl_setopt($curl, curlopt_followlocation, true); curl_setopt($curl, curlopt_returntransfer, true); $serveroutput = curl_exec($curl); echo $serveroutput;
the response:
{ "accesstoken": "b.aqbbbaaaunzfowkaaaaaaaek-brm0qbtooehaumwlvdwjqx.eaaq0nootdey2amhucwh4ycuggux4ro", "tokentype": "bearer", "expiresin": 300 }
regards.
php rest payment-gateway
No comments:
Post a Comment