You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
By default, you would have to call `paymentInstance.close()` to close the modal after a transaction is complete. You can pass in the `autoClose` boolean input to close the modal automatically after a transaction is completed. Use like so
128
-
124
+
And then in the template
129
125
```html
130
126
<button
131
127
angular-rave
132
128
[autoClose]="true"
133
-
[raveOptions]="paymentOptions"
129
+
[raveOptions]="raveOptions"
134
130
>PAY NOW</button>
135
131
```
136
132
@@ -142,18 +138,15 @@ For example, if you have this is your module file
142
138
```ts
143
139
@NgModule({
144
140
imports: [
145
-
AngularRaveModule.forRoot({
146
-
key: 'FLWPUBK-1000',
147
-
isTest: true,
148
-
}),
141
+
AngularRaveModule.forRoot('FLWPUBK-1000'),
149
142
]
150
143
})
151
144
```
152
145
and this in your component
153
146
```html
154
147
<button
155
148
angular-rave
156
-
[PBFPubKey]="FLWPUBK-2000"
149
+
[public_key]="FLWPUBK-2000"
157
150
[raveOptions]="paymentOptions"
158
151
>
159
152
PAY NOW
@@ -164,38 +157,31 @@ Then `FLWPUBK-2000` would be used instead
164
157
**NOTE:**
165
158
166
159
- When using the component, the rave's payment popup shows once the component is rendered while using the directive the popup shows on click
167
-
- Always generate a unique reference for every transaction
160
+
- Always generate a sensible unique reference for every transaction (unlike what I did up there 😉)
168
161
- After successful payment always perform server verification
169
162
170
163
## OPTIONS
171
164
172
-
| Name | Type | Required | Default Value | Description |
PBFPubKey | string | true | - | Your merchant public key provided when you create a button.
175
-
customer_email | string | true | - | ( if customer phone number is not passed ) Email of the customer.
176
-
customer_phone | string | true | - | phone number of the customer.
177
-
txref | string | true | - | Unique transaction reference provided by the merchant.
178
-
amount | number | true | - | Amount to charge.
179
-
integrity_hash | string | false | - | (temporarily) This is a sha256 hash of your getpaidSetup values, it is used for passing secured values to the payment gateway.
180
-
payment_method | string | false | "both" | This allows you select the payment option you want for your users, possible values are card, account or both.
181
-
payment_options | string | false | - | This allows you to select the payment option you want for your users. Possible values are: `'card'`, `'account'`, `'ussd'`. To use more than one option just add them as comma separated values without spaces e.g. `'card,account'`, `'card,account,qr'` etc.
182
-
currency | string | false | "NGN" | currency to charge the card in.
183
-
country | string | false | "NG" | route country.
184
-
customer_firstname | string | false | - | firstname of the customer.
185
-
customer_lastname | string | false | - | lastname of the customer.
186
-
pay_button_text | string | false | - | Text to be displayed on the Rave Checkout Button.
187
-
custom_title | string | false | - | Text to be displayed as the title of the payment modal.
188
-
custom_description | string | false | - | Text to be displayed as a short modal description.
189
-
redirect_url | string | false | - | URL to redirect to when transaction is completed.
190
-
custom_logo | string | false | - | Link to your custom image.
191
-
meta | object | false | - | Any other custom data you wish to pass. Eg- `[{ metaname: ‘flightid’, metavalue: ‘93849-MK5000’}]`
192
-
onclose | function() | false | - | A function to be called when the pay modal is closed.
193
-
callback | function(res) | true | - | A function to be called on successful card charge. User’s can always be redirected to a successful or failed page supplied by the merchant here based on response.
194
-
subaccounts | []{id: string, transaction_split_ratio: string} | true | - | Subaccounts to add for split payments https://developer.flutterwave.com/v2.0/docs/split-payment
195
-
init | function(res) | false | - | A function to be called when payment is about to begin
196
-
autoClose | boolean | false | - | If true, the payment modal closes automatically after a transaction is completed
197
-
198
-
> You can get more information from [rave's documentation](https://flutterwavedevelopers.readme.io/)
165
+
| Name | Type | Required | Default Value | Description |
| tx_ref | string | true | - | Your transaction reference. This MUST be unique for every transaction
169
+
| amount | number | true | - | Amount to charge the customer.
170
+
| currency | string | false | 'NGN' | currency to charge in. Defaults to 'NGN'
171
+
| integrity_hash | string | false | - | This is a sha256 hash of your FlutterwaveCheckout values, it is used for passing secured values to the payment gateway.
172
+
| paymentOptions | `PaymentOptionsEnum[]` | false | - |This specifies the payment options to be displayed e.g - card, mobilemoney, ussd and so on.
173
+
| payment_plan | string | false | - | This is the payment plan ID used for Recurring billing
174
+
| subaccounts | `RaveSubAcccount[]` | false | - |This is an array of objects containing the subaccount IDs to split the payment into. Check our Split Payment page for more info
175
+
| redirect_url | string | 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.
176
+
| customer | RaveCustomer | true | - | This is an object that can contains your customer details: e.g: `{ 'email': 'example@example.com', 'phonenumber': '08012345678', 'name': 'Takeshi Kovacs'}`
177
+
| meta | `{[key: string]: any}` | false | - | This is an object that helps you include additional payment information to your request `{'consumer_id': 23,'consumer_mac': '92a3-912ba-1192a'}`
178
+
| customizations | `RaveCustomization` | 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'}`
179
+
| init | `() => void` | false | - | A function to be called when payment is about to begin
180
+
| onclose | function() | false | - | A function to be called when the pay modal is closed before a transaction is completed.
181
+
| callback | (res: RavePaymentData) => void | true | - | A function to be called on successful card charge. Users can always be redirected to a successful or failed page supplied by the merchant here based on response.
182
+
183
+
> You can get more information from [rave's documentation](https://flutterwavedevelopers.readme.io/)
184
+
> Type definitions can be found [here](./projects/angular-rave/src/lib/rave-options.ts)
199
185
200
186
## CONTRIBUTING
201
187
@@ -213,9 +199,17 @@ Two projects exist in this repository
213
199
### Demo
214
200
- To serve this project run `npm start`/`ng serve`.
215
201
- This project makes use of the [built package](./tsconfig.json#L23) from the `angular-rave` library for quick testing and real-life debugging. So it's **important** to initially run `npm run build`/`ng build` before serving this project
216
-
- To build this project, run `npm run build angular-rave-lib`. After building, a [post build script](./scripts/copy-web-build.js) moves the built files to the `docs` folder for GitHub Pages.
202
+
- To build this project, run `npm run build angular-rave-lib`. The compiled files are built to the `docs` folder for GitHub Pages.
217
203
- This project is also served on github pages at https://ashinzekene.github.io/angular-rave/
218
204
205
+
## Release
206
+
- Checkout to a new release branch `release/new-version` eg `release/3.0.0`
207
+
- cd into `projects/angular-rave`
208
+
- Run `npm version patch|minor|major`
209
+
- cd into the main directory and run `npm build`
210
+
- Run `git add . && git commit -m new-version`
211
+
- Run `git tag -a new-version "release notes..."`
212
+
- cd into `dist/angular-rave` and run `npm publish`
0 commit comments