Skip to content

Instantly share code, notes, and snippets.

@nodesocket
Created June 20, 2013 22:21
Show Gist options
  • Save nodesocket/5827251 to your computer and use it in GitHub Desktop.
Save nodesocket/5827251 to your computer and use it in GitHub Desktop.
function callbackHandler(response) {
switch (response.status) {
case 201:
// WOO HOO!
// response.data.uri == uri of the card or bank account resource
break;
case 400:
// missing field - check response.error for details
break;
case 402:
// we couldn't authorize the buyer's credit card
// check response.error for details
break
case 404:
// your marketplace URI is incorrect
break;
case 500:
// Balanced did something bad, please retry the request
break;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment