Skip to main content
To identify a user, your store repeatedly posts a request to the Bango Payment API’s Identity resource, and then acts on the response, until an end state is reached. Request parameters help the Bango Platform choose the best approach for identifying the user. Here’s some sample code in a C/Java-like language: adapt this code to your needs. Use the same API endpoint prefix with test credentials and with production credentials. Test credentials mean you won’t charge anyone real money during the development/test cycle. Some functions referenced in the skeleton code, such as send_sms_from_device, are not defined. You need to implement these where possible.
Notice how the code uses the value of responseCode to decide what to do, in both success and error cases. See Bango Payment / Merchant API reference / API reference overview for detailed information on all request parameters and all possible response bodies. FAQ Which request parameters should I set? The skeleton code sets request_body_params to be empty. You might be able to supply more parameters in your production code. For example:
  • deviceCapabilitySendSms (default the string true) lets your store tell the Bango Platform if the user’s device can’t send SMS messages.
  • identificationMethodKey lets your store tell the Bango Platform which Mobile Network Operator the user’s device uses.
  • thirdPartyUserId lets your store tell the Bango Platform of any bespoke user identifier.
See Bango Payment / Merchant API reference / API reference overview for detailed information on all request parameters. Do I have to handle every possible response? You might not need to implement everything in the skeleton code. Bango configures the Bango Platform according to the needs of each merchant, which means some stores might never receive a response CLIENT_ACTION_REQUIRED with action REDIRECT, for example. Other stores might always receive a Bango ID in the response of the first API request. Contact Bango Support if you’re unsure what you need to implement. What should I do if I can’t perform an action? The Bango Platform may be extended at any time to support new identification methods. This may mean the response code CLIENT_ACTION_REQUIRED might start to reference actions your code doesn’t currently handle – and possibly cannot ever handle, due to device limitations. The skeleton code shows how to deal with this scenario: if you don’t recognize or can’t perform a CLIENT_ACTION_REQUIRED action, send the parameter action with string value cancel in the next request to the Identity resource, and let the conversation continue. If you don’t handle unrecognized actions in this way, your store may stop working when Bango introduces new identification methods. What if none of my supported devices can send SMS? In this scenario, include the parameter "deviceCapabilitySendSms": "false" with your requests to the Identity resource. You don’t need to handle the SEND_SMS action in this case: treat it as an unrecognized action.