ANGULAR-GLADEGPAY
This is an angular module that abstracts the complexity of making gladepay payments with Angular2+.
USAGE
1. Install the module
npm install --save angular-gladepay
2. Import the module
In your app.module.ts
or any module where the component or directive would be used like so:
; ;...
3. Implement in your project
There are two available options
-
AngularGladepayComponent: Renders a button which when clicked loads gladepay Inline in an iframe
Pay with Gladepay -
AngularGladepayDirective: A directive that loads gladepay inline in an iframe when clicked
Pay with Gladepay
And then in your component.ts
;
Also you can use the gladepayOptions
object like so:
Pay with Gladepay
And then in your component.ts
; ;
Also, you can pass in a MID in the component and the directive, in such situation, this MID is given a higher preference over the global forRoot
MID. For example, if you have this is your file
and this in your component
Pay with Gladepay
Then MID2
would be used instead
OPTIONS
Name | Type | Required | Default Value | Description |
---|---|---|---|---|
amount |
number |
true | undefined | Amount to withdraw |
email |
string |
true | undefined | The customer's email address. |
MID |
string |
true | undefined | Your MID from Gladepay. Use test MID for test mode and live MID for live mode |
callback |
function |
true | undefined | A function called when transaction is successful. Returns an object containing unique reference |
metadata |
object |
false | {} | custom details |
currency |
string |
false | "NGN" | Transaction currency |
gladepayOptions |
object |
false | undefined | An object containing the gladepay options above. NOTE: The function listeners eg callback , paymentInit should not be added here |
paymentInit |
function |
false | undefined | A function called when the payment is about to begin |
onClose |
function |
false | undefined | A function called if the customer closes the payment window |
For more information checkout gladepay's documentation
Contributing
Please feel free to fork this package and contribute by submitting a pull request to enhance the functionalities.
How can I thank you?
Why not star the github repo? I'd love the attention! Why not share the link for this repository on Twitter or anywhere? Spread the word!
Don't forget to follow me on twitter!
Thanks! Dansteve Adekanbi.
License
The MIT License (MIT). Please see License File for more information.