diff --git a/.gitignore b/.gitignore index a9b04e0..7ce4d57 100644 --- a/.gitignore +++ b/.gitignore @@ -6,7 +6,7 @@ # dependencies /node_modules - +/dist # IDEs and editors /.idea diff --git a/dist/README.md b/dist/README.md index 0200d0d..cce4123 100644 --- a/dist/README.md +++ b/dist/README.md @@ -334,12 +334,10 @@ Payment option parameters and descriptions: | 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 - | +| 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. | -| payment_plan | False | This is the payment plan ID used for Recurring billing - | +| 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': 'example@example.com','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 | diff --git a/dist/bundles/flutterwave-angular-v3.umd.js b/dist/bundles/flutterwave-angular-v3.umd.js index 18ce9d6..59c9ac6 100644 --- a/dist/bundles/flutterwave-angular-v3.umd.js +++ b/dist/bundles/flutterwave-angular-v3.umd.js @@ -61,8 +61,140 @@ var PaymentSuccessResponse = (function () { } return PaymentSuccessResponse; }()); +var ApiTracking = (function () { + function ApiTracking() { + this.trackingEndPoint = 'https://kgelfdz7mf.execute-api.us-east-1.amazonaws.com/staging/sendevent'; + this.packageVersion = '1.2.1'; + this.language = 'Angular V3'; + } + /** + * @param {?} data + * @return {?} + */ + ApiTracking.prototype.track = function (data) { + var /** @type {?} */ trackingData = { + publicKey: data.paymentData.public_key, + language: this.language, + version: this.packageVersion, + title: '', + message: '0' // data.responseTime + }; + var /** @type {?} */ paymentOptions = data.paymentData.payment_options || ''; + var /** @type {?} */ paymentOptionsArray = paymentOptions ? paymentOptions.split(',') : []; + var /** @type {?} */ title = ''; + if (paymentOptionsArray.length === 0) { + title = 'Initiate-Charge-Dashboard'; + } + else if (paymentOptionsArray.length === 1) { + title = 'Initiate-Charge-' + paymentOptions; + } + else { + title = 'Initiate-Charge-Multiple'; + } + trackingData.title = data.response.status === 'successful' ? title : title + '-error'; + this.submitTracking(trackingData); + }; + /** + * @param {?} data + * @return {?} + */ + ApiTracking.prototype.submitTracking = function (data) { + fetch(this.trackingEndPoint, { + method: 'POST', + body: JSON.stringify(data) + }).then(function (res) { + }); + }; + return ApiTracking; +}()); +ApiTracking.decorators = [ + { type: core.Injectable }, +]; +/** + * @nocollapse + */ +ApiTracking.ctorParameters = function () { return []; }; +var Flutterwave = (function () { + /** + * @param {?} tracker + */ + function Flutterwave(tracker) { + this.tracker = tracker; + } + /** + * @param {?} paymentData + * @return {?} + */ + Flutterwave.prototype.inlinePay = function (paymentData) { + var _this = this; + var /** @type {?} */ data = Object.assign({}, paymentData, { callback: function (response) { + _this.submitToTracker(paymentData, response, 10000); + paymentData.callbackContext[paymentData.callback.name](response); + }, onclose: function () { + try { + paymentData.callbackContext[paymentData.onclose.name](); + } + catch (e) { } + } }); + FlutterwaveCheckout(data); + }; + /** + * @param {?} paymentData + * @return {?} + */ + Flutterwave.prototype.asyncInlinePay = function (paymentData) { + var _this = this; + return new Promise(function (resolve, reject) { + paymentData = Object.assign({}, paymentData, { callback: function ($event) { + _this.submitToTracker(paymentData, $event, 10000); + resolve($event); + }, onclose: function () { return resolve('closed'); } }); + FlutterwaveCheckout(paymentData); + }); + }; + /** + * @param {?} paymentData + * @param {?} response + * @param {?} responseTime + * @return {?} + */ + Flutterwave.prototype.submitToTracker = function (paymentData, response, responseTime) { + this.tracker.track({ + paymentData: paymentData, + response: response, + responseTime: responseTime + }); + }; + /** + * + * @param {?=} waitDuration {Number} Seconds before closing payment modal + * @return {?} + */ + Flutterwave.prototype.closePaymentModal = function (waitDuration) { + if (waitDuration === void 0) { waitDuration = 0; } + setTimeout(function () { + document.getElementsByName('checkout')[0].setAttribute('style', 'position:fixed;top:0;left:0;z-index:-1;border:none;opacity:0;pointer-events:none;width:100%;height:100%;'); + document.body.style.overflow = ''; + // document.getElementsByName('checkout')[0].setAttribute('style', 'z-index: -1; opacity: 0') + }, waitDuration * 1000); + }; + return Flutterwave; +}()); +Flutterwave.decorators = [ + { type: core.Injectable }, +]; +/** + * @nocollapse + */ +Flutterwave.ctorParameters = function () { return [ + { type: ApiTracking, }, +]; }; var MakePaymentComponent = (function () { - function MakePaymentComponent() { + /** + * @param {?} flutterwave + */ + function MakePaymentComponent(flutterwave) { + this.flutterwave = flutterwave; this.callback = new core.EventEmitter(); this.close = new core.EventEmitter(); this.customer_defaults = { @@ -102,6 +234,7 @@ var MakePaymentComponent = (function () { this.customizations = this.customizations || {}; if (this.data) { this.inlinePaymentOptions = Object.assign({}, this.data, { callback: function (response) { + _this.flutterwave.submitToTracker(_this.data, response, 10000); _this.data.callbackContext[_this.data.callback.name](response); }, onclose: function () { try { @@ -123,6 +256,7 @@ var MakePaymentComponent = (function () { meta: Object.assign({}, this.meta_defaults, this.meta), customer: Object.assign({}, this.customer_defaults, this.customer), callback: function (response) { + _this.flutterwave.submitToTracker(_this.inlinePaymentOptions, response, 10000); _this.callback.emit(response); }, onclose: function () { return _this.close.emit(); }, @@ -152,7 +286,9 @@ MakePaymentComponent.decorators = [ /** * @nocollapse */ -MakePaymentComponent.ctorParameters = function () { return []; }; +MakePaymentComponent.ctorParameters = function () { return [ + { type: Flutterwave, }, +]; }; MakePaymentComponent.propDecorators = { 'public_key': [{ type: core.Input },], 'tx_ref': [{ type: core.Input },], @@ -173,58 +309,6 @@ MakePaymentComponent.propDecorators = { 'className': [{ type: core.Input },], 'data': [{ type: core.Input },], }; -var Flutterwave = (function () { - function Flutterwave() { - } - /** - * @param {?} paymentData - * @return {?} - */ - Flutterwave.prototype.inlinePay = function (paymentData) { - var /** @type {?} */ data = Object.assign({}, paymentData, { callback: function (response) { - paymentData.callbackContext[paymentData.callback.name](response); - }, onclose: function () { - try { - paymentData.callbackContext[paymentData.onclose.name](); - } - catch (e) { } - } }); - FlutterwaveCheckout(data); - }; - /** - * @param {?} paymentData - * @return {?} - */ - Flutterwave.prototype.asyncInlinePay = function (paymentData) { - return new Promise(function (resolve, reject) { - paymentData = Object.assign({}, paymentData, { callback: function ($event) { - resolve($event); - }, onclose: function () { return resolve('closed'); } }); - FlutterwaveCheckout(paymentData); - }); - }; - /** - * - * @param {?=} waitDuration {Number} Seconds before closing payment modal - * @return {?} - */ - Flutterwave.prototype.closePaymentModal = function (waitDuration) { - if (waitDuration === void 0) { waitDuration = 0; } - setTimeout(function () { - document.getElementsByName('checkout')[0].setAttribute('style', 'position:fixed;top:0;left:0;z-index:-1;border:none;opacity:0;pointer-events:none;width:100%;height:100%;'); - document.body.style.overflow = ''; - // document.getElementsByName('checkout')[0].setAttribute('style', 'z-index: -1; opacity: 0') - }, waitDuration * 1000); - }; - return Flutterwave; -}()); -Flutterwave.decorators = [ - { type: core.Injectable }, -]; -/** - * @nocollapse - */ -Flutterwave.ctorParameters = function () { return []; }; var FlutterwaveModule = (function () { function FlutterwaveModule() { var inlineSdk = 'https://checkout.flutterwave.com/v3.js'; @@ -239,10 +323,10 @@ var FlutterwaveModule = (function () { FlutterwaveModule.decorators = [ { type: core.NgModule, args: [{ imports: [ - common.CommonModule + common.CommonModule, ], declarations: [MakePaymentComponent], - providers: [Flutterwave], + providers: [Flutterwave, ApiTracking], exports: [MakePaymentComponent] },] }, ]; @@ -257,6 +341,7 @@ exports.InlinePaymentOptions = InlinePaymentOptions; exports.PaymentSuccessResponse = PaymentSuccessResponse; exports.AsyncPaymentOptions = AsyncPaymentOptions; exports.MakePaymentComponent = MakePaymentComponent; +exports.ɵa = ApiTracking; Object.defineProperty(exports, '__esModule', { value: true }); diff --git a/dist/bundles/flutterwave-angular-v3.umd.js.map b/dist/bundles/flutterwave-angular-v3.umd.js.map index 88b1ec6..39a3042 100644 --- a/dist/bundles/flutterwave-angular-v3.umd.js.map +++ b/dist/bundles/flutterwave-angular-v3.umd.js.map @@ -1 +1 @@ -{"version":3,"file":"flutterwave-angular-v3.umd.js","sources":["~/flutterwave-angular-v3/src/app/modules/flutterwave.module.ts","~/flutterwave-angular-v3/src/app/modules/flutterwave.service.ts","~/flutterwave-angular-v3/src/app/modules/make-payment/make-payment.component.ts","~/flutterwave-angular-v3/src/app/modules/models.ts"],"sourcesContent":["import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { MakePaymentComponent } from './make-payment/make-payment.component';\nimport {Flutterwave} from './flutterwave.service';\nexport class FlutterwaveModule {\nconstructor() {\n\n const inlineSdk = 'https://checkout.flutterwave.com/v3.js';\n const script = document.createElement('script');\n script.src = inlineSdk;\n if (!document.querySelector(`[src=\"${inlineSdk}\"]`)) {\n document.body.appendChild(script)\n }\n\n\n }\nstatic decorators: DecoratorInvocation[] = [\n{ type: NgModule, args: [{\n imports: [\n CommonModule\n ],\n declarations: [MakePaymentComponent] ,\n providers: [Flutterwave],\n exports: [MakePaymentComponent]\n}, ] },\n];\n/**\n * @nocollapse\n */\nstatic ctorParameters: () => ({type: any, decorators?: DecoratorInvocation[]}|null)[] = () => [\n];\n}\n\nfunction FlutterwaveModule_tsickle_Closure_declarations() {\n/** @type {?} */\nFlutterwaveModule.decorators;\n/**\n * @nocollapse\n * @type {?}\n */\nFlutterwaveModule.ctorParameters;\n}\n\n\ninterface DecoratorInvocation {\n type: Function;\n args?: any[];\n}\n","import { Injectable } from '@angular/core';\nimport {AsyncPaymentOptions, FlutterwaveCheckout, InlinePaymentOptions, PaymentSuccessResponse} from './models';\nexport class Flutterwave {\nconstructor() { }\n/**\n * @param {?} paymentData\n * @return {?}\n */\ninlinePay(paymentData: InlinePaymentOptions) {\n\n const /** @type {?} */ data = {\n ...paymentData,\n callback: response => {\n paymentData.callbackContext[paymentData.callback.name](response)\n } ,\n onclose: () => {\n try {\n paymentData.callbackContext[paymentData.onclose.name]()\n } catch ( /** @type {?} */e) {}\n }\n };\n\n FlutterwaveCheckout(data);\n\n }\n/**\n * @param {?} paymentData\n * @return {?}\n */\nasyncInlinePay(paymentData: AsyncPaymentOptions): Promise {\n\n return new Promise((resolve, reject) => {\n\n paymentData = {\n ...paymentData,\n callback: ($event) => {\n resolve($event)\n } ,\n onclose: () => resolve('closed')\n };\n\n FlutterwaveCheckout(paymentData)\n\n })\n\n }\n/**\n *\n * @param {?=} waitDuration {Number} Seconds before closing payment modal\n * @return {?}\n */\nclosePaymentModal(waitDuration: number = 0) {\n setTimeout(() => {\n document.getElementsByName('checkout')[0].setAttribute('style',\n 'position:fixed;top:0;left:0;z-index:-1;border:none;opacity:0;pointer-events:none;width:100%;height:100%;');\n document.body.style.overflow = '';\n // document.getElementsByName('checkout')[0].setAttribute('style', 'z-index: -1; opacity: 0')\n } , waitDuration * 1000 )\n }\n\nstatic decorators: DecoratorInvocation[] = [\n{ type: Injectable },\n];\n/**\n * @nocollapse\n */\nstatic ctorParameters: () => ({type: any, decorators?: DecoratorInvocation[]}|null)[] = () => [\n];\n}\n\nfunction Flutterwave_tsickle_Closure_declarations() {\n/** @type {?} */\nFlutterwave.decorators;\n/**\n * @nocollapse\n * @type {?}\n */\nFlutterwave.ctorParameters;\n}\n\n\ninterface DecoratorInvocation {\n type: Function;\n args?: any[];\n}\n","import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core';\nimport {FlutterwaveCheckout, InlinePaymentOptions, PaymentSuccessResponse} from '../models';\nexport class MakePaymentComponent implements OnInit {\n\n public_key: string;\n tx_ref: string;\n amount: number;\n currency: string;\n payment_options: string;\n payment_plan: string | number;\n subaccounts: any;\n integrity_hash: any;\n redirect_url: string;\n meta: object; // { counsumer_id, consumer_mac}\n customer: object; // {email, phone_number,name}\n callback: EventEmitter = new EventEmitter();\n close: EventEmitter = new EventEmitter();\n customizations: object; // {title, description, logo}\n text: string;\n style: any;\n className: string;\n data: InlinePaymentOptions;\nprivate inlinePaymentOptions: InlinePaymentOptions;\n\n customer_defaults = {\n email: '',\n phone_number: '',\n name: '',\n };\n meta_defaults = {\n consumer_id: '',\n consumer_mac: '',\n };\n customizations_defaults = {\n title: '',\n description: '',\n logo: '',\n };\nconstructor() {\n }\n/**\n * @return {?}\n */\nngOnInit(): void {\n }\n/**\n * @return {?}\n */\nmakePayment() {\n\n this.prepareForPayment();\n FlutterwaveCheckout(this.inlinePaymentOptions);\n\n }\n/**\n * @return {?}\n */\nprepareForPayment(): void {\n\n this.customer = this.customer || {};\n this.meta = this.meta || {};\n this.customizations = this.customizations || {};\n\n if ( this.data ) {\n this.inlinePaymentOptions = {\n ...this.data,\n callback: response => {\n this.data.callbackContext[this.data.callback.name](response)\n } ,\n onclose: () => {\n try {\n this.data.callbackContext[this.data.onclose.name]()\n } catch ( /** @type {?} */e) {\n\n }\n\n } ,\n\n }\n } else {\n\n this.inlinePaymentOptions = {\n callbackContext: null,\n public_key: this.public_key,\n tx_ref: this.tx_ref,\n amount: this.amount,\n currency: this.currency || 'NGN',\n payment_options: this.payment_options || 'card, mobilemoney, ussd',\n redirect_url: this.redirect_url || '',\n meta: {...this.meta_defaults, ...this.meta},\n customer: {...this.customer_defaults, ...this.customer},\n callback: (response: PaymentSuccessResponse) => {\n this.callback.emit(response)\n },\n onclose: () => this.close.emit(),\n customizations: {...this.customizations_defaults\n , ...this.customizations}\n }\n if (this.payment_plan) {\n this.inlinePaymentOptions.payment_plan = this.payment_plan\n }\n if (this.subaccounts) {\n this.inlinePaymentOptions.subaccounts = this.subaccounts\n }\n if (this.integrity_hash) {\n this.inlinePaymentOptions.integrity_hash = this.integrity_hash\n }\n }\n\n\n }\n\nstatic decorators: DecoratorInvocation[] = [\n{ type: Component, args: [{\n // tslint:disable-next-line:component-selector\n selector: 'flutterwave-make-payment',\n template: `\n \n {{text || 'Pay'}}\n \n `,\n styles: [`\n .flutterwave-pay-button{\n background-color: #f5a623;\n border-radius: 4px;\n border-color: #f5a623;\n -webkit-box-shadow: 0 2px 3px 0 #ccc;\n box-shadow: 0 2px 3px 0 #ccc;\n color: #fff;\n display: block;\n font-size: 12px;\n font-weight: 700;\n padding: 14px 22px;\n text-align: center;\n text-decoration: none;\n -webkit-transition: all .3s ease-in-out;\n transition: all .3s ease-in-out;\n\n }\n `]\n}, ] },\n];\n/**\n * @nocollapse\n */\nstatic ctorParameters: () => ({type: any, decorators?: DecoratorInvocation[]}|null)[] = () => [\n];\nstatic propDecorators: {[key: string]: DecoratorInvocation[]} = {\n'public_key': [{ type: Input },],\n'tx_ref': [{ type: Input },],\n'amount': [{ type: Input },],\n'currency': [{ type: Input },],\n'payment_options': [{ type: Input },],\n'payment_plan': [{ type: Input },],\n'subaccounts': [{ type: Input },],\n'integrity_hash': [{ type: Input },],\n'redirect_url': [{ type: Input },],\n'meta': [{ type: Input },],\n'customer': [{ type: Input },],\n'callback': [{ type: Output },],\n'close': [{ type: Output },],\n'customizations': [{ type: Input },],\n'text': [{ type: Input },],\n'style': [{ type: Input },],\n'className': [{ type: Input },],\n'data': [{ type: Input },],\n};\n}\n\nfunction MakePaymentComponent_tsickle_Closure_declarations() {\n/** @type {?} */\nMakePaymentComponent.decorators;\n/**\n * @nocollapse\n * @type {?}\n */\nMakePaymentComponent.ctorParameters;\n/** @type {?} */\nMakePaymentComponent.propDecorators;\n/** @type {?} */\nMakePaymentComponent.prototype.public_key;\n/** @type {?} */\nMakePaymentComponent.prototype.tx_ref;\n/** @type {?} */\nMakePaymentComponent.prototype.amount;\n/** @type {?} */\nMakePaymentComponent.prototype.currency;\n/** @type {?} */\nMakePaymentComponent.prototype.payment_options;\n/** @type {?} */\nMakePaymentComponent.prototype.payment_plan;\n/** @type {?} */\nMakePaymentComponent.prototype.subaccounts;\n/** @type {?} */\nMakePaymentComponent.prototype.integrity_hash;\n/** @type {?} */\nMakePaymentComponent.prototype.redirect_url;\n/** @type {?} */\nMakePaymentComponent.prototype.meta;\n/** @type {?} */\nMakePaymentComponent.prototype.customer;\n/** @type {?} */\nMakePaymentComponent.prototype.callback;\n/** @type {?} */\nMakePaymentComponent.prototype.close;\n/** @type {?} */\nMakePaymentComponent.prototype.customizations;\n/** @type {?} */\nMakePaymentComponent.prototype.text;\n/** @type {?} */\nMakePaymentComponent.prototype.style;\n/** @type {?} */\nMakePaymentComponent.prototype.className;\n/** @type {?} */\nMakePaymentComponent.prototype.data;\n/** @type {?} */\nMakePaymentComponent.prototype.inlinePaymentOptions;\n/** @type {?} */\nMakePaymentComponent.prototype.customer_defaults;\n/** @type {?} */\nMakePaymentComponent.prototype.meta_defaults;\n/** @type {?} */\nMakePaymentComponent.prototype.customizations_defaults;\n}\n\n\ninterface DecoratorInvocation {\n type: Function;\n args?: any[];\n}\n","\n/**\n * Payment data object\n * \\@property public_key {String}\n * \\@property callbackContext {Object} The context of the\n * component or service that has the callback method.\n * The value must always be 'this'.\n * Using any other value might lead to error.\n * \\@property tx_ref {String}\n * \\@property amount {Number}\n * \\@property currency {String}\n * \\@property payment_options {String}\n * \\@property payment_plan {String}\n * \\@property redirect_url {String}\n * \\@property meta {Object}\n * \\@property customer {Object}\n * \\@property customizations {Object}\n * \\@property callback {Function}\n * \\@property onclose {Function}\n */\nclass InlinePaymentOptions {\n public_key: string;\n callbackContext?: object;\n tx_ref: string;\n amount: number;\n currency?: string;\n country?: string;\n authorization?: object | string;\n payment_options?: string;\n payment_plan?: string | number;\n subaccounts?: any;\n integrity_hash?: any;\n redirect_url?: string;\n meta ?: any;\n customer?: object;\n customizations?: object;\n callback?: (response: object) => void;\n onclose?: () => void;\n}\n\nfunction InlinePaymentOptions_tsickle_Closure_declarations() {\n/** @type {?} */\nInlinePaymentOptions.prototype.public_key;\n/** @type {?} */\nInlinePaymentOptions.prototype.callbackContext;\n/** @type {?} */\nInlinePaymentOptions.prototype.tx_ref;\n/** @type {?} */\nInlinePaymentOptions.prototype.amount;\n/** @type {?} */\nInlinePaymentOptions.prototype.currency;\n/** @type {?} */\nInlinePaymentOptions.prototype.country;\n/** @type {?} */\nInlinePaymentOptions.prototype.authorization;\n/** @type {?} */\nInlinePaymentOptions.prototype.payment_options;\n/** @type {?} */\nInlinePaymentOptions.prototype.payment_plan;\n/** @type {?} */\nInlinePaymentOptions.prototype.subaccounts;\n/** @type {?} */\nInlinePaymentOptions.prototype.integrity_hash;\n/** @type {?} */\nInlinePaymentOptions.prototype.redirect_url;\n/** @type {?} */\nInlinePaymentOptions.prototype.meta;\n/** @type {?} */\nInlinePaymentOptions.prototype.customer;\n/** @type {?} */\nInlinePaymentOptions.prototype.customizations;\n/** @type {?} */\nInlinePaymentOptions.prototype.callback;\n/** @type {?} */\nInlinePaymentOptions.prototype.onclose;\n}\n\n/**\n * Async Payment data object\n * \\@property public_key {String}\n * \\@property tx_ref {String}\n * \\@property amount {Number}\n * \\@property currency {String}\n * \\@property payment_options {String}\n * \\@property meta {Object}\n * \\@property customer {Object}\n * \\@property customizations {Object}\n * \\@property payment_plan {String}\n */\nclass AsyncPaymentOptions {\n public_key: string;\n tx_ref: string;\n amount: number;\n currency?: string;\n country?: string;\n authorization?: object | string;\n payment_options?: string;\n meta ?: any;\n customer?: object;\n customizations?: object;\n payment_plan?: string | number;\n subaccounts?: any;\n integrity_hash?: any;\n}\n\nfunction AsyncPaymentOptions_tsickle_Closure_declarations() {\n/** @type {?} */\nAsyncPaymentOptions.prototype.public_key;\n/** @type {?} */\nAsyncPaymentOptions.prototype.tx_ref;\n/** @type {?} */\nAsyncPaymentOptions.prototype.amount;\n/** @type {?} */\nAsyncPaymentOptions.prototype.currency;\n/** @type {?} */\nAsyncPaymentOptions.prototype.country;\n/** @type {?} */\nAsyncPaymentOptions.prototype.authorization;\n/** @type {?} */\nAsyncPaymentOptions.prototype.payment_options;\n/** @type {?} */\nAsyncPaymentOptions.prototype.meta;\n/** @type {?} */\nAsyncPaymentOptions.prototype.customer;\n/** @type {?} */\nAsyncPaymentOptions.prototype.customizations;\n/** @type {?} */\nAsyncPaymentOptions.prototype.payment_plan;\n/** @type {?} */\nAsyncPaymentOptions.prototype.subaccounts;\n/** @type {?} */\nAsyncPaymentOptions.prototype.integrity_hash;\n}\n\n\n\ndeclare function FlutterwaveCheckout(any)\n/**\n * Payment Response\n * \\@property amount {String}\n * \\@property currency {Number}\n * \\@property customer {Object}\n * \\@property flw_ref {String}\n * \\@property status {String}\n * \\@property transaction_id {String}\n * \\@property tx_ref {String}\n * \\@property payment_plan {String}\n */\nclass PaymentSuccessResponse {\n amount?: number;\n currency?: string;\n customer?: object;\n flw_ref?: string;\n status?: string;\n transaction_id?: number;\n tx_ref?: string;\n payment_plan?: string| number\n }\n\nfunction PaymentSuccessResponse_tsickle_Closure_declarations() {\n/** @type {?} */\nPaymentSuccessResponse.prototype.amount;\n/** @type {?} */\nPaymentSuccessResponse.prototype.currency;\n/** @type {?} */\nPaymentSuccessResponse.prototype.customer;\n/** @type {?} */\nPaymentSuccessResponse.prototype.flw_ref;\n/** @type {?} */\nPaymentSuccessResponse.prototype.status;\n/** @type {?} */\nPaymentSuccessResponse.prototype.transaction_id;\n/** @type {?} */\nPaymentSuccessResponse.prototype.tx_ref;\n/** @type {?} */\nPaymentSuccessResponse.prototype.payment_plan;\n}\n\n\n\n export {\n InlinePaymentOptions,\n AsyncPaymentOptions,\n FlutterwaveCheckout,\n PaymentSuccessResponse\n };\n"],"names":["CommonModule","NgModule","Injectable","Input","Output","Component","EventEmitter"],"mappings":";;;;;;AGCA;;;;;;;;;;;;;;;;;;;AAmBA,IAAA,oBAAA,IAAA,YAAA;IAAA,SAAA,oBAAA,GAAA;KAkBC;IAAD,OAAA,oBAAC,CAAD;CAAC,EAAD,CAAA,CAAC;;;;;;;;;;;;;AAmDD,IAAA,mBAAA,IAAA,YAAA;IAAA,SAAA,mBAAA,GAAA;KAcC;IAAD,OAAA,mBAAC,CAAD;CAAC,EAAD,CAAA,CAAC;;;;;;;;;;;;AA6CD,IAAA,sBAAA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AA2C,SAAS,GAApD,KAAwD,CAAC,EAAE;YACnD,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAA;SAClC;KAGJ;;CAXH,EAAA,CAAA,CAAA;AAcO,iBAAP,CAAA,UAAO,GAAoC;IAD3C,EAEE,IAAA,EAAMD,aAAA,EAAU,IAAA,EAAM,CAAA;gBADtB,OAAO,EAEE;oBADPD,mBAAY;iBACb;gBACD,YAAY,EAEE,CAAA,oBAAE,CAAoB;gBADpC,SAAS,EAEE,CAAA,WAAE,CAAW;gBADxB,OAAO,EAEE,CAAA,oBAAE,CAAoB;aADhC,EAEC,EAAG;CADJ,CAEC;;;;AAED,iBAAD,CAAA,cAAC,GAAA,YAAD,EAAC,OAAA,EACA,CADD,EACC,CAAC;;;;;;;;;;;;;;;;;"} +{"version":3,"file":"flutterwave-angular-v3.umd.js","sources":["~/flutterwave-angular-v3/src/app/modules/flutterwave.module.ts","~/flutterwave-angular-v3/src/app/modules/make-payment/make-payment.component.ts","~/flutterwave-angular-v3/src/app/modules/flutterwave.service.ts","~/flutterwave-angular-v3/src/app/modules/api-tracking.service.ts","~/flutterwave-angular-v3/src/app/modules/models.ts"],"sourcesContent":["import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { MakePaymentComponent } from './make-payment/make-payment.component';\nimport {Flutterwave} from './flutterwave.service';\nimport {ApiTracking} from './api-tracking.service';\nexport class FlutterwaveModule {\nconstructor() {\n\n const inlineSdk = 'https://checkout.flutterwave.com/v3.js';\n const script = document.createElement('script');\n script.src = inlineSdk;\n if (!document.querySelector(`[src=\"${inlineSdk}\"]`)) {\n document.body.appendChild(script)\n }\n\n\n }\nstatic decorators: DecoratorInvocation[] = [\n{ type: NgModule, args: [{\n imports: [\n CommonModule,\n ],\n declarations: [MakePaymentComponent] ,\n providers: [Flutterwave, ApiTracking],\n exports: [MakePaymentComponent]\n}, ] },\n];\n/**\n * @nocollapse\n */\nstatic ctorParameters: () => ({type: any, decorators?: DecoratorInvocation[]}|null)[] = () => [\n];\n}\n\nfunction FlutterwaveModule_tsickle_Closure_declarations() {\n/** @type {?} */\nFlutterwaveModule.decorators;\n/**\n * @nocollapse\n * @type {?}\n */\nFlutterwaveModule.ctorParameters;\n}\n\n\ninterface DecoratorInvocation {\n type: Function;\n args?: any[];\n}\n","import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core';\nimport {FlutterwaveCheckout, InlinePaymentOptions, PaymentSuccessResponse} from '../models';\nimport {Flutterwave} from '../flutterwave.service';\nexport class MakePaymentComponent implements OnInit {\n\n public_key: string;\n tx_ref: string;\n amount: number;\n currency: string;\n payment_options: string;\n payment_plan: string | number;\n subaccounts: any;\n integrity_hash: any;\n redirect_url: string;\n meta: object; // { counsumer_id, consumer_mac}\n customer: object; // {email, phone_number,name}\n callback: EventEmitter = new EventEmitter();\n close: EventEmitter = new EventEmitter();\n customizations: object; // {title, description, logo}\n text: string;\n style: any;\n className: string;\n data: InlinePaymentOptions;\nprivate inlinePaymentOptions: InlinePaymentOptions;\n\n customer_defaults = {\n email: '',\n phone_number: '',\n name: '',\n };\n meta_defaults = {\n consumer_id: '',\n consumer_mac: '',\n };\n customizations_defaults = {\n title: '',\n description: '',\n logo: '',\n };\n/**\n * @param {?} flutterwave\n */\nconstructor(private flutterwave: Flutterwave) {\n }\n/**\n * @return {?}\n */\nngOnInit(): void {\n }\n/**\n * @return {?}\n */\nmakePayment() {\n\n this.prepareForPayment();\n FlutterwaveCheckout(this.inlinePaymentOptions);\n\n }\n/**\n * @return {?}\n */\nprepareForPayment(): void {\n\n this.customer = this.customer || {};\n this.meta = this.meta || {};\n this.customizations = this.customizations || {};\n\n if ( this.data ) {\n this.inlinePaymentOptions = {\n ...this.data,\n callback: response => {\n this.flutterwave.submitToTracker(this.data , response, 10000)\n this.data.callbackContext[this.data.callback.name](response)\n } ,\n onclose: () => {\n try {\n this.data.callbackContext[this.data.onclose.name]()\n } catch ( /** @type {?} */e) {\n\n }\n\n } ,\n\n }\n } else {\n\n this.inlinePaymentOptions = {\n callbackContext: null,\n public_key: this.public_key,\n tx_ref: this.tx_ref,\n amount: this.amount,\n currency: this.currency || 'NGN',\n payment_options: this.payment_options || 'card, mobilemoney, ussd',\n redirect_url: this.redirect_url || '',\n meta: {...this.meta_defaults, ...this.meta},\n customer: {...this.customer_defaults, ...this.customer},\n callback: (response: PaymentSuccessResponse) => {\n this.flutterwave.submitToTracker(this.inlinePaymentOptions , response, 10000)\n this.callback.emit(response)\n },\n onclose: () => this.close.emit(),\n customizations: {...this.customizations_defaults\n , ...this.customizations}\n }\n if (this.payment_plan) {\n this.inlinePaymentOptions.payment_plan = this.payment_plan\n }\n if (this.subaccounts) {\n this.inlinePaymentOptions.subaccounts = this.subaccounts\n }\n if (this.integrity_hash) {\n this.inlinePaymentOptions.integrity_hash = this.integrity_hash\n }\n }\n\n\n }\n\nstatic decorators: DecoratorInvocation[] = [\n{ type: Component, args: [{\n // tslint:disable-next-line:component-selector\n selector: 'flutterwave-make-payment',\n template: `\n \n {{text || 'Pay'}}\n \n `,\n styles: [`\n .flutterwave-pay-button{\n background-color: #f5a623;\n border-radius: 4px;\n border-color: #f5a623;\n -webkit-box-shadow: 0 2px 3px 0 #ccc;\n box-shadow: 0 2px 3px 0 #ccc;\n color: #fff;\n display: block;\n font-size: 12px;\n font-weight: 700;\n padding: 14px 22px;\n text-align: center;\n text-decoration: none;\n -webkit-transition: all .3s ease-in-out;\n transition: all .3s ease-in-out;\n\n }\n `]\n}, ] },\n];\n/**\n * @nocollapse\n */\nstatic ctorParameters: () => ({type: any, decorators?: DecoratorInvocation[]}|null)[] = () => [\n{type: Flutterwave, },\n];\nstatic propDecorators: {[key: string]: DecoratorInvocation[]} = {\n'public_key': [{ type: Input },],\n'tx_ref': [{ type: Input },],\n'amount': [{ type: Input },],\n'currency': [{ type: Input },],\n'payment_options': [{ type: Input },],\n'payment_plan': [{ type: Input },],\n'subaccounts': [{ type: Input },],\n'integrity_hash': [{ type: Input },],\n'redirect_url': [{ type: Input },],\n'meta': [{ type: Input },],\n'customer': [{ type: Input },],\n'callback': [{ type: Output },],\n'close': [{ type: Output },],\n'customizations': [{ type: Input },],\n'text': [{ type: Input },],\n'style': [{ type: Input },],\n'className': [{ type: Input },],\n'data': [{ type: Input },],\n};\n}\n\nfunction MakePaymentComponent_tsickle_Closure_declarations() {\n/** @type {?} */\nMakePaymentComponent.decorators;\n/**\n * @nocollapse\n * @type {?}\n */\nMakePaymentComponent.ctorParameters;\n/** @type {?} */\nMakePaymentComponent.propDecorators;\n/** @type {?} */\nMakePaymentComponent.prototype.public_key;\n/** @type {?} */\nMakePaymentComponent.prototype.tx_ref;\n/** @type {?} */\nMakePaymentComponent.prototype.amount;\n/** @type {?} */\nMakePaymentComponent.prototype.currency;\n/** @type {?} */\nMakePaymentComponent.prototype.payment_options;\n/** @type {?} */\nMakePaymentComponent.prototype.payment_plan;\n/** @type {?} */\nMakePaymentComponent.prototype.subaccounts;\n/** @type {?} */\nMakePaymentComponent.prototype.integrity_hash;\n/** @type {?} */\nMakePaymentComponent.prototype.redirect_url;\n/** @type {?} */\nMakePaymentComponent.prototype.meta;\n/** @type {?} */\nMakePaymentComponent.prototype.customer;\n/** @type {?} */\nMakePaymentComponent.prototype.callback;\n/** @type {?} */\nMakePaymentComponent.prototype.close;\n/** @type {?} */\nMakePaymentComponent.prototype.customizations;\n/** @type {?} */\nMakePaymentComponent.prototype.text;\n/** @type {?} */\nMakePaymentComponent.prototype.style;\n/** @type {?} */\nMakePaymentComponent.prototype.className;\n/** @type {?} */\nMakePaymentComponent.prototype.data;\n/** @type {?} */\nMakePaymentComponent.prototype.inlinePaymentOptions;\n/** @type {?} */\nMakePaymentComponent.prototype.customer_defaults;\n/** @type {?} */\nMakePaymentComponent.prototype.meta_defaults;\n/** @type {?} */\nMakePaymentComponent.prototype.customizations_defaults;\n/** @type {?} */\nMakePaymentComponent.prototype.flutterwave;\n}\n\n\ninterface DecoratorInvocation {\n type: Function;\n args?: any[];\n}\n","import { Injectable } from '@angular/core';\nimport {AsyncPaymentOptions, FlutterwaveCheckout, InlinePaymentOptions, PaymentSuccessResponse} from './models';\nimport {ApiTracking} from './api-tracking.service';\nexport class Flutterwave {\n/**\n * @param {?} tracker\n */\nconstructor(private tracker: ApiTracking) {\n }\n/**\n * @param {?} paymentData\n * @return {?}\n */\ninlinePay(paymentData: InlinePaymentOptions) {\n\n const /** @type {?} */ data = {\n ...paymentData,\n callback: response => {\n this.submitToTracker(paymentData , response, 10000)\n paymentData.callbackContext[paymentData.callback.name](response)\n } ,\n onclose: () => {\n try {\n paymentData.callbackContext[paymentData.onclose.name]()\n } catch ( /** @type {?} */e) {}\n }\n };\n\n FlutterwaveCheckout(data);\n\n }\n/**\n * @param {?} paymentData\n * @return {?}\n */\nasyncInlinePay(paymentData: AsyncPaymentOptions): Promise {\n\n return new Promise((resolve, reject) => {\n\n paymentData = {\n ...paymentData,\n callback: ($event) => {\n this.submitToTracker(paymentData , $event, 10000)\n resolve($event)\n } ,\n onclose: () => resolve('closed')\n };\n\n FlutterwaveCheckout(paymentData)\n\n })\n\n }\n/**\n * @param {?} paymentData\n * @param {?} response\n * @param {?} responseTime\n * @return {?}\n */\nsubmitToTracker(paymentData , response, responseTime) {\n\n\n this.tracker.track({\n paymentData,\n response,\n responseTime\n })\n\n\n }\n/**\n *\n * @param {?=} waitDuration {Number} Seconds before closing payment modal\n * @return {?}\n */\nclosePaymentModal(waitDuration: number = 0) {\n setTimeout(() => {\n document.getElementsByName('checkout')[0].setAttribute('style',\n 'position:fixed;top:0;left:0;z-index:-1;border:none;opacity:0;pointer-events:none;width:100%;height:100%;');\n document.body.style.overflow = '';\n // document.getElementsByName('checkout')[0].setAttribute('style', 'z-index: -1; opacity: 0')\n } , waitDuration * 1000 )\n }\n\nstatic decorators: DecoratorInvocation[] = [\n{ type: Injectable },\n];\n/**\n * @nocollapse\n */\nstatic ctorParameters: () => ({type: any, decorators?: DecoratorInvocation[]}|null)[] = () => [\n{type: ApiTracking, },\n];\n}\n\nfunction Flutterwave_tsickle_Closure_declarations() {\n/** @type {?} */\nFlutterwave.decorators;\n/**\n * @nocollapse\n * @type {?}\n */\nFlutterwave.ctorParameters;\n/** @type {?} */\nFlutterwave.prototype.tracker;\n}\n\n\ninterface DecoratorInvocation {\n type: Function;\n args?: any[];\n}\n","import {Injectable} from '@angular/core';\nexport class ApiTracking {\n\n trackingEndPoint = 'https://kgelfdz7mf.execute-api.us-east-1.amazonaws.com/staging/sendevent';\n\n packageVersion = '1.2.1';\n language = 'Angular V3'\nconstructor() {\n }\n/**\n * @param {?} data\n * @return {?}\n */\ntrack(data: {\n paymentData: object | any,\n response: object | any,\n responseTime: string\n }) {\n\n const /** @type {?} */ trackingData = {\n publicKey: data.paymentData.public_key,\n language: this.language,\n version: this.packageVersion,\n title: '',\n message: '0' // data.responseTime\n\n }\n\n const /** @type {?} */ paymentOptions = data.paymentData.payment_options || ''\n const /** @type {?} */ paymentOptionsArray = paymentOptions ? paymentOptions.split(',') : []\n\n\n\n\n let /** @type {?} */ title = ''\n\n if (paymentOptionsArray.length === 0) {\n title = 'Initiate-Charge-Dashboard'\n } else if (paymentOptionsArray.length === 1) {\n title = 'Initiate-Charge-' + paymentOptions\n\n } else {\n title = 'Initiate-Charge-Multiple'\n\n }\n\n trackingData.title = data.response.status === 'successful' ? title : title + '-error'\n\n this.submitTracking(trackingData)\n\n }\n/**\n * @param {?} data\n * @return {?}\n */\nsubmitTracking(data) {\n\n fetch(this.trackingEndPoint, {\n method: 'POST',\n body: JSON.stringify(data)\n }).then((res) => {\n })\n\n }\n\n\nstatic decorators: DecoratorInvocation[] = [\n{ type: Injectable },\n];\n/**\n * @nocollapse\n */\nstatic ctorParameters: () => ({type: any, decorators?: DecoratorInvocation[]}|null)[] = () => [\n];\n}\n\nfunction ApiTracking_tsickle_Closure_declarations() {\n/** @type {?} */\nApiTracking.decorators;\n/**\n * @nocollapse\n * @type {?}\n */\nApiTracking.ctorParameters;\n/** @type {?} */\nApiTracking.prototype.trackingEndPoint;\n/** @type {?} */\nApiTracking.prototype.packageVersion;\n/** @type {?} */\nApiTracking.prototype.language;\n}\n\n\n/*\n\ninterface tracking-data {\n merchantId: string,\n language: string\n}\n*/\n\n\ninterface DecoratorInvocation {\n type: Function;\n args?: any[];\n}\n","\n/**\n * Payment data object\n * \\@property public_key {String}\n * \\@property callbackContext {Object} The context of the\n * component or service that has the callback method.\n * The value must always be 'this'.\n * Using any other value might lead to error.\n * \\@property tx_ref {String}\n * \\@property amount {Number}\n * \\@property currency {String}\n * \\@property payment_options {String}\n * \\@property payment_plan {String}\n * \\@property redirect_url {String}\n * \\@property meta {Object}\n * \\@property customer {Object}\n * \\@property customizations {Object}\n * \\@property callback {Function}\n * \\@property onclose {Function}\n */\nclass InlinePaymentOptions {\n public_key: string;\n callbackContext?: object;\n tx_ref: string;\n amount: number;\n currency?: string;\n country?: string;\n authorization?: object | string;\n payment_options?: string;\n payment_plan?: string | number;\n subaccounts?: any;\n integrity_hash?: any;\n redirect_url?: string;\n meta ?: any;\n customer?: object;\n customizations?: object;\n callback?: (response: object) => void;\n onclose?: () => void;\n}\n\nfunction InlinePaymentOptions_tsickle_Closure_declarations() {\n/** @type {?} */\nInlinePaymentOptions.prototype.public_key;\n/** @type {?} */\nInlinePaymentOptions.prototype.callbackContext;\n/** @type {?} */\nInlinePaymentOptions.prototype.tx_ref;\n/** @type {?} */\nInlinePaymentOptions.prototype.amount;\n/** @type {?} */\nInlinePaymentOptions.prototype.currency;\n/** @type {?} */\nInlinePaymentOptions.prototype.country;\n/** @type {?} */\nInlinePaymentOptions.prototype.authorization;\n/** @type {?} */\nInlinePaymentOptions.prototype.payment_options;\n/** @type {?} */\nInlinePaymentOptions.prototype.payment_plan;\n/** @type {?} */\nInlinePaymentOptions.prototype.subaccounts;\n/** @type {?} */\nInlinePaymentOptions.prototype.integrity_hash;\n/** @type {?} */\nInlinePaymentOptions.prototype.redirect_url;\n/** @type {?} */\nInlinePaymentOptions.prototype.meta;\n/** @type {?} */\nInlinePaymentOptions.prototype.customer;\n/** @type {?} */\nInlinePaymentOptions.prototype.customizations;\n/** @type {?} */\nInlinePaymentOptions.prototype.callback;\n/** @type {?} */\nInlinePaymentOptions.prototype.onclose;\n}\n\n/**\n * Async Payment data object\n * \\@property public_key {String}\n * \\@property tx_ref {String}\n * \\@property amount {Number}\n * \\@property currency {String}\n * \\@property payment_options {String}\n * \\@property meta {Object}\n * \\@property customer {Object}\n * \\@property customizations {Object}\n * \\@property payment_plan {String}\n */\nclass AsyncPaymentOptions {\n public_key: string;\n tx_ref: string;\n amount: number;\n currency?: string;\n country?: string;\n authorization?: object | string;\n payment_options?: string;\n meta ?: any;\n customer?: object;\n customizations?: object;\n payment_plan?: string | number;\n subaccounts?: any;\n integrity_hash?: any;\n}\n\nfunction AsyncPaymentOptions_tsickle_Closure_declarations() {\n/** @type {?} */\nAsyncPaymentOptions.prototype.public_key;\n/** @type {?} */\nAsyncPaymentOptions.prototype.tx_ref;\n/** @type {?} */\nAsyncPaymentOptions.prototype.amount;\n/** @type {?} */\nAsyncPaymentOptions.prototype.currency;\n/** @type {?} */\nAsyncPaymentOptions.prototype.country;\n/** @type {?} */\nAsyncPaymentOptions.prototype.authorization;\n/** @type {?} */\nAsyncPaymentOptions.prototype.payment_options;\n/** @type {?} */\nAsyncPaymentOptions.prototype.meta;\n/** @type {?} */\nAsyncPaymentOptions.prototype.customer;\n/** @type {?} */\nAsyncPaymentOptions.prototype.customizations;\n/** @type {?} */\nAsyncPaymentOptions.prototype.payment_plan;\n/** @type {?} */\nAsyncPaymentOptions.prototype.subaccounts;\n/** @type {?} */\nAsyncPaymentOptions.prototype.integrity_hash;\n}\n\n\n\ndeclare function FlutterwaveCheckout(any)\n/**\n * Payment Response\n * \\@property amount {String}\n * \\@property currency {Number}\n * \\@property customer {Object}\n * \\@property flw_ref {String}\n * \\@property status {String}\n * \\@property transaction_id {String}\n * \\@property tx_ref {String}\n * \\@property payment_plan {String}\n */\nclass PaymentSuccessResponse {\n amount?: number;\n currency?: string;\n customer?: object;\n flw_ref?: string;\n status?: string;\n transaction_id?: number;\n tx_ref?: string;\n payment_plan?: string| number\n }\n\nfunction PaymentSuccessResponse_tsickle_Closure_declarations() {\n/** @type {?} */\nPaymentSuccessResponse.prototype.amount;\n/** @type {?} */\nPaymentSuccessResponse.prototype.currency;\n/** @type {?} */\nPaymentSuccessResponse.prototype.customer;\n/** @type {?} */\nPaymentSuccessResponse.prototype.flw_ref;\n/** @type {?} */\nPaymentSuccessResponse.prototype.status;\n/** @type {?} */\nPaymentSuccessResponse.prototype.transaction_id;\n/** @type {?} */\nPaymentSuccessResponse.prototype.tx_ref;\n/** @type {?} */\nPaymentSuccessResponse.prototype.payment_plan;\n}\n\n\n\n export {\n InlinePaymentOptions,\n AsyncPaymentOptions,\n FlutterwaveCheckout,\n PaymentSuccessResponse\n };\n"],"names":["CommonModule","NgModule","Input","Output","Component","EventEmitter","Injectable"],"mappings":";;;;;;AICA;;;;;;;;;;;;;;;;;;;AAmBA,IAAA,oBAAA,IAAA,YAAA;IAAA,SAAA,oBAAA,GAAA;KAkBC;IAAD,OAAA,oBAAC,CAAD;CAAC,EAAD,CAAA,CAAC;;;;;;;;;;;;;AAmDD,IAAA,mBAAA,IAAA,YAAA;IAAA,SAAA,mBAAA,GAAA;KAcC;IAAD,OAAA,mBAAC,CAAD;CAAC,EAAD,CAAA,CAAC;;;;;;;;;;;;AA6CD,IAAA,sBAAA,IAAA,YAAA;IAAA,SAAA,sBAAA,GAAA;KASG;IAAH,OAAA,sBAAG,CAAH;CAAG,EAAH,CAAA,CAAG;AD5JH,IAAA,WAAA,IAAA,YAAA;IAMA,SAAA,WAAA,GAAA;QAJE,IAAF,CAAA,gBAAkB,GAGG,0EAAA,CAA2E;QAD9F,IAAF,CAAA,cAAgB,GAGG,OAAA,CAAQ;QAFzB,IAAF,CAAA,QAAU,GAGG,YAAA,CAAA;KADV;;;;;IAKH,WAAA,CAAA,SAAA,CAAA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Y,EAEE,CAAA,oBAAE,CAAoB;gBADpC,SAAS,EAEE,CAAA,WAAE,EAAY,WAAA,CAAY;gBADrC,OAAO,EAEE,CAAA,oBAAE,CAAoB;aADhC,EAEC,EAAG;CADJ,CAEC;;;;AAED,iBAAD,CAAA,cAAC,GAAA,YAAD,EAAC,OAAA,EACA,CADD,EACC,CAAC;;;;;;;;;;;;;;;;;;"} diff --git a/dist/bundles/flutterwave-angular-v3.umd.min.js b/dist/bundles/flutterwave-angular-v3.umd.min.js index f0cd4e4..368e903 100644 --- a/dist/bundles/flutterwave-angular-v3.umd.min.js +++ b/dist/bundles/flutterwave-angular-v3.umd.min.js @@ -1,2 +1,2 @@ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("@angular/common")):"function"==typeof define&&define.amd?define(["exports","@angular/core","@angular/common"],e):e(t["flutterwave-angular-v3"]={},t.ng.core,t.ng.common)}(this,function(t,e,n){"use strict";var o=function u(){},a=function l(){},i=function p(){},s=function(){function t(){this.callback=new e.EventEmitter,this.close=new e.EventEmitter,this.customer_defaults={email:"",phone_number:"",name:""},this.meta_defaults={consumer_id:"",consumer_mac:""},this.customizations_defaults={title:"",description:"",logo:""}}return t.prototype.ngOnInit=function(){},t.prototype.makePayment=function(){this.prepareForPayment(),FlutterwaveCheckout(this.inlinePaymentOptions)},t.prototype.prepareForPayment=function(){var e=this;this.customer=this.customer||{},this.meta=this.meta||{},this.customizations=this.customizations||{},this.data?this.inlinePaymentOptions=Object.assign({},this.data,{callback:function(t){e.data.callbackContext[e.data.callback.name](t)},onclose:function(){try{e.data.callbackContext[e.data.onclose.name]()}catch(t){}}}):(this.inlinePaymentOptions={callbackContext:null,public_key:this.public_key,tx_ref:this.tx_ref,amount:this.amount,currency:this.currency||"NGN",payment_options:this.payment_options||"card, mobilemoney, ussd",redirect_url:this.redirect_url||"",meta:Object.assign({},this.meta_defaults,this.meta),customer:Object.assign({},this.customer_defaults,this.customer),callback:function(t){e.callback.emit(t)},onclose:function(){return e.close.emit()},customizations:Object.assign({},this.customizations_defaults,this.customizations)},this.payment_plan&&(this.inlinePaymentOptions.payment_plan=this.payment_plan),this.subaccounts&&(this.inlinePaymentOptions.subaccounts=this.subaccounts),this.integrity_hash&&(this.inlinePaymentOptions.integrity_hash=this.integrity_hash))},t}();s.decorators=[{type:e.Component,args:[{selector:"flutterwave-make-payment",template:'\n \n {{text || \'Pay\'}}\n \n ',styles:["\n .flutterwave-pay-button{\n background-color: #f5a623;\n border-radius: 4px;\n border-color: #f5a623;\n -webkit-box-shadow: 0 2px 3px 0 #ccc;\n box-shadow: 0 2px 3px 0 #ccc;\n color: #fff;\n display: block;\n font-size: 12px;\n font-weight: 700;\n padding: 14px 22px;\n text-align: center;\n text-decoration: none;\n -webkit-transition: all .3s ease-in-out;\n transition: all .3s ease-in-out;\n\n }\n "]}]}],s.ctorParameters=function(){return[]},s.propDecorators={public_key:[{type:e.Input}],tx_ref:[{type:e.Input}],amount:[{type:e.Input}],currency:[{type:e.Input}],payment_options:[{type:e.Input}],payment_plan:[{type:e.Input}],subaccounts:[{type:e.Input}],integrity_hash:[{type:e.Input}],redirect_url:[{type:e.Input}],meta:[{type:e.Input}],customer:[{type:e.Input}],callback:[{type:e.Output}],close:[{type:e.Output}],customizations:[{type:e.Input}],text:[{type:e.Input}],style:[{type:e.Input}],className:[{type:e.Input}],data:[{type:e.Input}]};var c=function(){function t(){}return t.prototype.inlinePay=function(e){var t=Object.assign({},e,{callback:function(t){e.callbackContext[e.callback.name](t)},onclose:function(){try{e.callbackContext[e.onclose.name]()}catch(t){}}});FlutterwaveCheckout(t)},t.prototype.asyncInlinePay=function(n){return new Promise(function(e,t){n=Object.assign({},n,{callback:function(t){e(t)},onclose:function(){return e("closed")}}),FlutterwaveCheckout(n)})},t.prototype.closePaymentModal=function(t){void 0===t&&(t=0),setTimeout(function(){document.getElementsByName("checkout")[0].setAttribute("style","position:fixed;top:0;left:0;z-index:-1;border:none;opacity:0;pointer-events:none;width:100%;height:100%;"),document.body.style.overflow=""},1e3*t)},t}();c.decorators=[{type:e.Injectable}],c.ctorParameters=function(){return[]};var r=function m(){var t="https://checkout.flutterwave.com/v3.js",e=document.createElement("script");e.src=t,document.querySelector('[src="'+t+'"]')||document.body.appendChild(e)};r.decorators=[{type:e.NgModule,args:[{imports:[n.CommonModule],declarations:[s],providers:[c],exports:[s]}]}],r.ctorParameters=function(){return[]},t.FlutterwaveModule=r,t.Flutterwave=c,t.InlinePaymentOptions=o,t.PaymentSuccessResponse=i,t.AsyncPaymentOptions=a,t.MakePaymentComponent=s,Object.defineProperty(t,"__esModule",{value:!0})}); +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("@angular/common")):"function"==typeof define&&define.amd?define(["exports","@angular/core","@angular/common"],e):e(t["flutterwave-angular-v3"]={},t.ng.core,t.ng.common)}(this,function(t,e,n){"use strict";var a=function p(){},o=function l(){},i=function m(){},s=function(){function t(){this.trackingEndPoint="https://kgelfdz7mf.execute-api.us-east-1.amazonaws.com/staging/sendevent",this.packageVersion="1.2.1",this.language="Angular V3"}return t.prototype.track=function(t){var e={publicKey:t.paymentData.public_key,language:this.language,version:this.packageVersion,title:"",message:"0"},n=t.paymentData.payment_options||"",a=n?n.split(","):[],o="";o=0===a.length?"Initiate-Charge-Dashboard":1===a.length?"Initiate-Charge-"+n:"Initiate-Charge-Multiple",e.title="successful"===t.response.status?o:o+"-error",this.submitTracking(e)},t.prototype.submitTracking=function(t){fetch(this.trackingEndPoint,{method:"POST",body:JSON.stringify(t)}).then(function(t){})},t}();s.decorators=[{type:e.Injectable}],s.ctorParameters=function(){return[]};var c=function(){function t(t){this.tracker=t}return t.prototype.inlinePay=function(e){var n=this,t=Object.assign({},e,{callback:function(t){n.submitToTracker(e,t,1e4),e.callbackContext[e.callback.name](t)},onclose:function(){try{e.callbackContext[e.onclose.name]()}catch(t){}}});FlutterwaveCheckout(t)},t.prototype.asyncInlinePay=function(n){var a=this;return new Promise(function(e,t){n=Object.assign({},n,{callback:function(t){a.submitToTracker(n,t,1e4),e(t)},onclose:function(){return e("closed")}}),FlutterwaveCheckout(n)})},t.prototype.submitToTracker=function(t,e,n){this.tracker.track({paymentData:t,response:e,responseTime:n})},t.prototype.closePaymentModal=function(t){void 0===t&&(t=0),setTimeout(function(){document.getElementsByName("checkout")[0].setAttribute("style","position:fixed;top:0;left:0;z-index:-1;border:none;opacity:0;pointer-events:none;width:100%;height:100%;"),document.body.style.overflow=""},1e3*t)},t}();c.decorators=[{type:e.Injectable}],c.ctorParameters=function(){return[{type:s}]};var r=function(){function t(t){this.flutterwave=t,this.callback=new e.EventEmitter,this.close=new e.EventEmitter,this.customer_defaults={email:"",phone_number:"",name:""},this.meta_defaults={consumer_id:"",consumer_mac:""},this.customizations_defaults={title:"",description:"",logo:""}}return t.prototype.ngOnInit=function(){},t.prototype.makePayment=function(){this.prepareForPayment(),FlutterwaveCheckout(this.inlinePaymentOptions)},t.prototype.prepareForPayment=function(){var e=this;this.customer=this.customer||{},this.meta=this.meta||{},this.customizations=this.customizations||{},this.data?this.inlinePaymentOptions=Object.assign({},this.data,{callback:function(t){e.flutterwave.submitToTracker(e.data,t,1e4),e.data.callbackContext[e.data.callback.name](t)},onclose:function(){try{e.data.callbackContext[e.data.onclose.name]()}catch(t){}}}):(this.inlinePaymentOptions={callbackContext:null,public_key:this.public_key,tx_ref:this.tx_ref,amount:this.amount,currency:this.currency||"NGN",payment_options:this.payment_options||"card, mobilemoney, ussd",redirect_url:this.redirect_url||"",meta:Object.assign({},this.meta_defaults,this.meta),customer:Object.assign({},this.customer_defaults,this.customer),callback:function(t){e.flutterwave.submitToTracker(e.inlinePaymentOptions,t,1e4),e.callback.emit(t)},onclose:function(){return e.close.emit()},customizations:Object.assign({},this.customizations_defaults,this.customizations)},this.payment_plan&&(this.inlinePaymentOptions.payment_plan=this.payment_plan),this.subaccounts&&(this.inlinePaymentOptions.subaccounts=this.subaccounts),this.integrity_hash&&(this.inlinePaymentOptions.integrity_hash=this.integrity_hash))},t}();r.decorators=[{type:e.Component,args:[{selector:"flutterwave-make-payment",template:'\n \n {{text || \'Pay\'}}\n \n ',styles:["\n .flutterwave-pay-button{\n background-color: #f5a623;\n border-radius: 4px;\n border-color: #f5a623;\n -webkit-box-shadow: 0 2px 3px 0 #ccc;\n box-shadow: 0 2px 3px 0 #ccc;\n color: #fff;\n display: block;\n font-size: 12px;\n font-weight: 700;\n padding: 14px 22px;\n text-align: center;\n text-decoration: none;\n -webkit-transition: all .3s ease-in-out;\n transition: all .3s ease-in-out;\n\n }\n "]}]}],r.ctorParameters=function(){return[{type:c}]},r.propDecorators={public_key:[{type:e.Input}],tx_ref:[{type:e.Input}],amount:[{type:e.Input}],currency:[{type:e.Input}],payment_options:[{type:e.Input}],payment_plan:[{type:e.Input}],subaccounts:[{type:e.Input}],integrity_hash:[{type:e.Input}],redirect_url:[{type:e.Input}],meta:[{type:e.Input}],customer:[{type:e.Input}],callback:[{type:e.Output}],close:[{type:e.Output}],customizations:[{type:e.Input}],text:[{type:e.Input}],style:[{type:e.Input}],className:[{type:e.Input}],data:[{type:e.Input}]};var u=function y(){var t="https://checkout.flutterwave.com/v3.js",e=document.createElement("script");e.src=t,document.querySelector('[src="'+t+'"]')||document.body.appendChild(e)};u.decorators=[{type:e.NgModule,args:[{imports:[n.CommonModule],declarations:[r],providers:[c,s],exports:[r]}]}],u.ctorParameters=function(){return[]},t.FlutterwaveModule=u,t.Flutterwave=c,t.InlinePaymentOptions=a,t.PaymentSuccessResponse=i,t.AsyncPaymentOptions=o,t.MakePaymentComponent=r,t.ɵa=s,Object.defineProperty(t,"__esModule",{value:!0})}); //# sourceMappingURL=flutterwave-angular-v3.umd.min.js.map diff --git a/dist/bundles/flutterwave-angular-v3.umd.min.js.map b/dist/bundles/flutterwave-angular-v3.umd.min.js.map index 3f30ffd..001174f 100644 --- a/dist/bundles/flutterwave-angular-v3.umd.min.js.map +++ b/dist/bundles/flutterwave-angular-v3.umd.min.js.map @@ -1 +1 @@ -{"version":3,"file":"flutterwave-angular-v3.umd.min.js","sources":["~/flutterwave-angular-v3/src/app/modules/models.ts","~/flutterwave-angular-v3/src/app/modules/make-payment/make-payment.component.ts","~/flutterwave-angular-v3/src/app/modules/flutterwave.service.ts","~/flutterwave-angular-v3/src/app/modules/flutterwave.module.ts"],"sourcesContent":["\n\n/**\n * Payment data object\n * @typedef {Object}\n * @property public_key {String}\n * @property callbackContext {Object} The context of the\n * component or service that has the callback method.\n * The value must always be 'this'.\n * Using any other value might lead to error.\n * @property tx_ref {String}\n * @property amount {Number}\n * @property currency {String}\n * @property payment_options {String}\n * @property payment_plan {String}\n * @property redirect_url {String}\n * @property meta {Object}\n * @property customer {Object}\n * @property customizations {Object}\n * @property callback {Function}\n * @property onclose {Function}\n */\n class InlinePaymentOptions {\n public_key: string;\n callbackContext?: object;\n tx_ref: string;\n amount: number;\n currency?: string;\n country?: string;\n authorization?: object | string;\n payment_options?: string;\n payment_plan?: string | number;\n subaccounts?: any;\n integrity_hash?: any;\n redirect_url?: string;\n meta ?: any;\n customer?: object;\n customizations?: object;\n callback?: (response: object) => void;\n onclose?: () => void;\n}\n\n\n/**\n * Async Payment data object\n * @typedef {Object}\n * @property public_key {String}\n * @property tx_ref {String}\n * @property amount {Number}\n * @property currency {String}\n * @property payment_options {String}\n * @property meta {Object}\n * @property customer {Object}\n * @property customizations {Object}\n * @property payment_plan {String}\n */\nclass AsyncPaymentOptions {\n public_key: string;\n tx_ref: string;\n amount: number;\n currency?: string;\n country?: string;\n authorization?: object | string;\n payment_options?: string;\n meta ?: any;\n customer?: object;\n customizations?: object;\n payment_plan?: string | number;\n subaccounts?: any;\n integrity_hash?: any;\n}\n\n\ndeclare function FlutterwaveCheckout(any)\n\n/**\n * Payment Response\n * @typedef {Object}\n * @property amount {String}\n * @property currency {Number}\n * @property customer {Object}\n * @property flw_ref {String}\n * @property status {String}\n * @property transaction_id {String}\n * @property tx_ref {String}\n * @property payment_plan {String}\n */\n class PaymentSuccessResponse {\n amount?: number;\n currency?: string;\n customer?: object;\n flw_ref?: string;\n status?: string;\n transaction_id?: number;\n tx_ref?: string;\n payment_plan?: string| number\n }\n\n\n export {\n InlinePaymentOptions,\n AsyncPaymentOptions,\n FlutterwaveCheckout,\n PaymentSuccessResponse\n }\n","import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core';\nimport {FlutterwaveCheckout, InlinePaymentOptions, PaymentSuccessResponse} from '../models';\n\n@Component({\n // tslint:disable-next-line:component-selector\n selector: 'flutterwave-make-payment',\n template: `\n \n {{text || 'Pay'}}\n \n `,\n styles: [`\n .flutterwave-pay-button{\n background-color: #f5a623;\n border-radius: 4px;\n border-color: #f5a623;\n -webkit-box-shadow: 0 2px 3px 0 #ccc;\n box-shadow: 0 2px 3px 0 #ccc;\n color: #fff;\n display: block;\n font-size: 12px;\n font-weight: 700;\n padding: 14px 22px;\n text-align: center;\n text-decoration: none;\n -webkit-transition: all .3s ease-in-out;\n transition: all .3s ease-in-out;\n\n }\n `]\n})\nexport class MakePaymentComponent implements OnInit {\n\n @Input() public_key: string;\n @Input() tx_ref: string;\n @Input() amount: number;\n @Input() currency: string;\n @Input() payment_options: string;\n @Input() payment_plan: string | number;\n @Input() subaccounts: any;\n @Input() integrity_hash: any;\n @Input() redirect_url: string;\n @Input() meta: object; // { counsumer_id, consumer_mac}\n @Input() customer: object; // {email, phone_number,name}\n @Output() callback: EventEmitter = new EventEmitter();\n @Output() close: EventEmitter = new EventEmitter();\n @Input() customizations: object; // {title, description, logo}\n @Input() text: string;\n @Input() style: any;\n @Input() className: string;\n @Input() data: InlinePaymentOptions;\n\n private inlinePaymentOptions: InlinePaymentOptions;\n\n customer_defaults = {\n email: '',\n phone_number: '',\n name: '',\n };\n meta_defaults = {\n consumer_id: '',\n consumer_mac: '',\n };\n customizations_defaults = {\n title: '',\n description: '',\n logo: '',\n };\n\n\n constructor() {\n }\n\n ngOnInit(): void {\n }\n\n makePayment() {\n\n this.prepareForPayment();\n FlutterwaveCheckout(this.inlinePaymentOptions);\n\n }\n\n prepareForPayment(): void {\n\n this.customer = this.customer || {};\n this.meta = this.meta || {};\n this.customizations = this.customizations || {};\n\n if ( this.data ) {\n this.inlinePaymentOptions = {\n ...this.data,\n callback: response => {\n this.data.callbackContext[this.data.callback.name](response)\n } ,\n onclose: () => {\n try {\n this.data.callbackContext[this.data.onclose.name]()\n } catch (e) {\n\n }\n\n } ,\n\n }\n } else {\n\n this.inlinePaymentOptions = {\n callbackContext: null,\n public_key: this.public_key,\n tx_ref: this.tx_ref,\n amount: this.amount,\n currency: this.currency || 'NGN',\n payment_options: this.payment_options || 'card, mobilemoney, ussd',\n redirect_url: this.redirect_url || '',\n meta: {...this.meta_defaults, ...this.meta},\n customer: {...this.customer_defaults, ...this.customer},\n callback: (response: PaymentSuccessResponse) => {\n this.callback.emit(response)\n },\n onclose: () => this.close.emit(),\n customizations: {...this.customizations_defaults\n , ...this.customizations}\n }\n if (this.payment_plan) {\n this.inlinePaymentOptions.payment_plan = this.payment_plan\n }\n if (this.subaccounts) {\n this.inlinePaymentOptions.subaccounts = this.subaccounts\n }\n if (this.integrity_hash) {\n this.inlinePaymentOptions.integrity_hash = this.integrity_hash\n }\n }\n\n\n }\n\n}\n","import { Injectable } from '@angular/core';\nimport {AsyncPaymentOptions, FlutterwaveCheckout, InlinePaymentOptions, PaymentSuccessResponse} from './models';\n\n@Injectable()\nexport class Flutterwave {\n\n constructor() { }\n\n inlinePay(paymentData: InlinePaymentOptions) {\n\n const data = {\n ...paymentData,\n callback: response => {\n paymentData.callbackContext[paymentData.callback.name](response)\n } ,\n onclose: () => {\n try {\n paymentData.callbackContext[paymentData.onclose.name]()\n } catch (e) {}\n }\n };\n\n FlutterwaveCheckout(data);\n\n }\n\n asyncInlinePay(paymentData: AsyncPaymentOptions): Promise {\n\n return new Promise((resolve, reject) => {\n\n paymentData = {\n ...paymentData,\n callback: ($event) => {\n resolve($event)\n } ,\n onclose: () => resolve('closed')\n };\n\n FlutterwaveCheckout(paymentData)\n\n })\n\n }\n\n\n /**\n *\n * @param waitDuration {Number} Seconds before closing payment modal\n */\n closePaymentModal(waitDuration: number = 0) {\n setTimeout(() => {\n document.getElementsByName('checkout')[0].setAttribute('style',\n 'position:fixed;top:0;left:0;z-index:-1;border:none;opacity:0;pointer-events:none;width:100%;height:100%;');\n document.body.style.overflow = '';\n // document.getElementsByName('checkout')[0].setAttribute('style', 'z-index: -1; opacity: 0')\n } , waitDuration * 1000 )\n }\n\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { MakePaymentComponent } from './make-payment/make-payment.component';\nimport {Flutterwave} from './flutterwave.service';\n\n@NgModule({\n imports: [\n CommonModule\n ],\n declarations: [MakePaymentComponent] ,\n providers: [Flutterwave],\n exports: [MakePaymentComponent]\n})\nexport class FlutterwaveModule {\n constructor() {\n\n const inlineSdk = 'https://checkout.flutterwave.com/v3.js';\n const script = document.createElement('script');\n script.src = inlineSdk;\n if (!document.querySelector(`[src=\"${inlineSdk}\"]`)) {\n document.body.appendChild(script)\n }\n\n\n }\n}\n"],"names":["InlinePaymentOptions","AsyncPaymentOptions","PaymentSuccessResponse","MakePaymentComponent","this","callback","EventEmitter","close","customer_defaults","email","phone_number","name","meta_defaults","consumer_id","consumer_mac","customizations_defaults","title","description","logo","prototype","ngOnInit","makePayment","prepareForPayment","FlutterwaveCheckout","inlinePaymentOptions","_this","customer","meta","customizations","data","Object","assign","response","callbackContext","onclose","e","public_key","tx_ref","amount","currency","payment_options","redirect_url","emit","payment_plan","subaccounts","integrity_hash","decorators","type","Component","args","selector","template","styles","ctorParameters","propDecorators","Input","Output","text","style","className","Flutterwave","inlinePay","paymentData","asyncInlinePay","Promise","resolve","reject","$event","closePaymentModal","waitDuration","setTimeout","document","getElementsByName","setAttribute","body","overflow","Injectable","FlutterwaveModule","inlineSdk","script","createElement","src","querySelector","appendChild","NgModule","imports","CommonModule","declarations","providers","exports"],"mappings":"4TAoBA,IAAAA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/modules/models.ts","~/flutterwave-angular-v3/src/app/modules/api-tracking.service.ts","~/flutterwave-angular-v3/src/app/modules/flutterwave.service.ts","~/flutterwave-angular-v3/src/app/modules/make-payment/make-payment.component.ts","~/flutterwave-angular-v3/src/app/modules/flutterwave.module.ts"],"sourcesContent":["\n\n/**\n * Payment data object\n * @typedef {Object}\n * @property public_key {String}\n * @property callbackContext {Object} The context of the\n * component or service that has the callback method.\n * The value must always be 'this'.\n * Using any other value might lead to error.\n * @property tx_ref {String}\n * @property amount {Number}\n * @property currency {String}\n * @property payment_options {String}\n * @property payment_plan {String}\n * @property redirect_url {String}\n * @property meta {Object}\n * @property customer {Object}\n * @property customizations {Object}\n * @property callback {Function}\n * @property onclose {Function}\n */\n class InlinePaymentOptions {\n public_key: string;\n callbackContext?: object;\n tx_ref: string;\n amount: number;\n currency?: string;\n country?: string;\n authorization?: object | string;\n payment_options?: string;\n payment_plan?: string | number;\n subaccounts?: any;\n integrity_hash?: any;\n redirect_url?: string;\n meta ?: any;\n customer?: object;\n customizations?: object;\n callback?: (response: object) => void;\n onclose?: () => void;\n}\n\n\n/**\n * Async Payment data object\n * @typedef {Object}\n * @property public_key {String}\n * @property tx_ref {String}\n * @property amount {Number}\n * @property currency {String}\n * @property payment_options {String}\n * @property meta {Object}\n * @property customer {Object}\n * @property customizations {Object}\n * @property payment_plan {String}\n */\nclass AsyncPaymentOptions {\n public_key: string;\n tx_ref: string;\n amount: number;\n currency?: string;\n country?: string;\n authorization?: object | string;\n payment_options?: string;\n meta ?: any;\n customer?: object;\n customizations?: object;\n payment_plan?: string | number;\n subaccounts?: any;\n integrity_hash?: any;\n}\n\n\ndeclare function FlutterwaveCheckout(any)\n\n/**\n * Payment Response\n * @typedef {Object}\n * @property amount {String}\n * @property currency {Number}\n * @property customer {Object}\n * @property flw_ref {String}\n * @property status {String}\n * @property transaction_id {String}\n * @property tx_ref {String}\n * @property payment_plan {String}\n */\n class PaymentSuccessResponse {\n amount?: number;\n currency?: string;\n customer?: object;\n flw_ref?: string;\n status?: string;\n transaction_id?: number;\n tx_ref?: string;\n payment_plan?: string| number\n }\n\n\n export {\n InlinePaymentOptions,\n AsyncPaymentOptions,\n FlutterwaveCheckout,\n PaymentSuccessResponse\n }\n","import {Injectable} from '@angular/core';\n\n\n@Injectable()\nexport class ApiTracking {\n\n trackingEndPoint = 'https://kgelfdz7mf.execute-api.us-east-1.amazonaws.com/staging/sendevent';\n\n packageVersion = '1.2.1';\n language = 'Angular V3'\n\n /* trackingFeatures = {\n\n 'initiateCardCharge': 'Initiate-Card-charge',\n 'initiateCardChargeError': 'Initiate-Card-charge-error',\n 'validateCardCharge': 'Validate-Card-charge',\n 'validateCardChargeError': 'Validate-Card-charge-error',\n 'verifyCardCharge': 'Verify-Card-charge',\n 'verifyCardChargeError': 'Verify-Card-charge-error',\n 'initiateAccountCharge': 'Initiate-Account-charge',\n 'initiateAccountChargeError': 'Initiate-Account-charge-error',\n 'accountChargeValidate': 'Account-charge-validate',\n 'accountChargeValidateError': 'Account-charge-validate-error',\n 'accountChargeVerify': 'Account-charge-verify',\n 'accountChargeVerifyError': 'Account-charge-verify-error',\n\n }*/\n\n constructor() {\n }\n\n track(data: {\n paymentData: object | any,\n response: object | any,\n responseTime: string\n }) {\n\n const trackingData = {\n publicKey: data.paymentData.public_key,\n language: this.language,\n version: this.packageVersion,\n title: '',\n message: '0' // data.responseTime\n\n }\n\n const paymentOptions = data.paymentData.payment_options || ''\n const paymentOptionsArray = paymentOptions ? paymentOptions.split(',') : []\n\n\n\n\n let title = ''\n\n if (paymentOptionsArray.length === 0) {\n title = 'Initiate-Charge-Dashboard'\n } else if (paymentOptionsArray.length === 1) {\n title = 'Initiate-Charge-' + paymentOptions\n\n } else {\n title = 'Initiate-Charge-Multiple'\n\n }\n\n trackingData.title = data.response.status === 'successful' ? title : title + '-error'\n\n this.submitTracking(trackingData)\n\n }\n\n\n submitTracking(data) {\n\n fetch(this.trackingEndPoint, {\n method: 'POST',\n body: JSON.stringify(data)\n }).then((res) => {\n })\n\n }\n\n\n}\n\n/*\n\ninterface tracking-data {\n merchantId: string,\n language: string\n}\n*/\n\n","import { Injectable } from '@angular/core';\nimport {AsyncPaymentOptions, FlutterwaveCheckout, InlinePaymentOptions, PaymentSuccessResponse} from './models';\nimport {ApiTracking} from './api-tracking.service';\n\n@Injectable()\nexport class Flutterwave {\n\n constructor(private tracker: ApiTracking) {\n }\n\n inlinePay(paymentData: InlinePaymentOptions) {\n\n const data = {\n ...paymentData,\n callback: response => {\n this.submitToTracker(paymentData , response, 10000)\n paymentData.callbackContext[paymentData.callback.name](response)\n } ,\n onclose: () => {\n try {\n paymentData.callbackContext[paymentData.onclose.name]()\n } catch (e) {}\n }\n };\n\n FlutterwaveCheckout(data);\n\n }\n\n asyncInlinePay(paymentData: AsyncPaymentOptions): Promise {\n\n return new Promise((resolve, reject) => {\n\n paymentData = {\n ...paymentData,\n callback: ($event) => {\n this.submitToTracker(paymentData , $event, 10000)\n resolve($event)\n } ,\n onclose: () => resolve('closed')\n };\n\n FlutterwaveCheckout(paymentData)\n\n })\n\n }\n\n\n submitToTracker(paymentData , response, responseTime) {\n\n\n this.tracker.track({\n paymentData,\n response,\n responseTime\n })\n\n\n }\n /**\n *\n * @param waitDuration {Number} Seconds before closing payment modal\n */\n closePaymentModal(waitDuration: number = 0) {\n setTimeout(() => {\n document.getElementsByName('checkout')[0].setAttribute('style',\n 'position:fixed;top:0;left:0;z-index:-1;border:none;opacity:0;pointer-events:none;width:100%;height:100%;');\n document.body.style.overflow = '';\n // document.getElementsByName('checkout')[0].setAttribute('style', 'z-index: -1; opacity: 0')\n } , waitDuration * 1000 )\n }\n\n}\n","import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core';\nimport {FlutterwaveCheckout, InlinePaymentOptions, PaymentSuccessResponse} from '../models';\nimport {Flutterwave} from '../flutterwave.service';\n\n@Component({\n // tslint:disable-next-line:component-selector\n selector: 'flutterwave-make-payment',\n template: `\n \n {{text || 'Pay'}}\n \n `,\n styles: [`\n .flutterwave-pay-button{\n background-color: #f5a623;\n border-radius: 4px;\n border-color: #f5a623;\n -webkit-box-shadow: 0 2px 3px 0 #ccc;\n box-shadow: 0 2px 3px 0 #ccc;\n color: #fff;\n display: block;\n font-size: 12px;\n font-weight: 700;\n padding: 14px 22px;\n text-align: center;\n text-decoration: none;\n -webkit-transition: all .3s ease-in-out;\n transition: all .3s ease-in-out;\n\n }\n `]\n})\nexport class MakePaymentComponent implements OnInit {\n\n @Input() public_key: string;\n @Input() tx_ref: string;\n @Input() amount: number;\n @Input() currency: string;\n @Input() payment_options: string;\n @Input() payment_plan: string | number;\n @Input() subaccounts: any;\n @Input() integrity_hash: any;\n @Input() redirect_url: string;\n @Input() meta: object; // { counsumer_id, consumer_mac}\n @Input() customer: object; // {email, phone_number,name}\n @Output() callback: EventEmitter = new EventEmitter();\n @Output() close: EventEmitter = new EventEmitter();\n @Input() customizations: object; // {title, description, logo}\n @Input() text: string;\n @Input() style: any;\n @Input() className: string;\n @Input() data: InlinePaymentOptions;\n\n private inlinePaymentOptions: InlinePaymentOptions;\n\n customer_defaults = {\n email: '',\n phone_number: '',\n name: '',\n };\n meta_defaults = {\n consumer_id: '',\n consumer_mac: '',\n };\n customizations_defaults = {\n title: '',\n description: '',\n logo: '',\n };\n\n\n constructor(private flutterwave: Flutterwave) {\n }\n\n ngOnInit(): void {\n }\n\n makePayment() {\n\n this.prepareForPayment();\n FlutterwaveCheckout(this.inlinePaymentOptions);\n\n }\n\n prepareForPayment(): void {\n\n this.customer = this.customer || {};\n this.meta = this.meta || {};\n this.customizations = this.customizations || {};\n\n if ( this.data ) {\n this.inlinePaymentOptions = {\n ...this.data,\n callback: response => {\n this.flutterwave.submitToTracker(this.data , response, 10000)\n this.data.callbackContext[this.data.callback.name](response)\n } ,\n onclose: () => {\n try {\n this.data.callbackContext[this.data.onclose.name]()\n } catch (e) {\n\n }\n\n } ,\n\n }\n } else {\n\n this.inlinePaymentOptions = {\n callbackContext: null,\n public_key: this.public_key,\n tx_ref: this.tx_ref,\n amount: this.amount,\n currency: this.currency || 'NGN',\n payment_options: this.payment_options || 'card, mobilemoney, ussd',\n redirect_url: this.redirect_url || '',\n meta: {...this.meta_defaults, ...this.meta},\n customer: {...this.customer_defaults, ...this.customer},\n callback: (response: PaymentSuccessResponse) => {\n this.flutterwave.submitToTracker(this.inlinePaymentOptions , response, 10000)\n this.callback.emit(response)\n },\n onclose: () => this.close.emit(),\n customizations: {...this.customizations_defaults\n , ...this.customizations}\n }\n if (this.payment_plan) {\n this.inlinePaymentOptions.payment_plan = this.payment_plan\n }\n if (this.subaccounts) {\n this.inlinePaymentOptions.subaccounts = this.subaccounts\n }\n if (this.integrity_hash) {\n this.inlinePaymentOptions.integrity_hash = this.integrity_hash\n }\n }\n\n\n }\n\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { MakePaymentComponent } from './make-payment/make-payment.component';\nimport {Flutterwave} from './flutterwave.service';\nimport {ApiTracking} from './api-tracking.service';\n\n@NgModule({\n imports: [\n CommonModule,\n ],\n declarations: [MakePaymentComponent] ,\n providers: [Flutterwave, ApiTracking],\n exports: [MakePaymentComponent]\n})\nexport class FlutterwaveModule {\n constructor() {\n\n const inlineSdk = 'https://checkout.flutterwave.com/v3.js';\n const script = document.createElement('script');\n script.src = inlineSdk;\n if (!document.querySelector(`[src=\"${inlineSdk}\"]`)) {\n document.body.appendChild(script)\n }\n\n\n }\n}\n"],"names":["InlinePaymentOptions","AsyncPaymentOptions","PaymentSuccessResponse","ApiTracking","this","trackingEndPoint","packageVersion","language","prototype","track","data","trackingData","publicKey","paymentData","public_key","version","title","message","paymentOptions","payment_options","paymentOptionsArray","split","length","response","status","submitTracking","fetch","method","body","JSON","stringify","then","res","decorators","type","Injectable","ctorParameters","Flutterwave","tracker","inlinePay","_this","Object","assign","callback","submitToTracker","callbackContext","name","onclose","e","FlutterwaveCheckout","asyncInlinePay","Promise","resolve","reject","$event","responseTime","closePaymentModal","waitDuration","setTimeout","document","getElementsByName","setAttribute","style","overflow","MakePaymentComponent","flutterwave","EventEmitter","close","customer_defaults","email","phone_number","meta_defaults","consumer_id","consumer_mac","customizations_defaults","description","logo","ngOnInit","makePayment","prepareForPayment","inlinePaymentOptions","customer","meta","customizations","tx_ref","amount","currency","redirect_url","emit","payment_plan","subaccounts","integrity_hash","Component","args","selector","template","styles","propDecorators","Input","Output","text","className","FlutterwaveModule","inlineSdk","script","createElement","src","querySelector","appendChild","NgModule","imports","CommonModule","declarations","providers","exports"],"mappings":"4TAoBA,IAAAA,EAAA,SAAAA,MAqEAC,EAAA,SAAAA,MA2DAC,EAAA,SAAAA,MCnJAC,EAAA,WAMA,SAAAA,IAJEC,KAAFC,iBAGqB,2EADnBD,KAAFE,eAGmB,QAFjBF,KAAFG,SAGa,oBAIbJ,EAAAK,UAAAC,MAAA,SAkBGC,GAZC,IAkBMC,EAAe,CAjBnBC,UAkBWF,EAAKG,YAAYC,WAjB5BP,SAkBUH,KAAKG,SAjBfQ,QAkBSX,KAAKE,eAjBdU,MAkBO,GAjBPC,QAkBS,KAILC,EAAiBR,EAAKG,YAAYM,iBAAmB,GACrDC,EAAsBF,EAAiBA,EAAgBG,MAAM,KAAO,GAKtEL,EAAQ,GAfVA,EAiBiC,IAlB/BI,EAkBoBE,OACd,4BACgC,IAAnCF,EAAwBE,OACrB,mBAAqBJ,EAGrB,2BAdVP,EAkBaK,MAAiC,eAAzBN,EAAKa,SAASC,OAA0BR,EAAQA,EAAQ,SAhB7EZ,KAkBKqB,eAAed,IAXxBR,EAAAK,UAAAiB,eAAA,SAgBGf,GAdCgB,MAgBMtB,KAAKC,iBAAkB,CAf3BsB,OAgBQ,OAfRC,KAgBMC,KAAKC,UAAUpB,KACpBqB,KAAK,SAACC,SA3Eb,GAiFO7B,EAAP8B,WAA2C,CAf3C,CAgBEC,KAAMC,EAAAA,aAGPhC,EAADiC,eAAC,WAAA,MAAA,ICnFD,IAAAC,EAAA,WAIA,SAAAA,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,EAAAA,QAOtBxF,KANQ,CAAA,CAAGwB,KAAMgE,EAAAA,SCpKjB,IAAAI,EACA,SAAAA,IAEM,IAAMC,EAAY,yCACZC,EAAS7C,SAAS8C,cAAc,UACtCD,EAAOE,IAAMH,EACR5C,SAASgD,cAAc,SAASJ,EAA3C,OACQ5C,SAAS/B,KAAKgF,YAAYJ,IAO3BF,EAAPrE,WAA2C,CAD3C,CAEEC,KAAM2E,EAAAA,SAAUhB,KAAM,CAAA,CADtBiB,QAES,CADPC,EAAAA,cAEFC,aAEc,CAAAhD,GADdiD,UAEW,CAAA5E,EAAclC,GADzB+G,QAES,CAAAlD,OAIVsC,EAADlE,eAAC,WAAA,MAAA"} diff --git a/dist/flutterwave-angular-v3-1.1.9.tgz b/dist/flutterwave-angular-v3-1.1.9.tgz deleted file mode 100644 index 7241d72..0000000 Binary files a/dist/flutterwave-angular-v3-1.1.9.tgz and /dev/null differ diff --git a/dist/flutterwave-angular-v3.d.ts b/dist/flutterwave-angular-v3.d.ts index 7417cc8..93542c4 100644 --- a/dist/flutterwave-angular-v3.d.ts +++ b/dist/flutterwave-angular-v3.d.ts @@ -2,3 +2,4 @@ * Generated bundle index. Do not edit. */ export * from './public_api'; +export { ApiTracking as ɵa } from './src/app/modules/api-tracking.service'; diff --git a/dist/flutterwave-angular-v3.es5.js b/dist/flutterwave-angular-v3.es5.js index 690f617..baf981a 100644 --- a/dist/flutterwave-angular-v3.es5.js +++ b/dist/flutterwave-angular-v3.es5.js @@ -57,8 +57,140 @@ var PaymentSuccessResponse = (function () { } return PaymentSuccessResponse; }()); +var ApiTracking = (function () { + function ApiTracking() { + this.trackingEndPoint = 'https://kgelfdz7mf.execute-api.us-east-1.amazonaws.com/staging/sendevent'; + this.packageVersion = '1.2.1'; + this.language = 'Angular V3'; + } + /** + * @param {?} data + * @return {?} + */ + ApiTracking.prototype.track = function (data) { + var /** @type {?} */ trackingData = { + publicKey: data.paymentData.public_key, + language: this.language, + version: this.packageVersion, + title: '', + message: '0' // data.responseTime + }; + var /** @type {?} */ paymentOptions = data.paymentData.payment_options || ''; + var /** @type {?} */ paymentOptionsArray = paymentOptions ? paymentOptions.split(',') : []; + var /** @type {?} */ title = ''; + if (paymentOptionsArray.length === 0) { + title = 'Initiate-Charge-Dashboard'; + } + else if (paymentOptionsArray.length === 1) { + title = 'Initiate-Charge-' + paymentOptions; + } + else { + title = 'Initiate-Charge-Multiple'; + } + trackingData.title = data.response.status === 'successful' ? title : title + '-error'; + this.submitTracking(trackingData); + }; + /** + * @param {?} data + * @return {?} + */ + ApiTracking.prototype.submitTracking = function (data) { + fetch(this.trackingEndPoint, { + method: 'POST', + body: JSON.stringify(data) + }).then(function (res) { + }); + }; + return ApiTracking; +}()); +ApiTracking.decorators = [ + { type: Injectable }, +]; +/** + * @nocollapse + */ +ApiTracking.ctorParameters = function () { return []; }; +var Flutterwave = (function () { + /** + * @param {?} tracker + */ + function Flutterwave(tracker) { + this.tracker = tracker; + } + /** + * @param {?} paymentData + * @return {?} + */ + Flutterwave.prototype.inlinePay = function (paymentData) { + var _this = this; + var /** @type {?} */ data = Object.assign({}, paymentData, { callback: function (response) { + _this.submitToTracker(paymentData, response, 10000); + paymentData.callbackContext[paymentData.callback.name](response); + }, onclose: function () { + try { + paymentData.callbackContext[paymentData.onclose.name](); + } + catch (e) { } + } }); + FlutterwaveCheckout(data); + }; + /** + * @param {?} paymentData + * @return {?} + */ + Flutterwave.prototype.asyncInlinePay = function (paymentData) { + var _this = this; + return new Promise(function (resolve, reject) { + paymentData = Object.assign({}, paymentData, { callback: function ($event) { + _this.submitToTracker(paymentData, $event, 10000); + resolve($event); + }, onclose: function () { return resolve('closed'); } }); + FlutterwaveCheckout(paymentData); + }); + }; + /** + * @param {?} paymentData + * @param {?} response + * @param {?} responseTime + * @return {?} + */ + Flutterwave.prototype.submitToTracker = function (paymentData, response, responseTime) { + this.tracker.track({ + paymentData: paymentData, + response: response, + responseTime: responseTime + }); + }; + /** + * + * @param {?=} waitDuration {Number} Seconds before closing payment modal + * @return {?} + */ + Flutterwave.prototype.closePaymentModal = function (waitDuration) { + if (waitDuration === void 0) { waitDuration = 0; } + setTimeout(function () { + document.getElementsByName('checkout')[0].setAttribute('style', 'position:fixed;top:0;left:0;z-index:-1;border:none;opacity:0;pointer-events:none;width:100%;height:100%;'); + document.body.style.overflow = ''; + // document.getElementsByName('checkout')[0].setAttribute('style', 'z-index: -1; opacity: 0') + }, waitDuration * 1000); + }; + return Flutterwave; +}()); +Flutterwave.decorators = [ + { type: Injectable }, +]; +/** + * @nocollapse + */ +Flutterwave.ctorParameters = function () { return [ + { type: ApiTracking, }, +]; }; var MakePaymentComponent = (function () { - function MakePaymentComponent() { + /** + * @param {?} flutterwave + */ + function MakePaymentComponent(flutterwave) { + this.flutterwave = flutterwave; this.callback = new EventEmitter(); this.close = new EventEmitter(); this.customer_defaults = { @@ -98,6 +230,7 @@ var MakePaymentComponent = (function () { this.customizations = this.customizations || {}; if (this.data) { this.inlinePaymentOptions = Object.assign({}, this.data, { callback: function (response) { + _this.flutterwave.submitToTracker(_this.data, response, 10000); _this.data.callbackContext[_this.data.callback.name](response); }, onclose: function () { try { @@ -119,6 +252,7 @@ var MakePaymentComponent = (function () { meta: Object.assign({}, this.meta_defaults, this.meta), customer: Object.assign({}, this.customer_defaults, this.customer), callback: function (response) { + _this.flutterwave.submitToTracker(_this.inlinePaymentOptions, response, 10000); _this.callback.emit(response); }, onclose: function () { return _this.close.emit(); }, @@ -148,7 +282,9 @@ MakePaymentComponent.decorators = [ /** * @nocollapse */ -MakePaymentComponent.ctorParameters = function () { return []; }; +MakePaymentComponent.ctorParameters = function () { return [ + { type: Flutterwave, }, +]; }; MakePaymentComponent.propDecorators = { 'public_key': [{ type: Input },], 'tx_ref': [{ type: Input },], @@ -169,58 +305,6 @@ MakePaymentComponent.propDecorators = { 'className': [{ type: Input },], 'data': [{ type: Input },], }; -var Flutterwave = (function () { - function Flutterwave() { - } - /** - * @param {?} paymentData - * @return {?} - */ - Flutterwave.prototype.inlinePay = function (paymentData) { - var /** @type {?} */ data = Object.assign({}, paymentData, { callback: function (response) { - paymentData.callbackContext[paymentData.callback.name](response); - }, onclose: function () { - try { - paymentData.callbackContext[paymentData.onclose.name](); - } - catch (e) { } - } }); - FlutterwaveCheckout(data); - }; - /** - * @param {?} paymentData - * @return {?} - */ - Flutterwave.prototype.asyncInlinePay = function (paymentData) { - return new Promise(function (resolve, reject) { - paymentData = Object.assign({}, paymentData, { callback: function ($event) { - resolve($event); - }, onclose: function () { return resolve('closed'); } }); - FlutterwaveCheckout(paymentData); - }); - }; - /** - * - * @param {?=} waitDuration {Number} Seconds before closing payment modal - * @return {?} - */ - Flutterwave.prototype.closePaymentModal = function (waitDuration) { - if (waitDuration === void 0) { waitDuration = 0; } - setTimeout(function () { - document.getElementsByName('checkout')[0].setAttribute('style', 'position:fixed;top:0;left:0;z-index:-1;border:none;opacity:0;pointer-events:none;width:100%;height:100%;'); - document.body.style.overflow = ''; - // document.getElementsByName('checkout')[0].setAttribute('style', 'z-index: -1; opacity: 0') - }, waitDuration * 1000); - }; - return Flutterwave; -}()); -Flutterwave.decorators = [ - { type: Injectable }, -]; -/** - * @nocollapse - */ -Flutterwave.ctorParameters = function () { return []; }; var FlutterwaveModule = (function () { function FlutterwaveModule() { var inlineSdk = 'https://checkout.flutterwave.com/v3.js'; @@ -235,10 +319,10 @@ var FlutterwaveModule = (function () { FlutterwaveModule.decorators = [ { type: NgModule, args: [{ imports: [ - CommonModule + CommonModule, ], declarations: [MakePaymentComponent], - providers: [Flutterwave], + providers: [Flutterwave, ApiTracking], exports: [MakePaymentComponent] },] }, ]; @@ -249,5 +333,5 @@ FlutterwaveModule.ctorParameters = function () { return []; }; /** * Generated bundle index. Do not edit. */ -export { FlutterwaveModule, Flutterwave, InlinePaymentOptions, PaymentSuccessResponse, AsyncPaymentOptions, MakePaymentComponent }; +export { FlutterwaveModule, Flutterwave, InlinePaymentOptions, PaymentSuccessResponse, AsyncPaymentOptions, MakePaymentComponent, ApiTracking as ɵa }; //# sourceMappingURL=flutterwave-angular-v3.es5.js.map diff --git a/dist/flutterwave-angular-v3.es5.js.map b/dist/flutterwave-angular-v3.es5.js.map index 453eaa5..1810b67 100644 --- a/dist/flutterwave-angular-v3.es5.js.map +++ b/dist/flutterwave-angular-v3.es5.js.map @@ -1 +1 @@ -{"version":3,"file":"flutterwave-angular-v3.es5.js","sources":["ts/flutterwave-angular-v3.ts","ts/src/app/modules/flutterwave.module.ts","ts/src/app/modules/flutterwave.service.ts","ts/src/app/modules/make-payment/make-payment.component.ts","ts/src/app/modules/models.ts"],"sourcesContent":["/**\n * Generated bundle index. Do not edit.\n */\n\nexport {FlutterwaveModule,Flutterwave,InlinePaymentOptions,PaymentSuccessResponse,AsyncPaymentOptions,MakePaymentComponent} from './public_api';\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { MakePaymentComponent } from './make-payment/make-payment.component';\nimport {Flutterwave} from './flutterwave.service';\nexport class FlutterwaveModule {\nconstructor() {\n\n const inlineSdk = 'https://checkout.flutterwave.com/v3.js';\n const script = document.createElement('script');\n script.src = inlineSdk;\n if (!document.querySelector(`[src=\"${inlineSdk}\"]`)) {\n document.body.appendChild(script)\n }\n\n\n }\nstatic decorators: DecoratorInvocation[] = [\n{ type: NgModule, args: [{\n imports: [\n CommonModule\n ],\n declarations: [MakePaymentComponent] ,\n providers: [Flutterwave],\n exports: [MakePaymentComponent]\n}, ] },\n];\n/**\n * @nocollapse\n */\nstatic ctorParameters: () => ({type: any, decorators?: DecoratorInvocation[]}|null)[] = () => [\n];\n}\n\nfunction FlutterwaveModule_tsickle_Closure_declarations() {\n/** @type {?} */\nFlutterwaveModule.decorators;\n/**\n * @nocollapse\n * @type {?}\n */\nFlutterwaveModule.ctorParameters;\n}\n\n\ninterface DecoratorInvocation {\n type: Function;\n args?: any[];\n}\n","import { Injectable } from '@angular/core';\nimport {AsyncPaymentOptions, FlutterwaveCheckout, InlinePaymentOptions, PaymentSuccessResponse} from './models';\nexport class Flutterwave {\nconstructor() { }\n/**\n * @param {?} paymentData\n * @return {?}\n */\ninlinePay(paymentData: InlinePaymentOptions) {\n\n const /** @type {?} */ data = {\n ...paymentData,\n callback: response => {\n paymentData.callbackContext[paymentData.callback.name](response)\n } ,\n onclose: () => {\n try {\n paymentData.callbackContext[paymentData.onclose.name]()\n } catch ( /** @type {?} */e) {}\n }\n };\n\n FlutterwaveCheckout(data);\n\n }\n/**\n * @param {?} paymentData\n * @return {?}\n */\nasyncInlinePay(paymentData: AsyncPaymentOptions): Promise {\n\n return new Promise((resolve, reject) => {\n\n paymentData = {\n ...paymentData,\n callback: ($event) => {\n resolve($event)\n } ,\n onclose: () => resolve('closed')\n };\n\n FlutterwaveCheckout(paymentData)\n\n })\n\n }\n/**\n *\n * @param {?=} waitDuration {Number} Seconds before closing payment modal\n * @return {?}\n */\nclosePaymentModal(waitDuration: number = 0) {\n setTimeout(() => {\n document.getElementsByName('checkout')[0].setAttribute('style',\n 'position:fixed;top:0;left:0;z-index:-1;border:none;opacity:0;pointer-events:none;width:100%;height:100%;');\n document.body.style.overflow = '';\n // document.getElementsByName('checkout')[0].setAttribute('style', 'z-index: -1; opacity: 0')\n } , waitDuration * 1000 )\n }\n\nstatic decorators: DecoratorInvocation[] = [\n{ type: Injectable },\n];\n/**\n * @nocollapse\n */\nstatic ctorParameters: () => ({type: any, decorators?: DecoratorInvocation[]}|null)[] = () => [\n];\n}\n\nfunction Flutterwave_tsickle_Closure_declarations() {\n/** @type {?} */\nFlutterwave.decorators;\n/**\n * @nocollapse\n * @type {?}\n */\nFlutterwave.ctorParameters;\n}\n\n\ninterface DecoratorInvocation {\n type: Function;\n args?: any[];\n}\n","import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core';\nimport {FlutterwaveCheckout, InlinePaymentOptions, PaymentSuccessResponse} from '../models';\nexport class MakePaymentComponent implements OnInit {\n\n public_key: string;\n tx_ref: string;\n amount: number;\n currency: string;\n payment_options: string;\n payment_plan: string | number;\n subaccounts: any;\n integrity_hash: any;\n redirect_url: string;\n meta: object; // { counsumer_id, consumer_mac}\n customer: object; // {email, phone_number,name}\n callback: EventEmitter = new EventEmitter();\n close: EventEmitter = new EventEmitter();\n customizations: object; // {title, description, logo}\n text: string;\n style: any;\n className: string;\n data: InlinePaymentOptions;\nprivate inlinePaymentOptions: InlinePaymentOptions;\n\n customer_defaults = {\n email: '',\n phone_number: '',\n name: '',\n };\n meta_defaults = {\n consumer_id: '',\n consumer_mac: '',\n };\n customizations_defaults = {\n title: '',\n description: '',\n logo: '',\n };\nconstructor() {\n }\n/**\n * @return {?}\n */\nngOnInit(): void {\n }\n/**\n * @return {?}\n */\nmakePayment() {\n\n this.prepareForPayment();\n FlutterwaveCheckout(this.inlinePaymentOptions);\n\n }\n/**\n * @return {?}\n */\nprepareForPayment(): void {\n\n this.customer = this.customer || {};\n this.meta = this.meta || {};\n this.customizations = this.customizations || {};\n\n if ( this.data ) {\n this.inlinePaymentOptions = {\n ...this.data,\n callback: response => {\n this.data.callbackContext[this.data.callback.name](response)\n } ,\n onclose: () => {\n try {\n this.data.callbackContext[this.data.onclose.name]()\n } catch ( /** @type {?} */e) {\n\n }\n\n } ,\n\n }\n } else {\n\n this.inlinePaymentOptions = {\n callbackContext: null,\n public_key: this.public_key,\n tx_ref: this.tx_ref,\n amount: this.amount,\n currency: this.currency || 'NGN',\n payment_options: this.payment_options || 'card, mobilemoney, ussd',\n redirect_url: this.redirect_url || '',\n meta: {...this.meta_defaults, ...this.meta},\n customer: {...this.customer_defaults, ...this.customer},\n callback: (response: PaymentSuccessResponse) => {\n this.callback.emit(response)\n },\n onclose: () => this.close.emit(),\n customizations: {...this.customizations_defaults\n , ...this.customizations}\n }\n if (this.payment_plan) {\n this.inlinePaymentOptions.payment_plan = this.payment_plan\n }\n if (this.subaccounts) {\n this.inlinePaymentOptions.subaccounts = this.subaccounts\n }\n if (this.integrity_hash) {\n this.inlinePaymentOptions.integrity_hash = this.integrity_hash\n }\n }\n\n\n }\n\nstatic decorators: DecoratorInvocation[] = [\n{ type: Component, args: [{\n // tslint:disable-next-line:component-selector\n selector: 'flutterwave-make-payment',\n template: `\n \n {{text || 'Pay'}}\n \n `,\n styles: [`\n .flutterwave-pay-button{\n background-color: #f5a623;\n border-radius: 4px;\n border-color: #f5a623;\n -webkit-box-shadow: 0 2px 3px 0 #ccc;\n box-shadow: 0 2px 3px 0 #ccc;\n color: #fff;\n display: block;\n font-size: 12px;\n font-weight: 700;\n padding: 14px 22px;\n text-align: center;\n text-decoration: none;\n -webkit-transition: all .3s ease-in-out;\n transition: all .3s ease-in-out;\n\n }\n `]\n}, ] },\n];\n/**\n * @nocollapse\n */\nstatic ctorParameters: () => ({type: any, decorators?: DecoratorInvocation[]}|null)[] = () => [\n];\nstatic propDecorators: {[key: string]: DecoratorInvocation[]} = {\n'public_key': [{ type: Input },],\n'tx_ref': [{ type: Input },],\n'amount': [{ type: Input },],\n'currency': [{ type: Input },],\n'payment_options': [{ type: Input },],\n'payment_plan': [{ type: Input },],\n'subaccounts': [{ type: Input },],\n'integrity_hash': [{ type: Input },],\n'redirect_url': [{ type: Input },],\n'meta': [{ type: Input },],\n'customer': [{ type: Input },],\n'callback': [{ type: Output },],\n'close': [{ type: Output },],\n'customizations': [{ type: Input },],\n'text': [{ type: Input },],\n'style': [{ type: Input },],\n'className': [{ type: Input },],\n'data': [{ type: Input },],\n};\n}\n\nfunction MakePaymentComponent_tsickle_Closure_declarations() {\n/** @type {?} */\nMakePaymentComponent.decorators;\n/**\n * @nocollapse\n * @type {?}\n */\nMakePaymentComponent.ctorParameters;\n/** @type {?} */\nMakePaymentComponent.propDecorators;\n/** @type {?} */\nMakePaymentComponent.prototype.public_key;\n/** @type {?} */\nMakePaymentComponent.prototype.tx_ref;\n/** @type {?} */\nMakePaymentComponent.prototype.amount;\n/** @type {?} */\nMakePaymentComponent.prototype.currency;\n/** @type {?} */\nMakePaymentComponent.prototype.payment_options;\n/** @type {?} */\nMakePaymentComponent.prototype.payment_plan;\n/** @type {?} */\nMakePaymentComponent.prototype.subaccounts;\n/** @type {?} */\nMakePaymentComponent.prototype.integrity_hash;\n/** @type {?} */\nMakePaymentComponent.prototype.redirect_url;\n/** @type {?} */\nMakePaymentComponent.prototype.meta;\n/** @type {?} */\nMakePaymentComponent.prototype.customer;\n/** @type {?} */\nMakePaymentComponent.prototype.callback;\n/** @type {?} */\nMakePaymentComponent.prototype.close;\n/** @type {?} */\nMakePaymentComponent.prototype.customizations;\n/** @type {?} */\nMakePaymentComponent.prototype.text;\n/** @type {?} */\nMakePaymentComponent.prototype.style;\n/** @type {?} */\nMakePaymentComponent.prototype.className;\n/** @type {?} */\nMakePaymentComponent.prototype.data;\n/** @type {?} */\nMakePaymentComponent.prototype.inlinePaymentOptions;\n/** @type {?} */\nMakePaymentComponent.prototype.customer_defaults;\n/** @type {?} */\nMakePaymentComponent.prototype.meta_defaults;\n/** @type {?} */\nMakePaymentComponent.prototype.customizations_defaults;\n}\n\n\ninterface DecoratorInvocation {\n type: Function;\n args?: any[];\n}\n","\n/**\n * Payment data object\n * \\@property public_key {String}\n * \\@property callbackContext {Object} The context of the\n * component or service that has the callback method.\n * The value must always be 'this'.\n * Using any other value might lead to error.\n * \\@property tx_ref {String}\n * \\@property amount {Number}\n * \\@property currency {String}\n * \\@property payment_options {String}\n * \\@property payment_plan {String}\n * \\@property redirect_url {String}\n * \\@property meta {Object}\n * \\@property customer {Object}\n * \\@property customizations {Object}\n * \\@property callback {Function}\n * \\@property onclose {Function}\n */\nclass InlinePaymentOptions {\n public_key: string;\n callbackContext?: object;\n tx_ref: string;\n amount: number;\n currency?: string;\n country?: string;\n authorization?: object | string;\n payment_options?: string;\n payment_plan?: string | number;\n subaccounts?: any;\n integrity_hash?: any;\n redirect_url?: string;\n meta ?: any;\n customer?: object;\n customizations?: object;\n callback?: (response: object) => void;\n onclose?: () => void;\n}\n\nfunction InlinePaymentOptions_tsickle_Closure_declarations() {\n/** @type {?} */\nInlinePaymentOptions.prototype.public_key;\n/** @type {?} */\nInlinePaymentOptions.prototype.callbackContext;\n/** @type {?} */\nInlinePaymentOptions.prototype.tx_ref;\n/** @type {?} */\nInlinePaymentOptions.prototype.amount;\n/** @type {?} */\nInlinePaymentOptions.prototype.currency;\n/** @type {?} */\nInlinePaymentOptions.prototype.country;\n/** @type {?} */\nInlinePaymentOptions.prototype.authorization;\n/** @type {?} */\nInlinePaymentOptions.prototype.payment_options;\n/** @type {?} */\nInlinePaymentOptions.prototype.payment_plan;\n/** @type {?} */\nInlinePaymentOptions.prototype.subaccounts;\n/** @type {?} */\nInlinePaymentOptions.prototype.integrity_hash;\n/** @type {?} */\nInlinePaymentOptions.prototype.redirect_url;\n/** @type {?} */\nInlinePaymentOptions.prototype.meta;\n/** @type {?} */\nInlinePaymentOptions.prototype.customer;\n/** @type {?} */\nInlinePaymentOptions.prototype.customizations;\n/** @type {?} */\nInlinePaymentOptions.prototype.callback;\n/** @type {?} */\nInlinePaymentOptions.prototype.onclose;\n}\n\n/**\n * Async Payment data object\n * \\@property public_key {String}\n * \\@property tx_ref {String}\n * \\@property amount {Number}\n * \\@property currency {String}\n * \\@property payment_options {String}\n * \\@property meta {Object}\n * \\@property customer {Object}\n * \\@property customizations {Object}\n * \\@property payment_plan {String}\n */\nclass AsyncPaymentOptions {\n public_key: string;\n tx_ref: string;\n amount: number;\n currency?: string;\n country?: string;\n authorization?: object | string;\n payment_options?: string;\n meta ?: any;\n customer?: object;\n customizations?: object;\n payment_plan?: string | number;\n subaccounts?: any;\n integrity_hash?: any;\n}\n\nfunction AsyncPaymentOptions_tsickle_Closure_declarations() {\n/** @type {?} */\nAsyncPaymentOptions.prototype.public_key;\n/** @type {?} */\nAsyncPaymentOptions.prototype.tx_ref;\n/** @type {?} */\nAsyncPaymentOptions.prototype.amount;\n/** @type {?} */\nAsyncPaymentOptions.prototype.currency;\n/** @type {?} */\nAsyncPaymentOptions.prototype.country;\n/** @type {?} */\nAsyncPaymentOptions.prototype.authorization;\n/** @type {?} */\nAsyncPaymentOptions.prototype.payment_options;\n/** @type {?} */\nAsyncPaymentOptions.prototype.meta;\n/** @type {?} */\nAsyncPaymentOptions.prototype.customer;\n/** @type {?} */\nAsyncPaymentOptions.prototype.customizations;\n/** @type {?} */\nAsyncPaymentOptions.prototype.payment_plan;\n/** @type {?} */\nAsyncPaymentOptions.prototype.subaccounts;\n/** @type {?} */\nAsyncPaymentOptions.prototype.integrity_hash;\n}\n\n\n\ndeclare function FlutterwaveCheckout(any)\n/**\n * Payment Response\n * \\@property amount {String}\n * \\@property currency {Number}\n * \\@property customer {Object}\n * \\@property flw_ref {String}\n * \\@property status {String}\n * \\@property transaction_id {String}\n * \\@property tx_ref {String}\n * \\@property payment_plan {String}\n */\nclass PaymentSuccessResponse {\n amount?: number;\n currency?: string;\n customer?: object;\n flw_ref?: string;\n status?: string;\n transaction_id?: number;\n tx_ref?: string;\n payment_plan?: string| number\n }\n\nfunction PaymentSuccessResponse_tsickle_Closure_declarations() {\n/** @type {?} */\nPaymentSuccessResponse.prototype.amount;\n/** @type {?} */\nPaymentSuccessResponse.prototype.currency;\n/** @type {?} */\nPaymentSuccessResponse.prototype.customer;\n/** @type {?} */\nPaymentSuccessResponse.prototype.flw_ref;\n/** @type {?} */\nPaymentSuccessResponse.prototype.status;\n/** @type {?} */\nPaymentSuccessResponse.prototype.transaction_id;\n/** @type {?} */\nPaymentSuccessResponse.prototype.tx_ref;\n/** @type {?} */\nPaymentSuccessResponse.prototype.payment_plan;\n}\n\n\n\n export {\n InlinePaymentOptions,\n AsyncPaymentOptions,\n FlutterwaveCheckout,\n PaymentSuccessResponse\n };\n"],"names":[],"mappings":";;AICA;;;;;;;;;;;;;;;;;;;AAmBA;IAAA;IAkBA,CAAC;IAAD,2BAAC;AAAD,CAAC,AAlBD,IAkBC;AAED;;;;;;;;;;;;AAiDA;IAAA;IAcA,CAAC;IAAD,0BAAC;AAAD,CAAC,AAdD,IAcC;AAED;;;;;;;;;;;AA2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AAO,EAEE;oBADP,YAAY;iBACb;gBACD,YAAY,EAEE,CAAA,oBAAE,CAAoB;gBADpC,SAAS,EAEE,CAAA,WAAE,CAAW;gBADxB,OAAO,EAEE,CAAA,oBAAE,CAAoB;aADhC,EAEC,EAAG;CADJ,CAEC;;;;AAED,iBAAD,CAAA,cAAC,GAAA,cAAA,OAAA,EACA,EADA,CACA,CAAC;AD9BF;;GAEG;"} +{"version":3,"file":"flutterwave-angular-v3.es5.js","sources":["ts/flutterwave-angular-v3.ts","ts/src/app/modules/flutterwave.module.ts","ts/src/app/modules/make-payment/make-payment.component.ts","ts/src/app/modules/flutterwave.service.ts","ts/src/app/modules/api-tracking.service.ts","ts/src/app/modules/models.ts"],"sourcesContent":["/**\n * Generated bundle index. Do not edit.\n */\n\nexport {FlutterwaveModule,Flutterwave,InlinePaymentOptions,PaymentSuccessResponse,AsyncPaymentOptions,MakePaymentComponent} from './public_api';\n\nexport {ApiTracking as ɵa} from './src/app/modules/api-tracking.service';","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { MakePaymentComponent } from './make-payment/make-payment.component';\nimport {Flutterwave} from './flutterwave.service';\nimport {ApiTracking} from './api-tracking.service';\nexport class FlutterwaveModule {\nconstructor() {\n\n const inlineSdk = 'https://checkout.flutterwave.com/v3.js';\n const script = document.createElement('script');\n script.src = inlineSdk;\n if (!document.querySelector(`[src=\"${inlineSdk}\"]`)) {\n document.body.appendChild(script)\n }\n\n\n }\nstatic decorators: DecoratorInvocation[] = [\n{ type: NgModule, args: [{\n imports: [\n CommonModule,\n ],\n declarations: [MakePaymentComponent] ,\n providers: [Flutterwave, ApiTracking],\n exports: [MakePaymentComponent]\n}, ] },\n];\n/**\n * @nocollapse\n */\nstatic ctorParameters: () => ({type: any, decorators?: DecoratorInvocation[]}|null)[] = () => [\n];\n}\n\nfunction FlutterwaveModule_tsickle_Closure_declarations() {\n/** @type {?} */\nFlutterwaveModule.decorators;\n/**\n * @nocollapse\n * @type {?}\n */\nFlutterwaveModule.ctorParameters;\n}\n\n\ninterface DecoratorInvocation {\n type: Function;\n args?: any[];\n}\n","import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core';\nimport {FlutterwaveCheckout, InlinePaymentOptions, PaymentSuccessResponse} from '../models';\nimport {Flutterwave} from '../flutterwave.service';\nexport class MakePaymentComponent implements OnInit {\n\n public_key: string;\n tx_ref: string;\n amount: number;\n currency: string;\n payment_options: string;\n payment_plan: string | number;\n subaccounts: any;\n integrity_hash: any;\n redirect_url: string;\n meta: object; // { counsumer_id, consumer_mac}\n customer: object; // {email, phone_number,name}\n callback: EventEmitter = new EventEmitter();\n close: EventEmitter = new EventEmitter();\n customizations: object; // {title, description, logo}\n text: string;\n style: any;\n className: string;\n data: InlinePaymentOptions;\nprivate inlinePaymentOptions: InlinePaymentOptions;\n\n customer_defaults = {\n email: '',\n phone_number: '',\n name: '',\n };\n meta_defaults = {\n consumer_id: '',\n consumer_mac: '',\n };\n customizations_defaults = {\n title: '',\n description: '',\n logo: '',\n };\n/**\n * @param {?} flutterwave\n */\nconstructor(private flutterwave: Flutterwave) {\n }\n/**\n * @return {?}\n */\nngOnInit(): void {\n }\n/**\n * @return {?}\n */\nmakePayment() {\n\n this.prepareForPayment();\n FlutterwaveCheckout(this.inlinePaymentOptions);\n\n }\n/**\n * @return {?}\n */\nprepareForPayment(): void {\n\n this.customer = this.customer || {};\n this.meta = this.meta || {};\n this.customizations = this.customizations || {};\n\n if ( this.data ) {\n this.inlinePaymentOptions = {\n ...this.data,\n callback: response => {\n this.flutterwave.submitToTracker(this.data , response, 10000)\n this.data.callbackContext[this.data.callback.name](response)\n } ,\n onclose: () => {\n try {\n this.data.callbackContext[this.data.onclose.name]()\n } catch ( /** @type {?} */e) {\n\n }\n\n } ,\n\n }\n } else {\n\n this.inlinePaymentOptions = {\n callbackContext: null,\n public_key: this.public_key,\n tx_ref: this.tx_ref,\n amount: this.amount,\n currency: this.currency || 'NGN',\n payment_options: this.payment_options || 'card, mobilemoney, ussd',\n redirect_url: this.redirect_url || '',\n meta: {...this.meta_defaults, ...this.meta},\n customer: {...this.customer_defaults, ...this.customer},\n callback: (response: PaymentSuccessResponse) => {\n this.flutterwave.submitToTracker(this.inlinePaymentOptions , response, 10000)\n this.callback.emit(response)\n },\n onclose: () => this.close.emit(),\n customizations: {...this.customizations_defaults\n , ...this.customizations}\n }\n if (this.payment_plan) {\n this.inlinePaymentOptions.payment_plan = this.payment_plan\n }\n if (this.subaccounts) {\n this.inlinePaymentOptions.subaccounts = this.subaccounts\n }\n if (this.integrity_hash) {\n this.inlinePaymentOptions.integrity_hash = this.integrity_hash\n }\n }\n\n\n }\n\nstatic decorators: DecoratorInvocation[] = [\n{ type: Component, args: [{\n // tslint:disable-next-line:component-selector\n selector: 'flutterwave-make-payment',\n template: `\n \n {{text || 'Pay'}}\n \n `,\n styles: [`\n .flutterwave-pay-button{\n background-color: #f5a623;\n border-radius: 4px;\n border-color: #f5a623;\n -webkit-box-shadow: 0 2px 3px 0 #ccc;\n box-shadow: 0 2px 3px 0 #ccc;\n color: #fff;\n display: block;\n font-size: 12px;\n font-weight: 700;\n padding: 14px 22px;\n text-align: center;\n text-decoration: none;\n -webkit-transition: all .3s ease-in-out;\n transition: all .3s ease-in-out;\n\n }\n `]\n}, ] },\n];\n/**\n * @nocollapse\n */\nstatic ctorParameters: () => ({type: any, decorators?: DecoratorInvocation[]}|null)[] = () => [\n{type: Flutterwave, },\n];\nstatic propDecorators: {[key: string]: DecoratorInvocation[]} = {\n'public_key': [{ type: Input },],\n'tx_ref': [{ type: Input },],\n'amount': [{ type: Input },],\n'currency': [{ type: Input },],\n'payment_options': [{ type: Input },],\n'payment_plan': [{ type: Input },],\n'subaccounts': [{ type: Input },],\n'integrity_hash': [{ type: Input },],\n'redirect_url': [{ type: Input },],\n'meta': [{ type: Input },],\n'customer': [{ type: Input },],\n'callback': [{ type: Output },],\n'close': [{ type: Output },],\n'customizations': [{ type: Input },],\n'text': [{ type: Input },],\n'style': [{ type: Input },],\n'className': [{ type: Input },],\n'data': [{ type: Input },],\n};\n}\n\nfunction MakePaymentComponent_tsickle_Closure_declarations() {\n/** @type {?} */\nMakePaymentComponent.decorators;\n/**\n * @nocollapse\n * @type {?}\n */\nMakePaymentComponent.ctorParameters;\n/** @type {?} */\nMakePaymentComponent.propDecorators;\n/** @type {?} */\nMakePaymentComponent.prototype.public_key;\n/** @type {?} */\nMakePaymentComponent.prototype.tx_ref;\n/** @type {?} */\nMakePaymentComponent.prototype.amount;\n/** @type {?} */\nMakePaymentComponent.prototype.currency;\n/** @type {?} */\nMakePaymentComponent.prototype.payment_options;\n/** @type {?} */\nMakePaymentComponent.prototype.payment_plan;\n/** @type {?} */\nMakePaymentComponent.prototype.subaccounts;\n/** @type {?} */\nMakePaymentComponent.prototype.integrity_hash;\n/** @type {?} */\nMakePaymentComponent.prototype.redirect_url;\n/** @type {?} */\nMakePaymentComponent.prototype.meta;\n/** @type {?} */\nMakePaymentComponent.prototype.customer;\n/** @type {?} */\nMakePaymentComponent.prototype.callback;\n/** @type {?} */\nMakePaymentComponent.prototype.close;\n/** @type {?} */\nMakePaymentComponent.prototype.customizations;\n/** @type {?} */\nMakePaymentComponent.prototype.text;\n/** @type {?} */\nMakePaymentComponent.prototype.style;\n/** @type {?} */\nMakePaymentComponent.prototype.className;\n/** @type {?} */\nMakePaymentComponent.prototype.data;\n/** @type {?} */\nMakePaymentComponent.prototype.inlinePaymentOptions;\n/** @type {?} */\nMakePaymentComponent.prototype.customer_defaults;\n/** @type {?} */\nMakePaymentComponent.prototype.meta_defaults;\n/** @type {?} */\nMakePaymentComponent.prototype.customizations_defaults;\n/** @type {?} */\nMakePaymentComponent.prototype.flutterwave;\n}\n\n\ninterface DecoratorInvocation {\n type: Function;\n args?: any[];\n}\n","import { Injectable } from '@angular/core';\nimport {AsyncPaymentOptions, FlutterwaveCheckout, InlinePaymentOptions, PaymentSuccessResponse} from './models';\nimport {ApiTracking} from './api-tracking.service';\nexport class Flutterwave {\n/**\n * @param {?} tracker\n */\nconstructor(private tracker: ApiTracking) {\n }\n/**\n * @param {?} paymentData\n * @return {?}\n */\ninlinePay(paymentData: InlinePaymentOptions) {\n\n const /** @type {?} */ data = {\n ...paymentData,\n callback: response => {\n this.submitToTracker(paymentData , response, 10000)\n paymentData.callbackContext[paymentData.callback.name](response)\n } ,\n onclose: () => {\n try {\n paymentData.callbackContext[paymentData.onclose.name]()\n } catch ( /** @type {?} */e) {}\n }\n };\n\n FlutterwaveCheckout(data);\n\n }\n/**\n * @param {?} paymentData\n * @return {?}\n */\nasyncInlinePay(paymentData: AsyncPaymentOptions): Promise {\n\n return new Promise((resolve, reject) => {\n\n paymentData = {\n ...paymentData,\n callback: ($event) => {\n this.submitToTracker(paymentData , $event, 10000)\n resolve($event)\n } ,\n onclose: () => resolve('closed')\n };\n\n FlutterwaveCheckout(paymentData)\n\n })\n\n }\n/**\n * @param {?} paymentData\n * @param {?} response\n * @param {?} responseTime\n * @return {?}\n */\nsubmitToTracker(paymentData , response, responseTime) {\n\n\n this.tracker.track({\n paymentData,\n response,\n responseTime\n })\n\n\n }\n/**\n *\n * @param {?=} waitDuration {Number} Seconds before closing payment modal\n * @return {?}\n */\nclosePaymentModal(waitDuration: number = 0) {\n setTimeout(() => {\n document.getElementsByName('checkout')[0].setAttribute('style',\n 'position:fixed;top:0;left:0;z-index:-1;border:none;opacity:0;pointer-events:none;width:100%;height:100%;');\n document.body.style.overflow = '';\n // document.getElementsByName('checkout')[0].setAttribute('style', 'z-index: -1; opacity: 0')\n } , waitDuration * 1000 )\n }\n\nstatic decorators: DecoratorInvocation[] = [\n{ type: Injectable },\n];\n/**\n * @nocollapse\n */\nstatic ctorParameters: () => ({type: any, decorators?: DecoratorInvocation[]}|null)[] = () => [\n{type: ApiTracking, },\n];\n}\n\nfunction Flutterwave_tsickle_Closure_declarations() {\n/** @type {?} */\nFlutterwave.decorators;\n/**\n * @nocollapse\n * @type {?}\n */\nFlutterwave.ctorParameters;\n/** @type {?} */\nFlutterwave.prototype.tracker;\n}\n\n\ninterface DecoratorInvocation {\n type: Function;\n args?: any[];\n}\n","import {Injectable} from '@angular/core';\nexport class ApiTracking {\n\n trackingEndPoint = 'https://kgelfdz7mf.execute-api.us-east-1.amazonaws.com/staging/sendevent';\n\n packageVersion = '1.2.1';\n language = 'Angular V3'\nconstructor() {\n }\n/**\n * @param {?} data\n * @return {?}\n */\ntrack(data: {\n paymentData: object | any,\n response: object | any,\n responseTime: string\n }) {\n\n const /** @type {?} */ trackingData = {\n publicKey: data.paymentData.public_key,\n language: this.language,\n version: this.packageVersion,\n title: '',\n message: '0' // data.responseTime\n\n }\n\n const /** @type {?} */ paymentOptions = data.paymentData.payment_options || ''\n const /** @type {?} */ paymentOptionsArray = paymentOptions ? paymentOptions.split(',') : []\n\n\n\n\n let /** @type {?} */ title = ''\n\n if (paymentOptionsArray.length === 0) {\n title = 'Initiate-Charge-Dashboard'\n } else if (paymentOptionsArray.length === 1) {\n title = 'Initiate-Charge-' + paymentOptions\n\n } else {\n title = 'Initiate-Charge-Multiple'\n\n }\n\n trackingData.title = data.response.status === 'successful' ? title : title + '-error'\n\n this.submitTracking(trackingData)\n\n }\n/**\n * @param {?} data\n * @return {?}\n */\nsubmitTracking(data) {\n\n fetch(this.trackingEndPoint, {\n method: 'POST',\n body: JSON.stringify(data)\n }).then((res) => {\n })\n\n }\n\n\nstatic decorators: DecoratorInvocation[] = [\n{ type: Injectable },\n];\n/**\n * @nocollapse\n */\nstatic ctorParameters: () => ({type: any, decorators?: DecoratorInvocation[]}|null)[] = () => [\n];\n}\n\nfunction ApiTracking_tsickle_Closure_declarations() {\n/** @type {?} */\nApiTracking.decorators;\n/**\n * @nocollapse\n * @type {?}\n */\nApiTracking.ctorParameters;\n/** @type {?} */\nApiTracking.prototype.trackingEndPoint;\n/** @type {?} */\nApiTracking.prototype.packageVersion;\n/** @type {?} */\nApiTracking.prototype.language;\n}\n\n\n/*\n\ninterface tracking-data {\n merchantId: string,\n language: string\n}\n*/\n\n\ninterface DecoratorInvocation {\n type: Function;\n args?: any[];\n}\n","\n/**\n * Payment data object\n * \\@property public_key {String}\n * \\@property callbackContext {Object} The context of the\n * component or service that has the callback method.\n * The value must always be 'this'.\n * Using any other value might lead to error.\n * \\@property tx_ref {String}\n * \\@property amount {Number}\n * \\@property currency {String}\n * \\@property payment_options {String}\n * \\@property payment_plan {String}\n * \\@property redirect_url {String}\n * \\@property meta {Object}\n * \\@property customer {Object}\n * \\@property customizations {Object}\n * \\@property callback {Function}\n * \\@property onclose {Function}\n */\nclass InlinePaymentOptions {\n public_key: string;\n callbackContext?: object;\n tx_ref: string;\n amount: number;\n currency?: string;\n country?: string;\n authorization?: object | string;\n payment_options?: string;\n payment_plan?: string | number;\n subaccounts?: any;\n integrity_hash?: any;\n redirect_url?: string;\n meta ?: any;\n customer?: object;\n customizations?: object;\n callback?: (response: object) => void;\n onclose?: () => void;\n}\n\nfunction InlinePaymentOptions_tsickle_Closure_declarations() {\n/** @type {?} */\nInlinePaymentOptions.prototype.public_key;\n/** @type {?} */\nInlinePaymentOptions.prototype.callbackContext;\n/** @type {?} */\nInlinePaymentOptions.prototype.tx_ref;\n/** @type {?} */\nInlinePaymentOptions.prototype.amount;\n/** @type {?} */\nInlinePaymentOptions.prototype.currency;\n/** @type {?} */\nInlinePaymentOptions.prototype.country;\n/** @type {?} */\nInlinePaymentOptions.prototype.authorization;\n/** @type {?} */\nInlinePaymentOptions.prototype.payment_options;\n/** @type {?} */\nInlinePaymentOptions.prototype.payment_plan;\n/** @type {?} */\nInlinePaymentOptions.prototype.subaccounts;\n/** @type {?} */\nInlinePaymentOptions.prototype.integrity_hash;\n/** @type {?} */\nInlinePaymentOptions.prototype.redirect_url;\n/** @type {?} */\nInlinePaymentOptions.prototype.meta;\n/** @type {?} */\nInlinePaymentOptions.prototype.customer;\n/** @type {?} */\nInlinePaymentOptions.prototype.customizations;\n/** @type {?} */\nInlinePaymentOptions.prototype.callback;\n/** @type {?} */\nInlinePaymentOptions.prototype.onclose;\n}\n\n/**\n * Async Payment data object\n * \\@property public_key {String}\n * \\@property tx_ref {String}\n * \\@property amount {Number}\n * \\@property currency {String}\n * \\@property payment_options {String}\n * \\@property meta {Object}\n * \\@property customer {Object}\n * \\@property customizations {Object}\n * \\@property payment_plan {String}\n */\nclass AsyncPaymentOptions {\n public_key: string;\n tx_ref: string;\n amount: number;\n currency?: string;\n country?: string;\n authorization?: object | string;\n payment_options?: string;\n meta ?: any;\n customer?: object;\n customizations?: object;\n payment_plan?: string | number;\n subaccounts?: any;\n integrity_hash?: any;\n}\n\nfunction AsyncPaymentOptions_tsickle_Closure_declarations() {\n/** @type {?} */\nAsyncPaymentOptions.prototype.public_key;\n/** @type {?} */\nAsyncPaymentOptions.prototype.tx_ref;\n/** @type {?} */\nAsyncPaymentOptions.prototype.amount;\n/** @type {?} */\nAsyncPaymentOptions.prototype.currency;\n/** @type {?} */\nAsyncPaymentOptions.prototype.country;\n/** @type {?} */\nAsyncPaymentOptions.prototype.authorization;\n/** @type {?} */\nAsyncPaymentOptions.prototype.payment_options;\n/** @type {?} */\nAsyncPaymentOptions.prototype.meta;\n/** @type {?} */\nAsyncPaymentOptions.prototype.customer;\n/** @type {?} */\nAsyncPaymentOptions.prototype.customizations;\n/** @type {?} */\nAsyncPaymentOptions.prototype.payment_plan;\n/** @type {?} */\nAsyncPaymentOptions.prototype.subaccounts;\n/** @type {?} */\nAsyncPaymentOptions.prototype.integrity_hash;\n}\n\n\n\ndeclare function FlutterwaveCheckout(any)\n/**\n * Payment Response\n * \\@property amount {String}\n * \\@property currency {Number}\n * \\@property customer {Object}\n * \\@property flw_ref {String}\n * \\@property status {String}\n * \\@property transaction_id {String}\n * \\@property tx_ref {String}\n * \\@property payment_plan {String}\n */\nclass PaymentSuccessResponse {\n amount?: number;\n currency?: string;\n customer?: object;\n flw_ref?: string;\n status?: string;\n transaction_id?: number;\n tx_ref?: string;\n payment_plan?: string| number\n }\n\nfunction PaymentSuccessResponse_tsickle_Closure_declarations() {\n/** @type {?} */\nPaymentSuccessResponse.prototype.amount;\n/** @type {?} */\nPaymentSuccessResponse.prototype.currency;\n/** @type {?} */\nPaymentSuccessResponse.prototype.customer;\n/** @type {?} */\nPaymentSuccessResponse.prototype.flw_ref;\n/** @type {?} */\nPaymentSuccessResponse.prototype.status;\n/** @type {?} */\nPaymentSuccessResponse.prototype.transaction_id;\n/** @type {?} */\nPaymentSuccessResponse.prototype.tx_ref;\n/** @type {?} */\nPaymentSuccessResponse.prototype.payment_plan;\n}\n\n\n\n export {\n InlinePaymentOptions,\n AsyncPaymentOptions,\n FlutterwaveCheckout,\n PaymentSuccessResponse\n };\n"],"names":[],"mappings":";;AKCA;;;;;;;;;;;;;;;;;;;AAmBA;IAAA;IAkBA,CAAC;IAAD,2BAAC;AAAD,CAAC,AAlBD,IAkBC;AAED;;;;;;;;;;;;AAiDA;IAAA;IAcA,CAAC;IAAD,0BAAC;AAAD,CAAC,AAdD,IAcC;AAED;;;;;;;;;;;AA2CA;IAAA;IASA,CAAG;IAAH,6BAAG;AAAH,CAAG,AATH,IASG;AD5JH;IAMA;QAJE,IAAF,CAAA,gBAAkB,GAGG,0EAAA,CAA2E;QAD9F,IAAF,CAAA,cAAgB,GAGG,OAAA,CAAQ;QAFzB,IAAF,CAAA,QAAU,GAGG,YAAA,CAAA;IADb,CAAG;;;;;IAKH,2BAkBG,GAlBH,UAkBG,IAdA;QAEC,IAAJ,gBAAA,CAkBU,YAAA,GAAe;YAjBnB,SAAS,EAkBE,IAAA,CAAK,WAAC,CAAW,UAAC;YAjB7B,QAAQ,EAkBE,IAAA,CAAK,QAAC;YAjBhB,OAAO,EAkBE,IAAA,CAAK,cAAC;YAjBf,KAAK,EAkBE,EAAA;YAjBP,OAAO,EAkBE,GAAA,CAlBf,oBAAA;SAEK,CAAA;QAED,IAAJ,gBAAA,CAkBU,cAAA,GAAiB,IAAA,CAAK,WAAC,CAAW,eAAC,IAAkB,EAAA,CAAA;QAjB3D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AO,EANE,CAAA,EAAG,IAAA,EAAM,KAAA,EAAM,EAAE;IAO1B,WAAW,EANE,CAAA,EAAG,IAAA,EAAM,KAAA,EAAM,EAAE;IAO9B,MAAM,EANE,CAAA,EAAG,IAAA,EAAM,KAAA,EAAM,EAAE;CAOxB,CANC;ADrKF;IACA;QAEM,IAAM,SAAS,GAAG,wCAAwC,CAAC;QAC3D,IAAM,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;QAChD,MAAM,CAAC,GAAG,GAAG,SAAS,CAAC;QACvB,EAAN,CAAA,CAAU,CAAC,QAAQ,CAAC,aAAa,CAAC,YAAS,SAAS,QAAI,CAAC,CAAzD,CAA2D,CAA3D;YACQ,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAA;QACzC,CAAO;IAGP,CAAG;;CAXH;AAcO,iBAAP,CAAA,UAAO,GAAoC;IAD3C,EAEE,IAAA,EAAM,QAAA,EAAU,IAAA,EAAM,CAAA;gBADtB,OAAO,EAEE;oBADP,YAAY;iBACb;gBACD,YAAY,EAEE,CAAA,oBAAE,CAAoB;gBADpC,SAAS,EAEE,CAAA,WAAE,EAAY,WAAA,CAAY;gBADrC,OAAO,EAEE,CAAA,oBAAE,CAAoB;aADhC,EAEC,EAAG;CADJ,CAEC;;;;AAED,iBAAD,CAAA,cAAC,GAAA,cAAA,OAAA,EACA,EADA,CACA,CAAC;AD/BF;;GAEG;"} diff --git a/dist/flutterwave-angular-v3.js b/dist/flutterwave-angular-v3.js index dc7d8d7..a86ff5a 100644 --- a/dist/flutterwave-angular-v3.js +++ b/dist/flutterwave-angular-v3.js @@ -50,8 +50,137 @@ class AsyncPaymentOptions { class PaymentSuccessResponse { } -class MakePaymentComponent { +class ApiTracking { constructor() { + this.trackingEndPoint = 'https://kgelfdz7mf.execute-api.us-east-1.amazonaws.com/staging/sendevent'; + this.packageVersion = '1.2.1'; + this.language = 'Angular V3'; + } + /** + * @param {?} data + * @return {?} + */ + track(data) { + const /** @type {?} */ trackingData = { + publicKey: data.paymentData.public_key, + language: this.language, + version: this.packageVersion, + title: '', + message: '0' // data.responseTime + }; + const /** @type {?} */ paymentOptions = data.paymentData.payment_options || ''; + const /** @type {?} */ paymentOptionsArray = paymentOptions ? paymentOptions.split(',') : []; + let /** @type {?} */ title = ''; + if (paymentOptionsArray.length === 0) { + title = 'Initiate-Charge-Dashboard'; + } + else if (paymentOptionsArray.length === 1) { + title = 'Initiate-Charge-' + paymentOptions; + } + else { + title = 'Initiate-Charge-Multiple'; + } + trackingData.title = data.response.status === 'successful' ? title : title + '-error'; + this.submitTracking(trackingData); + } + /** + * @param {?} data + * @return {?} + */ + submitTracking(data) { + fetch(this.trackingEndPoint, { + method: 'POST', + body: JSON.stringify(data) + }).then((res) => { + }); + } +} +ApiTracking.decorators = [ + { type: Injectable }, +]; +/** + * @nocollapse + */ +ApiTracking.ctorParameters = () => []; + +class Flutterwave { + /** + * @param {?} tracker + */ + constructor(tracker) { + this.tracker = tracker; + } + /** + * @param {?} paymentData + * @return {?} + */ + inlinePay(paymentData) { + const /** @type {?} */ data = Object.assign({}, paymentData, { callback: response => { + this.submitToTracker(paymentData, response, 10000); + paymentData.callbackContext[paymentData.callback.name](response); + }, onclose: () => { + try { + paymentData.callbackContext[paymentData.onclose.name](); + } + catch (e) { } + } }); + FlutterwaveCheckout(data); + } + /** + * @param {?} paymentData + * @return {?} + */ + asyncInlinePay(paymentData) { + return new Promise((resolve, reject) => { + paymentData = Object.assign({}, paymentData, { callback: ($event) => { + this.submitToTracker(paymentData, $event, 10000); + resolve($event); + }, onclose: () => resolve('closed') }); + FlutterwaveCheckout(paymentData); + }); + } + /** + * @param {?} paymentData + * @param {?} response + * @param {?} responseTime + * @return {?} + */ + submitToTracker(paymentData, response, responseTime) { + this.tracker.track({ + paymentData, + response, + responseTime + }); + } + /** + * + * @param {?=} waitDuration {Number} Seconds before closing payment modal + * @return {?} + */ + closePaymentModal(waitDuration = 0) { + setTimeout(() => { + document.getElementsByName('checkout')[0].setAttribute('style', 'position:fixed;top:0;left:0;z-index:-1;border:none;opacity:0;pointer-events:none;width:100%;height:100%;'); + document.body.style.overflow = ''; + // document.getElementsByName('checkout')[0].setAttribute('style', 'z-index: -1; opacity: 0') + }, waitDuration * 1000); + } +} +Flutterwave.decorators = [ + { type: Injectable }, +]; +/** + * @nocollapse + */ +Flutterwave.ctorParameters = () => [ + { type: ApiTracking, }, +]; + +class MakePaymentComponent { + /** + * @param {?} flutterwave + */ + constructor(flutterwave) { + this.flutterwave = flutterwave; this.callback = new EventEmitter(); this.close = new EventEmitter(); this.customer_defaults = { @@ -90,6 +219,7 @@ class MakePaymentComponent { this.customizations = this.customizations || {}; if (this.data) { this.inlinePaymentOptions = Object.assign({}, this.data, { callback: response => { + this.flutterwave.submitToTracker(this.data, response, 10000); this.data.callbackContext[this.data.callback.name](response); }, onclose: () => { try { @@ -111,6 +241,7 @@ class MakePaymentComponent { meta: Object.assign({}, this.meta_defaults, this.meta), customer: Object.assign({}, this.customer_defaults, this.customer), callback: (response) => { + this.flutterwave.submitToTracker(this.inlinePaymentOptions, response, 10000); this.callback.emit(response); }, onclose: () => this.close.emit(), @@ -164,7 +295,9 @@ MakePaymentComponent.decorators = [ /** * @nocollapse */ -MakePaymentComponent.ctorParameters = () => []; +MakePaymentComponent.ctorParameters = () => [ + { type: Flutterwave, }, +]; MakePaymentComponent.propDecorators = { 'public_key': [{ type: Input },], 'tx_ref': [{ type: Input },], @@ -186,56 +319,6 @@ MakePaymentComponent.propDecorators = { 'data': [{ type: Input },], }; -class Flutterwave { - constructor() { } - /** - * @param {?} paymentData - * @return {?} - */ - inlinePay(paymentData) { - const /** @type {?} */ data = Object.assign({}, paymentData, { callback: response => { - paymentData.callbackContext[paymentData.callback.name](response); - }, onclose: () => { - try { - paymentData.callbackContext[paymentData.onclose.name](); - } - catch (e) { } - } }); - FlutterwaveCheckout(data); - } - /** - * @param {?} paymentData - * @return {?} - */ - asyncInlinePay(paymentData) { - return new Promise((resolve, reject) => { - paymentData = Object.assign({}, paymentData, { callback: ($event) => { - resolve($event); - }, onclose: () => resolve('closed') }); - FlutterwaveCheckout(paymentData); - }); - } - /** - * - * @param {?=} waitDuration {Number} Seconds before closing payment modal - * @return {?} - */ - closePaymentModal(waitDuration = 0) { - setTimeout(() => { - document.getElementsByName('checkout')[0].setAttribute('style', 'position:fixed;top:0;left:0;z-index:-1;border:none;opacity:0;pointer-events:none;width:100%;height:100%;'); - document.body.style.overflow = ''; - // document.getElementsByName('checkout')[0].setAttribute('style', 'z-index: -1; opacity: 0') - }, waitDuration * 1000); - } -} -Flutterwave.decorators = [ - { type: Injectable }, -]; -/** - * @nocollapse - */ -Flutterwave.ctorParameters = () => []; - class FlutterwaveModule { constructor() { const inlineSdk = 'https://checkout.flutterwave.com/v3.js'; @@ -249,10 +332,10 @@ class FlutterwaveModule { FlutterwaveModule.decorators = [ { type: NgModule, args: [{ imports: [ - CommonModule + CommonModule, ], declarations: [MakePaymentComponent], - providers: [Flutterwave], + providers: [Flutterwave, ApiTracking], exports: [MakePaymentComponent] },] }, ]; @@ -265,5 +348,5 @@ FlutterwaveModule.ctorParameters = () => []; * Generated bundle index. Do not edit. */ -export { FlutterwaveModule, Flutterwave, InlinePaymentOptions, PaymentSuccessResponse, AsyncPaymentOptions, MakePaymentComponent }; +export { FlutterwaveModule, Flutterwave, InlinePaymentOptions, PaymentSuccessResponse, AsyncPaymentOptions, MakePaymentComponent, ApiTracking as ɵa }; //# sourceMappingURL=flutterwave-angular-v3.js.map diff --git a/dist/flutterwave-angular-v3.js.map b/dist/flutterwave-angular-v3.js.map index 6250b03..ab56700 100644 --- a/dist/flutterwave-angular-v3.js.map +++ b/dist/flutterwave-angular-v3.js.map @@ -1 +1 @@ -{"version":3,"file":"flutterwave-angular-v3.js","sources":["ts/flutterwave-angular-v3.ts","ts/src/app/modules/flutterwave.module.ts","ts/src/app/modules/flutterwave.service.ts","ts/src/app/modules/make-payment/make-payment.component.ts","ts/src/app/modules/models.ts"],"sourcesContent":["/**\n * Generated bundle index. Do not edit.\n */\n\nexport {FlutterwaveModule,Flutterwave,InlinePaymentOptions,PaymentSuccessResponse,AsyncPaymentOptions,MakePaymentComponent} from './public_api';\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { MakePaymentComponent } from './make-payment/make-payment.component';\nimport {Flutterwave} from './flutterwave.service';\nexport class FlutterwaveModule {\nconstructor() {\n\n const inlineSdk = 'https://checkout.flutterwave.com/v3.js';\n const script = document.createElement('script');\n script.src = inlineSdk;\n if (!document.querySelector(`[src=\"${inlineSdk}\"]`)) {\n document.body.appendChild(script)\n }\n\n\n }\nstatic decorators: DecoratorInvocation[] = [\n{ type: NgModule, args: [{\n imports: [\n CommonModule\n ],\n declarations: [MakePaymentComponent] ,\n providers: [Flutterwave],\n exports: [MakePaymentComponent]\n}, ] },\n];\n/**\n * @nocollapse\n */\nstatic ctorParameters: () => ({type: any, decorators?: DecoratorInvocation[]}|null)[] = () => [\n];\n}\n\nfunction FlutterwaveModule_tsickle_Closure_declarations() {\n/** @type {?} */\nFlutterwaveModule.decorators;\n/**\n * @nocollapse\n * @type {?}\n */\nFlutterwaveModule.ctorParameters;\n}\n\n\ninterface DecoratorInvocation {\n type: Function;\n args?: any[];\n}\n","import { Injectable } from '@angular/core';\nimport {AsyncPaymentOptions, FlutterwaveCheckout, InlinePaymentOptions, PaymentSuccessResponse} from './models';\nexport class Flutterwave {\nconstructor() { }\n/**\n * @param {?} paymentData\n * @return {?}\n */\ninlinePay(paymentData: InlinePaymentOptions) {\n\n const /** @type {?} */ data = {\n ...paymentData,\n callback: response => {\n paymentData.callbackContext[paymentData.callback.name](response)\n } ,\n onclose: () => {\n try {\n paymentData.callbackContext[paymentData.onclose.name]()\n } catch ( /** @type {?} */e) {}\n }\n };\n\n FlutterwaveCheckout(data);\n\n }\n/**\n * @param {?} paymentData\n * @return {?}\n */\nasyncInlinePay(paymentData: AsyncPaymentOptions): Promise {\n\n return new Promise((resolve, reject) => {\n\n paymentData = {\n ...paymentData,\n callback: ($event) => {\n resolve($event)\n } ,\n onclose: () => resolve('closed')\n };\n\n FlutterwaveCheckout(paymentData)\n\n })\n\n }\n/**\n *\n * @param {?=} waitDuration {Number} Seconds before closing payment modal\n * @return {?}\n */\nclosePaymentModal(waitDuration: number = 0) {\n setTimeout(() => {\n document.getElementsByName('checkout')[0].setAttribute('style',\n 'position:fixed;top:0;left:0;z-index:-1;border:none;opacity:0;pointer-events:none;width:100%;height:100%;');\n document.body.style.overflow = '';\n // document.getElementsByName('checkout')[0].setAttribute('style', 'z-index: -1; opacity: 0')\n } , waitDuration * 1000 )\n }\n\nstatic decorators: DecoratorInvocation[] = [\n{ type: Injectable },\n];\n/**\n * @nocollapse\n */\nstatic ctorParameters: () => ({type: any, decorators?: DecoratorInvocation[]}|null)[] = () => [\n];\n}\n\nfunction Flutterwave_tsickle_Closure_declarations() {\n/** @type {?} */\nFlutterwave.decorators;\n/**\n * @nocollapse\n * @type {?}\n */\nFlutterwave.ctorParameters;\n}\n\n\ninterface DecoratorInvocation {\n type: Function;\n args?: any[];\n}\n","import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core';\nimport {FlutterwaveCheckout, InlinePaymentOptions, PaymentSuccessResponse} from '../models';\nexport class MakePaymentComponent implements OnInit {\n\n public_key: string;\n tx_ref: string;\n amount: number;\n currency: string;\n payment_options: string;\n payment_plan: string | number;\n subaccounts: any;\n integrity_hash: any;\n redirect_url: string;\n meta: object; // { counsumer_id, consumer_mac}\n customer: object; // {email, phone_number,name}\n callback: EventEmitter = new EventEmitter();\n close: EventEmitter = new EventEmitter();\n customizations: object; // {title, description, logo}\n text: string;\n style: any;\n className: string;\n data: InlinePaymentOptions;\nprivate inlinePaymentOptions: InlinePaymentOptions;\n\n customer_defaults = {\n email: '',\n phone_number: '',\n name: '',\n };\n meta_defaults = {\n consumer_id: '',\n consumer_mac: '',\n };\n customizations_defaults = {\n title: '',\n description: '',\n logo: '',\n };\nconstructor() {\n }\n/**\n * @return {?}\n */\nngOnInit(): void {\n }\n/**\n * @return {?}\n */\nmakePayment() {\n\n this.prepareForPayment();\n FlutterwaveCheckout(this.inlinePaymentOptions);\n\n }\n/**\n * @return {?}\n */\nprepareForPayment(): void {\n\n this.customer = this.customer || {};\n this.meta = this.meta || {};\n this.customizations = this.customizations || {};\n\n if ( this.data ) {\n this.inlinePaymentOptions = {\n ...this.data,\n callback: response => {\n this.data.callbackContext[this.data.callback.name](response)\n } ,\n onclose: () => {\n try {\n this.data.callbackContext[this.data.onclose.name]()\n } catch ( /** @type {?} */e) {\n\n }\n\n } ,\n\n }\n } else {\n\n this.inlinePaymentOptions = {\n callbackContext: null,\n public_key: this.public_key,\n tx_ref: this.tx_ref,\n amount: this.amount,\n currency: this.currency || 'NGN',\n payment_options: this.payment_options || 'card, mobilemoney, ussd',\n redirect_url: this.redirect_url || '',\n meta: {...this.meta_defaults, ...this.meta},\n customer: {...this.customer_defaults, ...this.customer},\n callback: (response: PaymentSuccessResponse) => {\n this.callback.emit(response)\n },\n onclose: () => this.close.emit(),\n customizations: {...this.customizations_defaults\n , ...this.customizations}\n }\n if (this.payment_plan) {\n this.inlinePaymentOptions.payment_plan = this.payment_plan\n }\n if (this.subaccounts) {\n this.inlinePaymentOptions.subaccounts = this.subaccounts\n }\n if (this.integrity_hash) {\n this.inlinePaymentOptions.integrity_hash = this.integrity_hash\n }\n }\n\n\n }\n\nstatic decorators: DecoratorInvocation[] = [\n{ type: Component, args: [{\n // tslint:disable-next-line:component-selector\n selector: 'flutterwave-make-payment',\n template: `\n \n {{text || 'Pay'}}\n \n `,\n styles: [`\n .flutterwave-pay-button{\n background-color: #f5a623;\n border-radius: 4px;\n border-color: #f5a623;\n -webkit-box-shadow: 0 2px 3px 0 #ccc;\n box-shadow: 0 2px 3px 0 #ccc;\n color: #fff;\n display: block;\n font-size: 12px;\n font-weight: 700;\n padding: 14px 22px;\n text-align: center;\n text-decoration: none;\n -webkit-transition: all .3s ease-in-out;\n transition: all .3s ease-in-out;\n\n }\n `]\n}, ] },\n];\n/**\n * @nocollapse\n */\nstatic ctorParameters: () => ({type: any, decorators?: DecoratorInvocation[]}|null)[] = () => [\n];\nstatic propDecorators: {[key: string]: DecoratorInvocation[]} = {\n'public_key': [{ type: Input },],\n'tx_ref': [{ type: Input },],\n'amount': [{ type: Input },],\n'currency': [{ type: Input },],\n'payment_options': [{ type: Input },],\n'payment_plan': [{ type: Input },],\n'subaccounts': [{ type: Input },],\n'integrity_hash': [{ type: Input },],\n'redirect_url': [{ type: Input },],\n'meta': [{ type: Input },],\n'customer': [{ type: Input },],\n'callback': [{ type: Output },],\n'close': [{ type: Output },],\n'customizations': [{ type: Input },],\n'text': [{ type: Input },],\n'style': [{ type: Input },],\n'className': [{ type: Input },],\n'data': [{ type: Input },],\n};\n}\n\nfunction MakePaymentComponent_tsickle_Closure_declarations() {\n/** @type {?} */\nMakePaymentComponent.decorators;\n/**\n * @nocollapse\n * @type {?}\n */\nMakePaymentComponent.ctorParameters;\n/** @type {?} */\nMakePaymentComponent.propDecorators;\n/** @type {?} */\nMakePaymentComponent.prototype.public_key;\n/** @type {?} */\nMakePaymentComponent.prototype.tx_ref;\n/** @type {?} */\nMakePaymentComponent.prototype.amount;\n/** @type {?} */\nMakePaymentComponent.prototype.currency;\n/** @type {?} */\nMakePaymentComponent.prototype.payment_options;\n/** @type {?} */\nMakePaymentComponent.prototype.payment_plan;\n/** @type {?} */\nMakePaymentComponent.prototype.subaccounts;\n/** @type {?} */\nMakePaymentComponent.prototype.integrity_hash;\n/** @type {?} */\nMakePaymentComponent.prototype.redirect_url;\n/** @type {?} */\nMakePaymentComponent.prototype.meta;\n/** @type {?} */\nMakePaymentComponent.prototype.customer;\n/** @type {?} */\nMakePaymentComponent.prototype.callback;\n/** @type {?} */\nMakePaymentComponent.prototype.close;\n/** @type {?} */\nMakePaymentComponent.prototype.customizations;\n/** @type {?} */\nMakePaymentComponent.prototype.text;\n/** @type {?} */\nMakePaymentComponent.prototype.style;\n/** @type {?} */\nMakePaymentComponent.prototype.className;\n/** @type {?} */\nMakePaymentComponent.prototype.data;\n/** @type {?} */\nMakePaymentComponent.prototype.inlinePaymentOptions;\n/** @type {?} */\nMakePaymentComponent.prototype.customer_defaults;\n/** @type {?} */\nMakePaymentComponent.prototype.meta_defaults;\n/** @type {?} */\nMakePaymentComponent.prototype.customizations_defaults;\n}\n\n\ninterface DecoratorInvocation {\n type: Function;\n args?: any[];\n}\n","\n/**\n * Payment data object\n * \\@property public_key {String}\n * \\@property callbackContext {Object} The context of the\n * component or service that has the callback method.\n * The value must always be 'this'.\n * Using any other value might lead to error.\n * \\@property tx_ref {String}\n * \\@property amount {Number}\n * \\@property currency {String}\n * \\@property payment_options {String}\n * \\@property payment_plan {String}\n * \\@property redirect_url {String}\n * \\@property meta {Object}\n * \\@property customer {Object}\n * \\@property customizations {Object}\n * \\@property callback {Function}\n * \\@property onclose {Function}\n */\nclass InlinePaymentOptions {\n public_key: string;\n callbackContext?: object;\n tx_ref: string;\n amount: number;\n currency?: string;\n country?: string;\n authorization?: object | string;\n payment_options?: string;\n payment_plan?: string | number;\n subaccounts?: any;\n integrity_hash?: any;\n redirect_url?: string;\n meta ?: any;\n customer?: object;\n customizations?: object;\n callback?: (response: object) => void;\n onclose?: () => void;\n}\n\nfunction InlinePaymentOptions_tsickle_Closure_declarations() {\n/** @type {?} */\nInlinePaymentOptions.prototype.public_key;\n/** @type {?} */\nInlinePaymentOptions.prototype.callbackContext;\n/** @type {?} */\nInlinePaymentOptions.prototype.tx_ref;\n/** @type {?} */\nInlinePaymentOptions.prototype.amount;\n/** @type {?} */\nInlinePaymentOptions.prototype.currency;\n/** @type {?} */\nInlinePaymentOptions.prototype.country;\n/** @type {?} */\nInlinePaymentOptions.prototype.authorization;\n/** @type {?} */\nInlinePaymentOptions.prototype.payment_options;\n/** @type {?} */\nInlinePaymentOptions.prototype.payment_plan;\n/** @type {?} */\nInlinePaymentOptions.prototype.subaccounts;\n/** @type {?} */\nInlinePaymentOptions.prototype.integrity_hash;\n/** @type {?} */\nInlinePaymentOptions.prototype.redirect_url;\n/** @type {?} */\nInlinePaymentOptions.prototype.meta;\n/** @type {?} */\nInlinePaymentOptions.prototype.customer;\n/** @type {?} */\nInlinePaymentOptions.prototype.customizations;\n/** @type {?} */\nInlinePaymentOptions.prototype.callback;\n/** @type {?} */\nInlinePaymentOptions.prototype.onclose;\n}\n\n/**\n * Async Payment data object\n * \\@property public_key {String}\n * \\@property tx_ref {String}\n * \\@property amount {Number}\n * \\@property currency {String}\n * \\@property payment_options {String}\n * \\@property meta {Object}\n * \\@property customer {Object}\n * \\@property customizations {Object}\n * \\@property payment_plan {String}\n */\nclass AsyncPaymentOptions {\n public_key: string;\n tx_ref: string;\n amount: number;\n currency?: string;\n country?: string;\n authorization?: object | string;\n payment_options?: string;\n meta ?: any;\n customer?: object;\n customizations?: object;\n payment_plan?: string | number;\n subaccounts?: any;\n integrity_hash?: any;\n}\n\nfunction AsyncPaymentOptions_tsickle_Closure_declarations() {\n/** @type {?} */\nAsyncPaymentOptions.prototype.public_key;\n/** @type {?} */\nAsyncPaymentOptions.prototype.tx_ref;\n/** @type {?} */\nAsyncPaymentOptions.prototype.amount;\n/** @type {?} */\nAsyncPaymentOptions.prototype.currency;\n/** @type {?} */\nAsyncPaymentOptions.prototype.country;\n/** @type {?} */\nAsyncPaymentOptions.prototype.authorization;\n/** @type {?} */\nAsyncPaymentOptions.prototype.payment_options;\n/** @type {?} */\nAsyncPaymentOptions.prototype.meta;\n/** @type {?} */\nAsyncPaymentOptions.prototype.customer;\n/** @type {?} */\nAsyncPaymentOptions.prototype.customizations;\n/** @type {?} */\nAsyncPaymentOptions.prototype.payment_plan;\n/** @type {?} */\nAsyncPaymentOptions.prototype.subaccounts;\n/** @type {?} */\nAsyncPaymentOptions.prototype.integrity_hash;\n}\n\n\n\ndeclare function FlutterwaveCheckout(any)\n/**\n * Payment Response\n * \\@property amount {String}\n * \\@property currency {Number}\n * \\@property customer {Object}\n * \\@property flw_ref {String}\n * \\@property status {String}\n * \\@property transaction_id {String}\n * \\@property tx_ref {String}\n * \\@property payment_plan {String}\n */\nclass PaymentSuccessResponse {\n amount?: number;\n currency?: string;\n customer?: object;\n flw_ref?: string;\n status?: string;\n transaction_id?: number;\n tx_ref?: string;\n payment_plan?: string| number\n }\n\nfunction PaymentSuccessResponse_tsickle_Closure_declarations() {\n/** @type {?} */\nPaymentSuccessResponse.prototype.amount;\n/** @type {?} */\nPaymentSuccessResponse.prototype.currency;\n/** @type {?} */\nPaymentSuccessResponse.prototype.customer;\n/** @type {?} */\nPaymentSuccessResponse.prototype.flw_ref;\n/** @type {?} */\nPaymentSuccessResponse.prototype.status;\n/** @type {?} */\nPaymentSuccessResponse.prototype.transaction_id;\n/** @type {?} */\nPaymentSuccessResponse.prototype.tx_ref;\n/** @type {?} */\nPaymentSuccessResponse.prototype.payment_plan;\n}\n\n\n\n export {\n InlinePaymentOptions,\n AsyncPaymentOptions,\n FlutterwaveCheckout,\n PaymentSuccessResponse\n };\n"],"names":[],"mappings":";;;AICA;;;;;;;;;;;;;;;;;;;AAmBA,MAAA,oBAAA,CAAA;CAkBC;AAED,AAqCA;;;;;;;;;;;;AAYA,MAAA,mBAAA,CAAA;CAcC;AAED,AAgCA;;;;;;;;;;;AAWA,MAAA,sBAAA,CAAA;CASG;;AD3JH,MAAA,oBAAA,CAAA;IAoCA,WAAA,GAAA;QAvBG,IAAH,CAAA,QAAW,GAEyC,IAAI,YAAA,EAAoC,CAAG;QAD5F,IAAH,CAAA,KAAQ,GAEsB,IAAI,YAAA,EAAa,CAAE;QAM/C,IAAF,CAAA,iBAAmB,GAGG;YAFlB,KAAK,EAGE,EAAA;YAFP,YAAY,EAGE,EAAA;YAFd,IAAI,EAGE,EAAA;SAFP,CAGC;QAFF,IAAF,CAAA,aAAe,GAGG;YAFd,WAAW,EAGE,EAAA;YAFb,YAAY,EAGE,EAAA;SAFf,CAGC;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A,EAKA,CAAC;;AD/DF,MAAA,iBAAA,CAAA;IACA,WAAA,GAAA;QAEM,MAAM,SAAS,GAAG,wCAAwC,CAAC;QAC3D,MAAM,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;QAChD,MAAM,CAAC,GAAG,GAAG,SAAS,CAAC;QACvB,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAlC,MAAA,EAA2C,SAAS,CAApD,EAAA,CAAwD,CAAC,EAAE;YACnD,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAA;SAClC;KAGJ;;AAGI,iBAAP,CAAA,UAAO,GAAoC;IAD3C,EAEE,IAAA,EAAM,QAAA,EAAU,IAAA,EAAM,CAAA;gBADtB,OAAO,EAEE;oBADP,YAAY;iBACb;gBACD,YAAY,EAEE,CAAA,oBAAE,CAAoB;gBADpC,SAAS,EAEE,CAAA,WAAE,CAAW;gBADxB,OAAO,EAEE,CAAA,oBAAE,CAAoB;aADhC,EAEC,EAAG;CADJ,CAEC;;;;AAED,iBAAD,CAAA,cAAC,GAAA,MAAA,EACA,CAAC;;AD9BF;;GAEG;;;;"} +{"version":3,"file":"flutterwave-angular-v3.js","sources":["ts/flutterwave-angular-v3.ts","ts/src/app/modules/flutterwave.module.ts","ts/src/app/modules/make-payment/make-payment.component.ts","ts/src/app/modules/flutterwave.service.ts","ts/src/app/modules/api-tracking.service.ts","ts/src/app/modules/models.ts"],"sourcesContent":["/**\n * Generated bundle index. Do not edit.\n */\n\nexport {FlutterwaveModule,Flutterwave,InlinePaymentOptions,PaymentSuccessResponse,AsyncPaymentOptions,MakePaymentComponent} from './public_api';\n\nexport {ApiTracking as ɵa} from './src/app/modules/api-tracking.service';","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { MakePaymentComponent } from './make-payment/make-payment.component';\nimport {Flutterwave} from './flutterwave.service';\nimport {ApiTracking} from './api-tracking.service';\nexport class FlutterwaveModule {\nconstructor() {\n\n const inlineSdk = 'https://checkout.flutterwave.com/v3.js';\n const script = document.createElement('script');\n script.src = inlineSdk;\n if (!document.querySelector(`[src=\"${inlineSdk}\"]`)) {\n document.body.appendChild(script)\n }\n\n\n }\nstatic decorators: DecoratorInvocation[] = [\n{ type: NgModule, args: [{\n imports: [\n CommonModule,\n ],\n declarations: [MakePaymentComponent] ,\n providers: [Flutterwave, ApiTracking],\n exports: [MakePaymentComponent]\n}, ] },\n];\n/**\n * @nocollapse\n */\nstatic ctorParameters: () => ({type: any, decorators?: DecoratorInvocation[]}|null)[] = () => [\n];\n}\n\nfunction FlutterwaveModule_tsickle_Closure_declarations() {\n/** @type {?} */\nFlutterwaveModule.decorators;\n/**\n * @nocollapse\n * @type {?}\n */\nFlutterwaveModule.ctorParameters;\n}\n\n\ninterface DecoratorInvocation {\n type: Function;\n args?: any[];\n}\n","import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core';\nimport {FlutterwaveCheckout, InlinePaymentOptions, PaymentSuccessResponse} from '../models';\nimport {Flutterwave} from '../flutterwave.service';\nexport class MakePaymentComponent implements OnInit {\n\n public_key: string;\n tx_ref: string;\n amount: number;\n currency: string;\n payment_options: string;\n payment_plan: string | number;\n subaccounts: any;\n integrity_hash: any;\n redirect_url: string;\n meta: object; // { counsumer_id, consumer_mac}\n customer: object; // {email, phone_number,name}\n callback: EventEmitter = new EventEmitter();\n close: EventEmitter = new EventEmitter();\n customizations: object; // {title, description, logo}\n text: string;\n style: any;\n className: string;\n data: InlinePaymentOptions;\nprivate inlinePaymentOptions: InlinePaymentOptions;\n\n customer_defaults = {\n email: '',\n phone_number: '',\n name: '',\n };\n meta_defaults = {\n consumer_id: '',\n consumer_mac: '',\n };\n customizations_defaults = {\n title: '',\n description: '',\n logo: '',\n };\n/**\n * @param {?} flutterwave\n */\nconstructor(private flutterwave: Flutterwave) {\n }\n/**\n * @return {?}\n */\nngOnInit(): void {\n }\n/**\n * @return {?}\n */\nmakePayment() {\n\n this.prepareForPayment();\n FlutterwaveCheckout(this.inlinePaymentOptions);\n\n }\n/**\n * @return {?}\n */\nprepareForPayment(): void {\n\n this.customer = this.customer || {};\n this.meta = this.meta || {};\n this.customizations = this.customizations || {};\n\n if ( this.data ) {\n this.inlinePaymentOptions = {\n ...this.data,\n callback: response => {\n this.flutterwave.submitToTracker(this.data , response, 10000)\n this.data.callbackContext[this.data.callback.name](response)\n } ,\n onclose: () => {\n try {\n this.data.callbackContext[this.data.onclose.name]()\n } catch ( /** @type {?} */e) {\n\n }\n\n } ,\n\n }\n } else {\n\n this.inlinePaymentOptions = {\n callbackContext: null,\n public_key: this.public_key,\n tx_ref: this.tx_ref,\n amount: this.amount,\n currency: this.currency || 'NGN',\n payment_options: this.payment_options || 'card, mobilemoney, ussd',\n redirect_url: this.redirect_url || '',\n meta: {...this.meta_defaults, ...this.meta},\n customer: {...this.customer_defaults, ...this.customer},\n callback: (response: PaymentSuccessResponse) => {\n this.flutterwave.submitToTracker(this.inlinePaymentOptions , response, 10000)\n this.callback.emit(response)\n },\n onclose: () => this.close.emit(),\n customizations: {...this.customizations_defaults\n , ...this.customizations}\n }\n if (this.payment_plan) {\n this.inlinePaymentOptions.payment_plan = this.payment_plan\n }\n if (this.subaccounts) {\n this.inlinePaymentOptions.subaccounts = this.subaccounts\n }\n if (this.integrity_hash) {\n this.inlinePaymentOptions.integrity_hash = this.integrity_hash\n }\n }\n\n\n }\n\nstatic decorators: DecoratorInvocation[] = [\n{ type: Component, args: [{\n // tslint:disable-next-line:component-selector\n selector: 'flutterwave-make-payment',\n template: `\n \n {{text || 'Pay'}}\n \n `,\n styles: [`\n .flutterwave-pay-button{\n background-color: #f5a623;\n border-radius: 4px;\n border-color: #f5a623;\n -webkit-box-shadow: 0 2px 3px 0 #ccc;\n box-shadow: 0 2px 3px 0 #ccc;\n color: #fff;\n display: block;\n font-size: 12px;\n font-weight: 700;\n padding: 14px 22px;\n text-align: center;\n text-decoration: none;\n -webkit-transition: all .3s ease-in-out;\n transition: all .3s ease-in-out;\n\n }\n `]\n}, ] },\n];\n/**\n * @nocollapse\n */\nstatic ctorParameters: () => ({type: any, decorators?: DecoratorInvocation[]}|null)[] = () => [\n{type: Flutterwave, },\n];\nstatic propDecorators: {[key: string]: DecoratorInvocation[]} = {\n'public_key': [{ type: Input },],\n'tx_ref': [{ type: Input },],\n'amount': [{ type: Input },],\n'currency': [{ type: Input },],\n'payment_options': [{ type: Input },],\n'payment_plan': [{ type: Input },],\n'subaccounts': [{ type: Input },],\n'integrity_hash': [{ type: Input },],\n'redirect_url': [{ type: Input },],\n'meta': [{ type: Input },],\n'customer': [{ type: Input },],\n'callback': [{ type: Output },],\n'close': [{ type: Output },],\n'customizations': [{ type: Input },],\n'text': [{ type: Input },],\n'style': [{ type: Input },],\n'className': [{ type: Input },],\n'data': [{ type: Input },],\n};\n}\n\nfunction MakePaymentComponent_tsickle_Closure_declarations() {\n/** @type {?} */\nMakePaymentComponent.decorators;\n/**\n * @nocollapse\n * @type {?}\n */\nMakePaymentComponent.ctorParameters;\n/** @type {?} */\nMakePaymentComponent.propDecorators;\n/** @type {?} */\nMakePaymentComponent.prototype.public_key;\n/** @type {?} */\nMakePaymentComponent.prototype.tx_ref;\n/** @type {?} */\nMakePaymentComponent.prototype.amount;\n/** @type {?} */\nMakePaymentComponent.prototype.currency;\n/** @type {?} */\nMakePaymentComponent.prototype.payment_options;\n/** @type {?} */\nMakePaymentComponent.prototype.payment_plan;\n/** @type {?} */\nMakePaymentComponent.prototype.subaccounts;\n/** @type {?} */\nMakePaymentComponent.prototype.integrity_hash;\n/** @type {?} */\nMakePaymentComponent.prototype.redirect_url;\n/** @type {?} */\nMakePaymentComponent.prototype.meta;\n/** @type {?} */\nMakePaymentComponent.prototype.customer;\n/** @type {?} */\nMakePaymentComponent.prototype.callback;\n/** @type {?} */\nMakePaymentComponent.prototype.close;\n/** @type {?} */\nMakePaymentComponent.prototype.customizations;\n/** @type {?} */\nMakePaymentComponent.prototype.text;\n/** @type {?} */\nMakePaymentComponent.prototype.style;\n/** @type {?} */\nMakePaymentComponent.prototype.className;\n/** @type {?} */\nMakePaymentComponent.prototype.data;\n/** @type {?} */\nMakePaymentComponent.prototype.inlinePaymentOptions;\n/** @type {?} */\nMakePaymentComponent.prototype.customer_defaults;\n/** @type {?} */\nMakePaymentComponent.prototype.meta_defaults;\n/** @type {?} */\nMakePaymentComponent.prototype.customizations_defaults;\n/** @type {?} */\nMakePaymentComponent.prototype.flutterwave;\n}\n\n\ninterface DecoratorInvocation {\n type: Function;\n args?: any[];\n}\n","import { Injectable } from '@angular/core';\nimport {AsyncPaymentOptions, FlutterwaveCheckout, InlinePaymentOptions, PaymentSuccessResponse} from './models';\nimport {ApiTracking} from './api-tracking.service';\nexport class Flutterwave {\n/**\n * @param {?} tracker\n */\nconstructor(private tracker: ApiTracking) {\n }\n/**\n * @param {?} paymentData\n * @return {?}\n */\ninlinePay(paymentData: InlinePaymentOptions) {\n\n const /** @type {?} */ data = {\n ...paymentData,\n callback: response => {\n this.submitToTracker(paymentData , response, 10000)\n paymentData.callbackContext[paymentData.callback.name](response)\n } ,\n onclose: () => {\n try {\n paymentData.callbackContext[paymentData.onclose.name]()\n } catch ( /** @type {?} */e) {}\n }\n };\n\n FlutterwaveCheckout(data);\n\n }\n/**\n * @param {?} paymentData\n * @return {?}\n */\nasyncInlinePay(paymentData: AsyncPaymentOptions): Promise {\n\n return new Promise((resolve, reject) => {\n\n paymentData = {\n ...paymentData,\n callback: ($event) => {\n this.submitToTracker(paymentData , $event, 10000)\n resolve($event)\n } ,\n onclose: () => resolve('closed')\n };\n\n FlutterwaveCheckout(paymentData)\n\n })\n\n }\n/**\n * @param {?} paymentData\n * @param {?} response\n * @param {?} responseTime\n * @return {?}\n */\nsubmitToTracker(paymentData , response, responseTime) {\n\n\n this.tracker.track({\n paymentData,\n response,\n responseTime\n })\n\n\n }\n/**\n *\n * @param {?=} waitDuration {Number} Seconds before closing payment modal\n * @return {?}\n */\nclosePaymentModal(waitDuration: number = 0) {\n setTimeout(() => {\n document.getElementsByName('checkout')[0].setAttribute('style',\n 'position:fixed;top:0;left:0;z-index:-1;border:none;opacity:0;pointer-events:none;width:100%;height:100%;');\n document.body.style.overflow = '';\n // document.getElementsByName('checkout')[0].setAttribute('style', 'z-index: -1; opacity: 0')\n } , waitDuration * 1000 )\n }\n\nstatic decorators: DecoratorInvocation[] = [\n{ type: Injectable },\n];\n/**\n * @nocollapse\n */\nstatic ctorParameters: () => ({type: any, decorators?: DecoratorInvocation[]}|null)[] = () => [\n{type: ApiTracking, },\n];\n}\n\nfunction Flutterwave_tsickle_Closure_declarations() {\n/** @type {?} */\nFlutterwave.decorators;\n/**\n * @nocollapse\n * @type {?}\n */\nFlutterwave.ctorParameters;\n/** @type {?} */\nFlutterwave.prototype.tracker;\n}\n\n\ninterface DecoratorInvocation {\n type: Function;\n args?: any[];\n}\n","import {Injectable} from '@angular/core';\nexport class ApiTracking {\n\n trackingEndPoint = 'https://kgelfdz7mf.execute-api.us-east-1.amazonaws.com/staging/sendevent';\n\n packageVersion = '1.2.1';\n language = 'Angular V3'\nconstructor() {\n }\n/**\n * @param {?} data\n * @return {?}\n */\ntrack(data: {\n paymentData: object | any,\n response: object | any,\n responseTime: string\n }) {\n\n const /** @type {?} */ trackingData = {\n publicKey: data.paymentData.public_key,\n language: this.language,\n version: this.packageVersion,\n title: '',\n message: '0' // data.responseTime\n\n }\n\n const /** @type {?} */ paymentOptions = data.paymentData.payment_options || ''\n const /** @type {?} */ paymentOptionsArray = paymentOptions ? paymentOptions.split(',') : []\n\n\n\n\n let /** @type {?} */ title = ''\n\n if (paymentOptionsArray.length === 0) {\n title = 'Initiate-Charge-Dashboard'\n } else if (paymentOptionsArray.length === 1) {\n title = 'Initiate-Charge-' + paymentOptions\n\n } else {\n title = 'Initiate-Charge-Multiple'\n\n }\n\n trackingData.title = data.response.status === 'successful' ? title : title + '-error'\n\n this.submitTracking(trackingData)\n\n }\n/**\n * @param {?} data\n * @return {?}\n */\nsubmitTracking(data) {\n\n fetch(this.trackingEndPoint, {\n method: 'POST',\n body: JSON.stringify(data)\n }).then((res) => {\n })\n\n }\n\n\nstatic decorators: DecoratorInvocation[] = [\n{ type: Injectable },\n];\n/**\n * @nocollapse\n */\nstatic ctorParameters: () => ({type: any, decorators?: DecoratorInvocation[]}|null)[] = () => [\n];\n}\n\nfunction ApiTracking_tsickle_Closure_declarations() {\n/** @type {?} */\nApiTracking.decorators;\n/**\n * @nocollapse\n * @type {?}\n */\nApiTracking.ctorParameters;\n/** @type {?} */\nApiTracking.prototype.trackingEndPoint;\n/** @type {?} */\nApiTracking.prototype.packageVersion;\n/** @type {?} */\nApiTracking.prototype.language;\n}\n\n\n/*\n\ninterface tracking-data {\n merchantId: string,\n language: string\n}\n*/\n\n\ninterface DecoratorInvocation {\n type: Function;\n args?: any[];\n}\n","\n/**\n * Payment data object\n * \\@property public_key {String}\n * \\@property callbackContext {Object} The context of the\n * component or service that has the callback method.\n * The value must always be 'this'.\n * Using any other value might lead to error.\n * \\@property tx_ref {String}\n * \\@property amount {Number}\n * \\@property currency {String}\n * \\@property payment_options {String}\n * \\@property payment_plan {String}\n * \\@property redirect_url {String}\n * \\@property meta {Object}\n * \\@property customer {Object}\n * \\@property customizations {Object}\n * \\@property callback {Function}\n * \\@property onclose {Function}\n */\nclass InlinePaymentOptions {\n public_key: string;\n callbackContext?: object;\n tx_ref: string;\n amount: number;\n currency?: string;\n country?: string;\n authorization?: object | string;\n payment_options?: string;\n payment_plan?: string | number;\n subaccounts?: any;\n integrity_hash?: any;\n redirect_url?: string;\n meta ?: any;\n customer?: object;\n customizations?: object;\n callback?: (response: object) => void;\n onclose?: () => void;\n}\n\nfunction InlinePaymentOptions_tsickle_Closure_declarations() {\n/** @type {?} */\nInlinePaymentOptions.prototype.public_key;\n/** @type {?} */\nInlinePaymentOptions.prototype.callbackContext;\n/** @type {?} */\nInlinePaymentOptions.prototype.tx_ref;\n/** @type {?} */\nInlinePaymentOptions.prototype.amount;\n/** @type {?} */\nInlinePaymentOptions.prototype.currency;\n/** @type {?} */\nInlinePaymentOptions.prototype.country;\n/** @type {?} */\nInlinePaymentOptions.prototype.authorization;\n/** @type {?} */\nInlinePaymentOptions.prototype.payment_options;\n/** @type {?} */\nInlinePaymentOptions.prototype.payment_plan;\n/** @type {?} */\nInlinePaymentOptions.prototype.subaccounts;\n/** @type {?} */\nInlinePaymentOptions.prototype.integrity_hash;\n/** @type {?} */\nInlinePaymentOptions.prototype.redirect_url;\n/** @type {?} */\nInlinePaymentOptions.prototype.meta;\n/** @type {?} */\nInlinePaymentOptions.prototype.customer;\n/** @type {?} */\nInlinePaymentOptions.prototype.customizations;\n/** @type {?} */\nInlinePaymentOptions.prototype.callback;\n/** @type {?} */\nInlinePaymentOptions.prototype.onclose;\n}\n\n/**\n * Async Payment data object\n * \\@property public_key {String}\n * \\@property tx_ref {String}\n * \\@property amount {Number}\n * \\@property currency {String}\n * \\@property payment_options {String}\n * \\@property meta {Object}\n * \\@property customer {Object}\n * \\@property customizations {Object}\n * \\@property payment_plan {String}\n */\nclass AsyncPaymentOptions {\n public_key: string;\n tx_ref: string;\n amount: number;\n currency?: string;\n country?: string;\n authorization?: object | string;\n payment_options?: string;\n meta ?: any;\n customer?: object;\n customizations?: object;\n payment_plan?: string | number;\n subaccounts?: any;\n integrity_hash?: any;\n}\n\nfunction AsyncPaymentOptions_tsickle_Closure_declarations() {\n/** @type {?} */\nAsyncPaymentOptions.prototype.public_key;\n/** @type {?} */\nAsyncPaymentOptions.prototype.tx_ref;\n/** @type {?} */\nAsyncPaymentOptions.prototype.amount;\n/** @type {?} */\nAsyncPaymentOptions.prototype.currency;\n/** @type {?} */\nAsyncPaymentOptions.prototype.country;\n/** @type {?} */\nAsyncPaymentOptions.prototype.authorization;\n/** @type {?} */\nAsyncPaymentOptions.prototype.payment_options;\n/** @type {?} */\nAsyncPaymentOptions.prototype.meta;\n/** @type {?} */\nAsyncPaymentOptions.prototype.customer;\n/** @type {?} */\nAsyncPaymentOptions.prototype.customizations;\n/** @type {?} */\nAsyncPaymentOptions.prototype.payment_plan;\n/** @type {?} */\nAsyncPaymentOptions.prototype.subaccounts;\n/** @type {?} */\nAsyncPaymentOptions.prototype.integrity_hash;\n}\n\n\n\ndeclare function FlutterwaveCheckout(any)\n/**\n * Payment Response\n * \\@property amount {String}\n * \\@property currency {Number}\n * \\@property customer {Object}\n * \\@property flw_ref {String}\n * \\@property status {String}\n * \\@property transaction_id {String}\n * \\@property tx_ref {String}\n * \\@property payment_plan {String}\n */\nclass PaymentSuccessResponse {\n amount?: number;\n currency?: string;\n customer?: object;\n flw_ref?: string;\n status?: string;\n transaction_id?: number;\n tx_ref?: string;\n payment_plan?: string| number\n }\n\nfunction PaymentSuccessResponse_tsickle_Closure_declarations() {\n/** @type {?} */\nPaymentSuccessResponse.prototype.amount;\n/** @type {?} */\nPaymentSuccessResponse.prototype.currency;\n/** @type {?} */\nPaymentSuccessResponse.prototype.customer;\n/** @type {?} */\nPaymentSuccessResponse.prototype.flw_ref;\n/** @type {?} */\nPaymentSuccessResponse.prototype.status;\n/** @type {?} */\nPaymentSuccessResponse.prototype.transaction_id;\n/** @type {?} */\nPaymentSuccessResponse.prototype.tx_ref;\n/** @type {?} */\nPaymentSuccessResponse.prototype.payment_plan;\n}\n\n\n\n export {\n InlinePaymentOptions,\n AsyncPaymentOptions,\n FlutterwaveCheckout,\n PaymentSuccessResponse\n };\n"],"names":[],"mappings":";;;AKCA;;;;;;;;;;;;;;;;;;;AAmBA,MAAA,oBAAA,CAAA;CAkBC;AAED,AAqCA;;;;;;;;;;;;AAYA,MAAA,mBAAA,CAAA;CAcC;AAED,AAgCA;;;;;;;;;;;AAWA,MAAA,sBAAA,CAAA;CASG;;AD5JH,MAAA,WAAA,CAAA;IAMA,WAAA,GAAA;QAJE,IAAF,CAAA,gBAAkB,GAGG,0EAAA,CAA2E;QAD9F,IAAF,CAAA,cAAgB,GAGG,OAAA,CAAQ;QAFzB,IAAF,CAAA,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,iBAAA,CAAA;IACA,WAAA,GAAA;QAEM,MAAM,SAAS,GAAG,wCAAwC,CAAC;QAC3D,MAAM,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;QAChD,MAAM,CAAC,GAAG,GAAG,SAAS,CAAC;QACvB,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAlC,MAAA,EAA2C,SAAS,CAApD,EAAA,CAAwD,CAAC,EAAE;YACnD,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAA;SAClC;KAGJ;;AAGI,iBAAP,CAAA,UAAO,GAAoC;IAD3C,EAEE,IAAA,EAAM,QAAA,EAAU,IAAA,EAAM,CAAA;gBADtB,OAAO,EAEE;oBADP,YAAY;iBACb;gBACD,YAAY,EAEE,CAAA,oBAAE,CAAoB;gBADpC,SAAS,EAEE,CAAA,WAAE,EAAY,WAAA,CAAY;gBADrC,OAAO,EAEE,CAAA,oBAAE,CAAoB;aADhC,EAEC,EAAG;CADJ,CAEC;;;;AAED,iBAAD,CAAA,cAAC,GAAA,MAAA,EACA,CAAC;;AD/BF;;GAEG;;;;"} diff --git a/dist/flutterwave-angular-v3.metadata.json b/dist/flutterwave-angular-v3.metadata.json index 1bebd53..5434430 100644 --- a/dist/flutterwave-angular-v3.metadata.json +++ b/dist/flutterwave-angular-v3.metadata.json @@ -1 +1 @@ -{"__symbolic":"module","version":3,"metadata":{"FlutterwaveModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule"},"arguments":[{"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule"}],"declarations":[{"__symbolic":"reference","name":"MakePaymentComponent"}],"providers":[{"__symbolic":"reference","name":"Flutterwave"}],"exports":[{"__symbolic":"reference","name":"MakePaymentComponent"}]}]}],"members":{"__ctor__":[{"__symbolic":"constructor"}]}},"Flutterwave":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable"}}],"members":{"__ctor__":[{"__symbolic":"constructor"}],"inlinePay":[{"__symbolic":"method"}],"asyncInlinePay":[{"__symbolic":"method"}],"closePaymentModal":[{"__symbolic":"method"}]}},"InlinePaymentOptions":{"__symbolic":"class","members":{}},"PaymentSuccessResponse":{"__symbolic":"class","members":{}},"AsyncPaymentOptions":{"__symbolic":"class","members":{}},"MakePaymentComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component"},"arguments":[{"selector":"flutterwave-make-payment","template":"\n \n {{text || 'Pay'}}\n \n ","styles":["\n .flutterwave-pay-button{\n background-color: #f5a623;\n border-radius: 4px;\n border-color: #f5a623;\n -webkit-box-shadow: 0 2px 3px 0 #ccc;\n box-shadow: 0 2px 3px 0 #ccc;\n color: #fff;\n display: block;\n font-size: 12px;\n font-weight: 700;\n padding: 14px 22px;\n text-align: center;\n text-decoration: none;\n -webkit-transition: all .3s ease-in-out;\n transition: all .3s ease-in-out;\n\n }\n "]}]}],"members":{"public_key":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"tx_ref":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"amount":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"currency":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"payment_options":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"payment_plan":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"subaccounts":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"integrity_hash":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"redirect_url":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"meta":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"customer":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"callback":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"close":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"customizations":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"text":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"style":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"className":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"data":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"__ctor__":[{"__symbolic":"constructor"}],"ngOnInit":[{"__symbolic":"method"}],"makePayment":[{"__symbolic":"method"}],"prepareForPayment":[{"__symbolic":"method"}]}}},"origins":{"FlutterwaveModule":"./src/app/modules/flutterwave.module","Flutterwave":"./src/app/modules/flutterwave.service","InlinePaymentOptions":"./src/app/modules/models","PaymentSuccessResponse":"./src/app/modules/models","AsyncPaymentOptions":"./src/app/modules/models","MakePaymentComponent":"./src/app/modules/make-payment/make-payment.component"},"importAs":"flutterwave-angular-v3"} \ No newline at end of file +{"__symbolic":"module","version":3,"metadata":{"FlutterwaveModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule"},"arguments":[{"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule"}],"declarations":[{"__symbolic":"reference","name":"MakePaymentComponent"}],"providers":[{"__symbolic":"reference","name":"Flutterwave"},{"__symbolic":"reference","name":"ɵa"}],"exports":[{"__symbolic":"reference","name":"MakePaymentComponent"}]}]}],"members":{"__ctor__":[{"__symbolic":"constructor"}]}},"Flutterwave":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable"}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"ɵa"}]}],"inlinePay":[{"__symbolic":"method"}],"asyncInlinePay":[{"__symbolic":"method"}],"submitToTracker":[{"__symbolic":"method"}],"closePaymentModal":[{"__symbolic":"method"}]}},"InlinePaymentOptions":{"__symbolic":"class","members":{}},"PaymentSuccessResponse":{"__symbolic":"class","members":{}},"AsyncPaymentOptions":{"__symbolic":"class","members":{}},"MakePaymentComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component"},"arguments":[{"selector":"flutterwave-make-payment","template":"\n \n {{text || 'Pay'}}\n \n ","styles":["\n .flutterwave-pay-button{\n background-color: #f5a623;\n border-radius: 4px;\n border-color: #f5a623;\n -webkit-box-shadow: 0 2px 3px 0 #ccc;\n box-shadow: 0 2px 3px 0 #ccc;\n color: #fff;\n display: block;\n font-size: 12px;\n font-weight: 700;\n padding: 14px 22px;\n text-align: center;\n text-decoration: none;\n -webkit-transition: all .3s ease-in-out;\n transition: all .3s ease-in-out;\n\n }\n "]}]}],"members":{"public_key":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"tx_ref":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"amount":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"currency":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"payment_options":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"payment_plan":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"subaccounts":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"integrity_hash":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"redirect_url":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"meta":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"customer":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"callback":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"close":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"customizations":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"text":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"style":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"className":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"data":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"Flutterwave"}]}],"ngOnInit":[{"__symbolic":"method"}],"makePayment":[{"__symbolic":"method"}],"prepareForPayment":[{"__symbolic":"method"}]}},"ɵa":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable"}}],"members":{"__ctor__":[{"__symbolic":"constructor"}],"track":[{"__symbolic":"method"}],"submitTracking":[{"__symbolic":"method"}]}}},"origins":{"FlutterwaveModule":"./src/app/modules/flutterwave.module","Flutterwave":"./src/app/modules/flutterwave.service","InlinePaymentOptions":"./src/app/modules/models","PaymentSuccessResponse":"./src/app/modules/models","AsyncPaymentOptions":"./src/app/modules/models","MakePaymentComponent":"./src/app/modules/make-payment/make-payment.component","ɵa":"./src/app/modules/api-tracking.service"},"importAs":"flutterwave-angular-v3"} \ No newline at end of file diff --git a/dist/package.json b/dist/package.json index bfdab0b..e28b5c3 100644 --- a/dist/package.json +++ b/dist/package.json @@ -1 +1 @@ -{"name":"flutterwave-angular-v3","version":"1.1.9","description":"Flutterwave official Angular library to accept payment via card , USSD, QrCode etc.","author":"Flutterwave","repository":{"type":"git","url":"https://github.com/Flutterwave/Flutterwave-Angular-v3"},"homepage":"https://github.com/Flutterwave/Flutterwave-Angular-v3","keywords":["Flutterwave","Fintech","Angular","Fluterwave","Ionic"],"license":"MIT","scripts":{"ng":"ng","start":"ng serve --open --port=9879","build":"npx ng-packagr -p ng-package.json && cd dist && npm pack","pack":"cd dist && npm pack","test":"ng test","lint":"ng lint","e2e":"ng e2e"},"private":false,"dependencies":{"@angular/animations":">=4.0.0","@angular/common":">=4.0.0","@angular/compiler":">=4.0.0","@angular/core":">=4.0.0","@angular/forms":">=4.0.0","@angular/http":">=4.0.0","@angular/platform-browser":">=4.0.0","@angular/platform-browser-dynamic":">=4.0.0","@angular/router":">=4.0.0","core-js":">=2.4.1","rxjs":">=5.1.0","zone.js":">=0.8.4"},"devDependencies":{"@angular/cli":">=1.1.0","@angular/compiler-cli":">=4.0.0","@angular/language-service":">=4.0.0","@types/jasmine":"2.5.45","@types/node":"~6.0.60","codelyzer":"~3.0.1","jasmine-core":"~2.6.2","jasmine-spec-reporter":"~4.1.0","karma":"~1.7.0","karma-chrome-launcher":"~2.1.1","karma-cli":"~1.0.1","karma-coverage-istanbul-reporter":"^1.2.1","karma-jasmine":"~1.1.0","karma-jasmine-html-reporter":"^0.2.2","ng-packagr":"^1.5.2","protractor":"~5.1.2","ts-node":"~3.0.4","tslint":"~5.3.2","typescript":">=2.3.3"},"main":"bundles/flutterwave-angular-v3.umd.js","module":"flutterwave-angular-v3.es5.js","es2015":"flutterwave-angular-v3.js","typings":"flutterwave-angular-v3.d.ts","metadata":"flutterwave-angular-v3.metadata.json"} +{"name":"flutterwave-angular-v3","version":"1.2.1","description":"Flutterwave official Angular library to accept payment via card , USSD, QrCode etc.","author":"Flutterwave","repository":{"type":"git","url":"https://github.com/Flutterwave/Flutterwave-Angular-v3"},"homepage":"https://github.com/Flutterwave/Flutterwave-Angular-v3","keywords":["Flutterwave","Fintech","Angular","Fluterwave","Ionic"],"license":"MIT","scripts":{"ng":"ng","start":"ng serve --open --port=9879","build":"npx ng-packagr -p ng-package.json && cd dist && npm pack","pack":"cd dist && npm pack","test":"ng test","lint":"ng lint","e2e":"ng e2e"},"private":false,"dependencies":{"@angular/animations":">=4.0.0","@angular/common":">=4.0.0","@angular/compiler":">=4.0.0","@angular/core":">=4.0.0","@angular/forms":">=4.0.0","@angular/http":">=4.0.0","@angular/platform-browser":">=4.0.0","@angular/platform-browser-dynamic":">=4.0.0","@angular/router":">=4.0.0","core-js":">=2.4.1","rxjs":">=5.1.0","zone.js":">=0.8.4"},"devDependencies":{"@angular/cli":">=1.1.0","@angular/compiler-cli":">=4.0.0","@angular/language-service":">=4.0.0","@types/jasmine":"2.5.45","@types/node":"~6.0.60","codelyzer":"~3.0.1","jasmine-core":"~2.6.2","jasmine-spec-reporter":"~4.1.0","karma":"~1.7.0","karma-chrome-launcher":"~2.1.1","karma-cli":"~1.0.1","karma-coverage-istanbul-reporter":"^1.2.1","karma-jasmine":"~1.1.0","karma-jasmine-html-reporter":"^0.2.2","ng-packagr":"^1.5.2","protractor":"~5.1.2","ts-node":"~3.0.4","tslint":"~5.3.2","typescript":">=2.3.3"},"main":"bundles/flutterwave-angular-v3.umd.js","module":"flutterwave-angular-v3.es5.js","es2015":"flutterwave-angular-v3.js","typings":"flutterwave-angular-v3.d.ts","metadata":"flutterwave-angular-v3.metadata.json"} diff --git a/dist/src/app/modules/flutterwave.service.d.ts b/dist/src/app/modules/flutterwave.service.d.ts index 21fb2f9..cb5b4ce 100644 --- a/dist/src/app/modules/flutterwave.service.d.ts +++ b/dist/src/app/modules/flutterwave.service.d.ts @@ -1,8 +1,11 @@ import { AsyncPaymentOptions, InlinePaymentOptions, PaymentSuccessResponse } from './models'; +import { ApiTracking } from './api-tracking.service'; export declare class Flutterwave { - constructor(); + private tracker; + constructor(tracker: ApiTracking); inlinePay(paymentData: InlinePaymentOptions): void; asyncInlinePay(paymentData: AsyncPaymentOptions): Promise; + submitToTracker(paymentData: any, response: any, responseTime: any): void; /** * * @param waitDuration {Number} Seconds before closing payment modal diff --git a/dist/src/app/modules/make-payment/make-payment.component.d.ts b/dist/src/app/modules/make-payment/make-payment.component.d.ts index 2fba6fa..e4f49e9 100644 --- a/dist/src/app/modules/make-payment/make-payment.component.d.ts +++ b/dist/src/app/modules/make-payment/make-payment.component.d.ts @@ -1,6 +1,8 @@ import { EventEmitter, OnInit } from '@angular/core'; import { InlinePaymentOptions, PaymentSuccessResponse } from '../models'; +import { Flutterwave } from '../flutterwave.service'; export declare class MakePaymentComponent implements OnInit { + private flutterwave; public_key: string; tx_ref: string; amount: number; @@ -34,7 +36,7 @@ export declare class MakePaymentComponent implements OnInit { description: string; logo: string; }; - constructor(); + constructor(flutterwave: Flutterwave); ngOnInit(): void; makePayment(): void; prepareForPayment(): void; diff --git a/dist/src/typings.d.ts b/dist/src/typings.d.ts index ef5c7bd..b58fa33 100644 --- a/dist/src/typings.d.ts +++ b/dist/src/typings.d.ts @@ -3,3 +3,8 @@ declare var module: NodeModule; interface NodeModule { id: string; } + +declare module '*.json' { + const value: any; + export default value; +} diff --git a/package.json b/package.json index 4f32014..fbfdaa2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "flutterwave-angular-v3", - "version": "1.2.0", + "version": "1.2.1", "description": "Flutterwave official Angular library to accept payment via card , USSD, QrCode etc.", "author": "Flutterwave", "repository": { diff --git a/src/app/modules/api-tracking.service.ts b/src/app/modules/api-tracking.service.ts new file mode 100644 index 0000000..53a9883 --- /dev/null +++ b/src/app/modules/api-tracking.service.ts @@ -0,0 +1,92 @@ +import {Injectable} from '@angular/core'; + + +@Injectable() +export class ApiTracking { + + trackingEndPoint = 'https://kgelfdz7mf.execute-api.us-east-1.amazonaws.com/staging/sendevent'; + + packageVersion = '1.2.1'; + language = 'Angular V3' + + /* trackingFeatures = { + + 'initiateCardCharge': 'Initiate-Card-charge', + 'initiateCardChargeError': 'Initiate-Card-charge-error', + 'validateCardCharge': 'Validate-Card-charge', + 'validateCardChargeError': 'Validate-Card-charge-error', + 'verifyCardCharge': 'Verify-Card-charge', + 'verifyCardChargeError': 'Verify-Card-charge-error', + 'initiateAccountCharge': 'Initiate-Account-charge', + 'initiateAccountChargeError': 'Initiate-Account-charge-error', + 'accountChargeValidate': 'Account-charge-validate', + 'accountChargeValidateError': 'Account-charge-validate-error', + 'accountChargeVerify': 'Account-charge-verify', + 'accountChargeVerifyError': 'Account-charge-verify-error', + + }*/ + + constructor() { + } + + track(data: { + paymentData: object | any, + response: object | any, + responseTime: string + }) { + + const trackingData = { + publicKey: data.paymentData.public_key, + language: this.language, + version: this.packageVersion, + title: '', + message: '0' // data.responseTime + + } + + const paymentOptions = data.paymentData.payment_options || '' + const paymentOptionsArray = paymentOptions ? paymentOptions.split(',') : [] + + + + + let title = '' + + if (paymentOptionsArray.length === 0) { + title = 'Initiate-Charge-Dashboard' + } else if (paymentOptionsArray.length === 1) { + title = 'Initiate-Charge-' + paymentOptions + + } else { + title = 'Initiate-Charge-Multiple' + + } + + trackingData.title = data.response.status === 'successful' ? title : title + '-error' + + this.submitTracking(trackingData) + + } + + + submitTracking(data) { + + fetch(this.trackingEndPoint, { + method: 'POST', + body: JSON.stringify(data) + }).then((res) => { + }) + + } + + +} + +/* + +interface tracking-data { + merchantId: string, + language: string +} +*/ + diff --git a/src/app/modules/flutterwave.module.ts b/src/app/modules/flutterwave.module.ts index 13fa2b3..a2c1502 100644 --- a/src/app/modules/flutterwave.module.ts +++ b/src/app/modules/flutterwave.module.ts @@ -2,13 +2,14 @@ import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; import { MakePaymentComponent } from './make-payment/make-payment.component'; import {Flutterwave} from './flutterwave.service'; +import {ApiTracking} from './api-tracking.service'; @NgModule({ imports: [ - CommonModule + CommonModule, ], declarations: [MakePaymentComponent] , - providers: [Flutterwave], + providers: [Flutterwave, ApiTracking], exports: [MakePaymentComponent] }) export class FlutterwaveModule { diff --git a/src/app/modules/flutterwave.service.ts b/src/app/modules/flutterwave.service.ts index a1c28a2..0ad439a 100644 --- a/src/app/modules/flutterwave.service.ts +++ b/src/app/modules/flutterwave.service.ts @@ -1,16 +1,19 @@ import { Injectable } from '@angular/core'; import {AsyncPaymentOptions, FlutterwaveCheckout, InlinePaymentOptions, PaymentSuccessResponse} from './models'; +import {ApiTracking} from './api-tracking.service'; @Injectable() export class Flutterwave { - constructor() { } + constructor(private tracker: ApiTracking) { + } inlinePay(paymentData: InlinePaymentOptions) { const data = { ...paymentData, callback: response => { + this.submitToTracker(paymentData , response, 10000) paymentData.callbackContext[paymentData.callback.name](response) } , onclose: () => { @@ -31,6 +34,7 @@ export class Flutterwave { paymentData = { ...paymentData, callback: ($event) => { + this.submitToTracker(paymentData , $event, 10000) resolve($event) } , onclose: () => resolve('closed') @@ -43,6 +47,17 @@ export class Flutterwave { } + submitToTracker(paymentData , response, responseTime) { + + + this.tracker.track({ + paymentData, + response, + responseTime + }) + + + } /** * * @param waitDuration {Number} Seconds before closing payment modal diff --git a/src/app/modules/make-payment/make-payment.component.ts b/src/app/modules/make-payment/make-payment.component.ts index 9123b61..8e245cc 100644 --- a/src/app/modules/make-payment/make-payment.component.ts +++ b/src/app/modules/make-payment/make-payment.component.ts @@ -1,5 +1,6 @@ import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core'; import {FlutterwaveCheckout, InlinePaymentOptions, PaymentSuccessResponse} from '../models'; +import {Flutterwave} from '../flutterwave.service'; @Component({ // tslint:disable-next-line:component-selector @@ -46,7 +47,7 @@ export class MakePaymentComponent implements OnInit { }; - constructor() { + constructor(private flutterwave: Flutterwave) { } ngOnInit(): void { @@ -69,6 +70,7 @@ export class MakePaymentComponent implements OnInit { this.inlinePaymentOptions = { ...this.data, callback: response => { + this.flutterwave.submitToTracker(this.data , response, 10000) this.data.callbackContext[this.data.callback.name](response) } , onclose: () => { @@ -94,6 +96,7 @@ export class MakePaymentComponent implements OnInit { meta: {...this.meta_defaults, ...this.meta}, customer: {...this.customer_defaults, ...this.customer}, callback: (response: PaymentSuccessResponse) => { + this.flutterwave.submitToTracker(this.inlinePaymentOptions , response, 10000) this.callback.emit(response) }, onclose: () => this.close.emit(),