Skip to content

Using custom credentials

Joel Ibaceta edited this page Apr 9, 2019 · 2 revisions

Now this SDK support additional options for the main methods to interact with entities or api resources using alternative behaviors.

Setting custom credentials

MercadoPago\SDK::setMultipleCredentials(
  array(
    "Test" => "TEST_ACCESS_TOKEN",
    "Production" => "PROD_ACCESS_TOKEN"
  )
);

Using custom credentials

$options = array(
  "custom_access_token" => "Test"
);

$payment_status = $payment->save($options);

Or directly in the method call

$payment_status = $payment->save(
  "custom_access_token" => "ACESS_TOKEN..."
);
Clone this wiki locally