AuthAccess
object as explained on the Authentication page.const sdk = require('@finalse/sdk-node');
// or alternatively
// import * as sdk from '@finalse/sdk-node';
const fPay = sdk.FPayClient(sdk.Auth({token: '<token>', secretKey: '<secretKey>' }));
const depositPromise =
fPay.deposit.initiate({
amount: "10_000 XOF",
source: "CI MtnMoney +2250500000000",
h1: "First Deposit via API"
});
depositPromise.then(deposit => {
console.log(deposit.toString());
});
h1
is the title, the justification, the label of this operation. For our operations, we'll need to choose a clear descriptive value to find our way around and better organize ourselves later."10_000 XOF"
, we can add the facultative character "_"
to perform a visual separation.source
with the following value "CI OrangeMoney +22507xxxxxxxx"
. Because CI
is the Côte d'Ivoire's ISO 3166 Alpha 2 code, there's no need to explain what would have happened if we had set the value "CI MoovMoney +22501xxxxxxxx"
or the value "BF OrangeMoney +22678xxxxxxxx"
. Simple, logical, isn't it ?Congratulations, you can run the previous code and you have just completed your first integration with our API. The Deposit
object just created is available on your console . On the phone, you will receive a message inviting you to validate the transaction. Please dial *133# then 1 then your Momo secret code to validate the transaction.
In the background, here's an overview of what happened with just the above code :
We offer you the long version of the previous code, which does exactly the same thing as the code above, just to show you a glimpse of FPay's possibilities.
const sdk = require('@finalse/sdk-node');
// or alternatively
// import * as sdk from '@finalse/sdk-node';
const fPay = sdk.FPayClient(sdk.Auth({token: '<token>', secretKey: '<secretKey>' }));
const depositPromise =
fPay.deposit.initiate({
amount: {
currency: "XOF",
value: "10_000"
},
source: {
_type: "Single",
account: {
country: "CI",
identifier: "+2250500000000",
providerKey: "MtnMoney"
}
},
h1: "First Deposit via API"
});
depositPromise.then(deposit => {
console.log(deposit.toString());
});
Simplicity is a great virtue but it requires hard work to achieve it,
and education to appreciate it
Welcome to Great Usability
Welcome to Simplicity
Welcome to Finalse