Download the Bill & Pay SDK
Let Us Write the Code for You
The "Try It" feature in the Bill & Pay API Documentation has been expanded to include the ability show the exact source code you would use to make a request through the SDK.
Here is how you use it:
The "Try It" form in the Bill & Pay Documentation. |
- Go to the Bill & Pay API Documentation.
- Go to the class and method you are interested in using.
- Expand the "Try It" section and fill out the form to specify the parameters you want to pass to the API method.
- Click "Generate XML Request". This will create the XML request that needs to be sent to the Bill & Pay API.
- Try out your method call by clicking the "Execute Request" button. The results will be shown below the generated XML.
- Once you have the XML request that works the way you want it to you can translate the XML request into the source code for your chosen SDK programming language. Just click the "Select an SDK language." drop-down list. Select your programming language that Bill & Pay provides an SDK for.
- The source code for the chosen programming language will appear below the XML request. You can copy the source code and paste it into your programming environment to use it immediately.
The Try It feature generates the request XML. |
A simple generated sample source code for making an API method call using the PHP version of the SDK. |
Here is an example of the PHP SDK source code generated for a complex API method call:
$BPBiller = new BPBillerAPI(); $BPBiller.billerid = "99999"; $BPBiller.password = "xxxxxxxxx"; $customerinfo = $BPBiller->sendRequest(array('customerinfo' => array('limit' => array('rows' => '50', 'page' => '1'), 'field' => array('internalid', 'id', 'active', 'login', 'companyname', 'firstname', 'middlename', 'lastname', 'phone', 'billingaddress'), 'where' => array('active' => '1', 'enrolled' => '1')))); if ($customerinfo !== false) { //Process response here using $customerinfo variable. } else { //Handle errors here. }
And the same API method call using source code generated for the JavaScript SDK:
var BPBiller = BPBillerAPI(); BPBiller.billerid = "99999"; BPBiller.password = "xxxxxxxxx"; BPBiller.sendRequest(customerinfo_response, {"customerinfo":{"limit":{"rows":"50","page":"1"},"field":["internalid","id","active","login","companyname","firstname","middlename","lastname","phone","billingaddress"],"where":{"active":"1","enrolled":"1"}}}); function customerinfo_response(customerinfo) { if (BPBiller.errorNumber == 0) { //Process response here using customerinfo variable. } else { //Handle errors here. } }
No comments:
Post a Comment