Configuration

Options#

With simplicity in mind, pesa-js sdk is also flexible allowing several configutation to fine tune to your needs.

AttributeRequiredData typeDefault valueAvailable options
marketโŒstringTZNTZN,GHA
currencyโŒstringTZSTZS,GHS
api_keyโœ…stringnull
public_keyโœ…stringnull
enviromentโœ…stringsandbox

Http Client Options#

AttributeRequireddefault value
headerโŒ{}
originโŒ*

Full initialization syntax#

import { Pesa } from '@openpesa/pesa-js';
// Intiate with credentials
let pesa = new Pesa({
api_key: 'asdf',
public_key: 'asdf',
market:'TZN',
currency:'TZS',
options: {
origin : '*',
headers: {
'X-App-version' : '1.2.3'
}
}
},
environment:'sandbox');