PayPal

FREE
By Dmitry Shumytskyi | Updated 5 days ago | Payments
Popularity

3.2 / 10

Latency

127,271ms

Service Level

0%

Health Check

N/A

Back to All Discussions

PHP source code

Rapid account: Saids
saids
7 years ago

Hi,

I tried to test your source code for PHP in my local environment. I compose package successfully. And when I try to test code to get access token I got an error realted to body.Add(new DataParameter(). It says “Use of undefined constant body - assumed ‘body’”.

Source is:

require DIR . ‘/vendor/autoload.php’;
use RapidApi\RapidApiConnect;

$rapid = new RapidApiConnect(‘APP_CREDENTIALS’, ‘APP_ID’);

$result = $rapid->call(‘PayPal’, ‘getAccessToken’, [
body.Add(new DataParameter(“clientId”, “CLIENT_ID_HERE”)),
body.Add(new DataParameter(“secret”, “SECRET_KEY_HERE”)),
body.Add(new DataParameter(“grantType”, “client_credentials”)),
body.Add(new DataParameter(“sandbox”, “1”))
]);

Join in the discussion - add comment below:

Login / Signup to post new comments