ngx-loov Payment API
To configure the ngx-loov module in your project, import the module into your application module like this:
NgxLoovModule.forRoot({
app_key: 'app_key',
merchant_key: 'merchant_key',
loov_url: 'https://api.secure.payment.loov-solutions.com/v1'
}),Init payment
Function used to initiate a payment. you can initiate mobile payments using this function. Please note the information requested in the function's interface.
initPayment(payload: PaymentMobile | PaymentCard):Observable<LoovResponse>Checkout payment status
checking the status of a payment requires the transaction reference
checkStatus(reference:string):Observable<CheckRefResponse>Pay out
Please note that this API is only available to merchants who have subscribed to this service and have been approved by our compliance department.
Be sure to manage the response appropriately in your application to provide users with accurate transaction information.
payOut(payload: PayOut):Observable<LoovResponse>Alert Developers
the description must be at least 125 characters long and the name must conform to the example below
"description": "test paiement de service en ligne",
"customer": {
"name": "John Doe",
"email": "john@gmail.com",
"phoneNumber": "23769*******"
}Operators code
please respect the operator code provided in the loovPay api document https://docs.loov-solutions.com/fr/docs/payin/payin-mobile (opens in a new tab)
Demo
This tutorial shows you how to implement the payment api in your loovPay application.
this.loovService.initPayment(
{
amount: 500,
operator: 'orange-money-cm',
phoneNumber: '237693xxxxxx',
customer: {
name: 'Steves franc',
email: 'steves@gmail.com',
phoneNumber: '237693xxxx'
},
callback_url: 'https://webhook.site/a6cf31ad-d570-45d1-9995-3b060b4149be',
payment_mode: 'MOBILE_MONEY',
description: 'Payment Method Name and Email Address from Customer Name and Email Address from Customer Name and Email Address',
}
).pipe(switchMap((resp: LoovResponse) => {
return of(resp);
}),
catchError((error: LoovResponseError) => {
return of(error.error)
})
).subscribe();
this.loovService.checkStatus('LOMvJ4wtFlRwbCrZ5I0').pipe(
switchMap((resp: CheckRefResponse) => {
return of(resp)
}),
catchError((error: LoovResponseError) => {
return of(error.error)
})
).subscribe();
this.loovService.payOut(
{
amount: 500,
operator: 'orange-money-cm',
phoneNumber: '237693xxxxxx',
currency: 'XAF'
}
).pipe(switchMap((resp: LoovResponse) => {
console.log('init payment', resp);
return of('');
}),
catchError((error: LoovResponseError) => {
console.log(error.error);
return of(error.error);
})
).subscribe();