UNPKG

ngx-loovpay

Version:

ngx-loovpay is a solution that can be integrated into Angular applications, giving developers the possibility of integrating them into merchant applications for the purpose of collecting payments.

151 lines (105 loc) 4.31 kB
## Config ngx-loovpay To configure the ngx-loovpay module in your project use import the module to your application module ```typescript 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. This function is used to initiate mobile or card payments. Please note the information requested in the function interface. ```typescript initPayment(payload: PaymentMobile | PaymentCard):Observable<LoovResponse> ``` ## Checkout payment status checking the status of a payment requires the transaction reference ```typescript 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. ```typescript 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 ```typescript "description": "test paiement de service en ligne", "customer": { "name": "John Doe", "email": "john@gmail.com", "phoneNumber": "23769*******" } ``` ### `Supported Operators` | country | operator | operator_code | | ------- | -------- | ------------- | | Benin | Mtn | mtn-benin | | Benin | Moov | moov-benin | | Cameroon | Orange | orange-money-cm | | Cameroon | Mtn | mtn-cm | | Ivory Coast | Mtn | mtn-ci | | Ivory Coast | Moov | moov-ci | | Mali | Moov | moov-ml | | Mali | Orange | orange-money-ml | | Senegal | Orange | orange-money-senegal | | Senegal | Expresso | expresso-senegal | | Senegal | Free | free-money-senegal | | Senegal | Wave Senegal | wave-senegal | | Togo | T-money | t-money-togo | ## Demo This tutorial shows you how to implement the payment api in your loovPay application. ```typescript 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) => { return of(resp); }), catchError((error: LoovResponseError) => { return of(error.error); }) ).subscribe(); ``` ## Security Vulnerabilities If you discover a security vulnerability within the LoovPay Angular SDK, please report it to `Loov Solutions` via `contact@loov-solutions.com`. We take security seriously and appreciate your help in disclosing any vulnerabilities responsibly. ## License The LoovPay Angular SDK is open-source software licensed under the MIT license. You can find the license details in the LICENSE file. ## Credits We hope this SDK simplifies the integration of `LoovPay Payment` into your Angular applications and enables you to provide a seamless payment experience for your users. If you have any questions, issues, or suggestions, please feel free to open an issue on our GitHub repository. We appreciate your feedback and contributions to help make this SDK even better.