Superusers integrating our payment gateway may provide a confirmation url, success redirect url, error redirect url, and/or verification redirect url for notifications after we complete processing card authorizations post 3DS-authentication. You can set and retrieve this configuration at the endpoint below.

If you are integrating as a payment gateway and do not set any of this config, then we cannot post charge completion data to your confirmationUrl or redirect to your successRedirectUrl for successful payments or errorRedirectUrl for unsuccessful payments. We also cannot complete payments by redirecting to your verificationRedirectUrl or posting to your confirmationUrl when card verification is required.

Setting Confirmation, Success Redirect, Error Redirect, and Verification Redirect Urls

Example request/response

JavaScriptSuccess (200)Errors

// legacy auth that will be deprecated in our v2 api
/*
let jwtToken = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiJlMzE3YjdlNy0yMzQ1LTQ0MWMtODA0Ni1kYjgxNTkyYmEyN2YiLCJzdXBlclVzZXIiOnRydWUsImNvbnRhY3QiOmZhbHNlLCJlbWFpbCI6ImRhbmllbEBjYXJib24ubW9uZXkiLCJpYXQiOjE1NTczMjc5MTR9.WZnSR5N1FebmT9nMu97PJvku49NY0jk4aKVPKm_1MlM';
*/
// we strongly recommend using your secret key to more securely authenticate your superuser instead
let secretKey = 'sk_test_A41Hm6IY3Q5LJ7ham34Zpkcj';

let headers = {
  headers: {
    Authorization: `Bearer ${secretKey}`
  }
};

let url = `${ROOT}/v1/admin`;

let data = {
  confirmationUrl: 'https://sandbox.carbon.money/confirmationUrl',
  successRedirectUrl: 'https://sandbox.carbon.money/successRedirectUrl',
  errorRedirectUrl: 'https://sandbox.carbon.money/errorRedirectUrl',
  verificationRedirectUrl: 'https://sandbox.carbon.money/verificationRedirectUrl',
}

axios.put(url, data, headers).then(result => console.log(result)).catch(err => console.log(err));
{
  message: 'Successfully updated superuser config.',
  details:
   {
     confirmationUrl: 'https://sandbox.carbon.money/confirmationUrl',
     successRedirectUrl: 'https://sandbox.carbon.money/successRedirectUrl',
     errorRedirectUrl: 'https://sandbox.carbon.money/errorRedirectUrl',
     verificationRedirectUrl: 'https://sandbox.carbon.money/verificationRedirectUrl',
   },
  code: 200
}
// 500
{
  message: 'Error setting superuser config.',
  code: 500
}

Getting Confirmation, Success Redirect, Error Redirect, and Verification Redirect Urls

JavaScriptJSONErrors

let headers = { headers: { Authorization: Bearer ${secretKey} } };

let url = ${ROOT}/v1/admin;

axios.get(url, headers).then(result => console.log(result)).catch(err => console.log(err));


```json
{
  message: 'Successfully retrieved superuser config.',
  details:
   {
     confirmationUrl: 'https://sandbox.carbon.money/confirmationUrl',
     successRedirectUrl: 'https://sandbox.carbon.money/successRedirectUrl',
     errorRedirectUrl: 'https://sandbox.carbon.money/errorRedirectUrl',
     verificationRedirectUrl: 'https://sandbox.carbon.money/verificationRedirectUrl',
   },
  code: 200
}
// 500
{
  message: 'Error getting superuser config.',
  code: 500
}

Testing Configured Urls

Ngrok is a great service for linking public URLs to localhost to enable easy testing of URL setup on both web and mobile!

Updated 5 months ago