0

As mentioned in the question I am trying to call this Adyen API with specific authentification credentials and passing JSON object, Using Curl it is done like this.

curl https://pal-test.adyen.com/pal/servlet/Recurring/v68/disable \
-U "[email protected]":"Pa$$W0rd" \
-H "Content-Type: application/json" \
-d '{
  "merchantAccount": "exampleMerchantAccount",
  "shopperReference": "exampleShopperReference"
    }'

I tried to do this using HTTPClient Request:

$params = array(
        "merchantAccount" => "exampleMerchantAccount",
        "shopperReference" => "exampleShopperReference"
    );
$result = $this->client->request('POST', 'https://pal-test.adyen.com/pal/servlet/Recurring/v68/disable', $params);

But I still can't understand how to pass the basic authentification credentials.

Any help please .

1 Answer 1

1

As written in the documentation, add it to the parameters like this:

$result = $this->client->request(
  'POST',
  'https://pal-test.adyen.com/pal/servlet/Recurring/v68/disable',
  [
   'auth_basic' => ['[email protected]', 'Pa$$W0rd'],
   'body' => $params,
  ]
);
Sign up to request clarification or add additional context in comments.

3 Comments

Sorry I am new to this, what about the JSON object ?
Does the edited answer help?
Yes it does thank you ^^

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.