Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 26 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

## Introduction

The Angular SDK helps you create seamless payment experiences in your Angular mobile or web app. By connecting to our modal, you can start collecting payment in no time.
The Angular SDK helps you create seamless payment experiences in your Angular mobile or web app. By connecting to our modal, you can start collecting payments in no time.

Available features include:

Expand All @@ -30,8 +30,8 @@ Available features include:

## Requirements

1. Flutterwave version 3 API keys
2. Node version >= 14.15.0 and npm >= 6.14.8
1. Flutterwave version 3 [API keys](https://developer.flutterwave.com/v3.0.0/docs/authentication).
2. Node version >= 14.15.0 and npm >= 6.14.8.
3. Angular version >= 18.

## Installation
Expand Down Expand Up @@ -64,14 +64,14 @@ import { FlutterwaveModule } from "flutterwave-angular-v3"
})
```

> NB: If you experience compilation errors in your app after importing the Flutterwave module, component or service.
> NB: If you experience compilation errors in your app after importing the Flutterwave module, component, or service.
Kindly include the following line in tsconfig.app.json under `compilerOptions` :

```
paths": { "@angular/*": [ "node_modules/@angular/*" ] }
```

Then restart server and try again
Then restart the server and try again

## Usage

Expand Down Expand Up @@ -150,7 +150,7 @@ export class AppComponent {

#### Method 2

Pass in the payment parameters as an object to the component `data` attribute.
Pass in the payment parameters as an object to the component's `data` attribute.

```typescript
import { Component, OnInit } from "@angular/core";
Expand Down Expand Up @@ -264,7 +264,7 @@ export class AppComponent {
onclose: this.closedPaymentModal,
callbackContext: this,
};
//Inject the flutterwave service
//Inject the Flutterwave service
constructor(private flutterwaveService: FlutterwaveService) {}
makePayment() {
this.flutterwaveService.inlinePay(this.paymentData);
Expand Down Expand Up @@ -335,7 +335,7 @@ export class AppComponent {

### Recurring Payments

Pass the payment plan ID into your payload to make [recurring payments](https://developer.flutterwave.com/docs/recurring-payments/payment-plans).
Pass the payment plan ID into your payload to make [recurring payments](https://developer.flutterwave.com/v3.0.0/docs/payment-plans-1).

```typescript
import { Component, OnInit } from "@angular/core";
Expand Down Expand Up @@ -400,54 +400,54 @@ export class AppComponent {

### Parameters

Read more about our parameters and how they can be used [here](https://developer.flutterwave.com/docs/collecting-payments/inline).
Read more about our parameters and how they can be used [here](https://developer.flutterwave.com/v3.0.0/docs/inline).

| Parameter | Always Required ? | Description |
| Parameter | Always Required? | Description |
| ------------------- | ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| public_key | True | Your API public key |
| tx_ref | True | Your transaction reference. This MUST be unique for every transaction |
| amount | True | Amount to charge the customer. |
| currency | False | currency to charge in. Defaults to NGN |
| integrity_hash | False | This is a sha256 hash of your FlutterwaveCheckout values, it is used for passing secured values to the payment gateway. |
| payment_options | True | This specifies the payment options to be displayed e.g - card, mobilemoney, ussd and so on. |
| integrity_hash | False | This is a sha256 hash of your FlutterwaveCheckout values. It is used for passing secured values to the payment gateway. |
| payment_options | True | This specifies the payment options to be displayed e.g - card, mobilemoney, ussd, and so on. |
| payment_plan | False | This is the payment plan ID used for Recurring billing |
| redirect_url | False | URL to redirect to when a transaction is completed. This is useful for 3DSecure payments so we can redirect your customer back to a custom page you want to show them. |
| customer | True | This is an object that can contains your customer details: e.g - 'customer': {'email': '[email protected]','phonenumber': '08012345678','name': 'Takeshi Kovacs' } |
| subaccounts | False | This is an array of objects containing the subaccount IDs to split the payment into. Check our Split Payment page for more info |
| meta | False | This is an object that helps you include additional payment information to your request e.g {'consumer_id': 23,'consumer_mac': '92a3-912ba-1192a' } |
| customizations | True | This is an object that contains title, logo, and description you want to display on the modal e.g{'title': 'Pied Piper Payments','description': 'Middleout isn't free. Pay the price','logo': 'https://assets.piedpiper.com/logo.png' } |
| callback (function) | False | This is the function that runs after payment is completed |
| close (function) | False | This is the function that runs after payment modal is closed |
| redirect_url | False | URL to redirect to when a transaction is completed. This is useful for 3DSecure payments, so we can redirect your customer back to a custom page you want to show them. |
| customer | True | This is an object that can contain your customer details: e.g, 'customer': {'email': '[email protected]', 'phonenumber': '08012345678', 'name': 'Takeshi Kovacs' } |
| subaccounts | False | This is an array of objects containing the subaccount IDs to split the payment into. Check our [Split Payment page](https://developer.flutterwave.com/v3.0.0/docs/split-payments) for more info. |
| meta | False | This is an object that helps you include additional payment information to your request, e.g, {'consumer_id': 23, 'consumer_mac': '92a3-912ba-1192a' } |
| customizations | True | This is an object that contains title, logo, and description you want to display on the modal e.g, {'title': 'Pied Piper Payments', 'description': 'Middleout isn't free. Pay the price', 'logo': 'https://assets.piedpiper.com/logo.png' } |
| callback (function) | False | This is the function that runs after payment is completed. |
| close (function) | False | This is the function that runs after the payment modal is closed. |

### Methods

Methods provided by FlutterwaveService and descriptions:

| Method Name | Parameters | Returns | Description |
| ----------------- | --------------------------------------------- | ------- | -------------------------------------------------------------------------------------------------------------------------- |
| inlinePay | InlinePaymentOptions : Object | Null | This methods allows you to setup and open the payment modal via code |
| asyncInlinePay | AsyncPaymentOptions : Object | Promise | This methods allows you to setup and open the payment modal via code and returns a promise containing the payment response |
| closePaymentModal | waitDuration : number (Optional, default = 0) | Null | This methods allows you to close the payment modal via code. You can setup the wait time before modal close |
| inlinePay | InlinePaymentOptions: Object | Null | This method allows you to set up and open the payment modal via code |
| asyncInlinePay | AsyncPaymentOptions: Object | Promise | This method allows you to set up and open the payment modal via code and returns a promise containing the payment response |
| closePaymentModal | waitDuration: number (Optional, default = 0) | Null | This method allows you to close the payment modal via code. You can set up the wait time before the modal closes. |


## Debugging Errors

We understand that you may run into some errors while integrating our library. You can read more about our error messages [here](https://developer.flutterwave.com/docs/integration-guides/errors).
We understand that you may run into some errors while integrating our library. You can read more about our error messages [here](https://developer.flutterwave.com/v3.0.0/docs/common-errors).

For `authorization` and `validation` error responses, double-check your API keys and request. If you get a `server` error, kindly engage the team for support.

NB: If you experience compilation errors in your app after importing the Flutterwave module, component or service.
NB: If you experience compilation errors in your app after importing the Flutterwave module, component, or service.
Kindly include the following line in tsconfig.app.json under `compilerOptions` :

```
paths": { "@angular/*": [ "node_modules/@angular/*" ] }
```

Then restart server and try again
Then restart the server and try again

# Support

For additional assistance using this library, please create an issue on the Github repo or contact the developer experience (DX) team via [email](mailto:[email protected]) or on [slack](https://bit.ly/34Vkzcg).
For additional assistance using this library, please create an issue on the GitHub repo or contact the developer experience (DX) team via [email](mailto:[email protected]) or on [slack](https://bit.ly/34Vkzcg).

You can also follow us [@FlutterwaveEng](https://twitter.com/FlutterwaveEng) and let us know what you think 😊.

Expand Down
Loading