ngx-culqi 2.0.3 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/fesm2022/ngx-culqi.mjs +3 -3
- package/fesm2022/ngx-culqi.mjs.map +1 -1
- package/package.json +5 -7
- package/{lib/ngx-culqi.service.d.ts → types/ngx-culqi.d.ts} +77 -5
- package/esm2022/lib/models/culqi.model.mjs +0 -2
- package/esm2022/lib/ngx-culqi.service.mjs +0 -115
- package/esm2022/ngx-culqi.mjs +0 -5
- package/esm2022/public-api.mjs +0 -5
- package/index.d.ts +0 -5
- package/lib/models/culqi.model.d.ts +0 -70
- package/public-api.d.ts +0 -3
package/README.md
CHANGED
|
@@ -31,7 +31,7 @@ UNOFFICIAL [Culqi](https://culqi.com/) payment gateway library made to use with
|
|
|
31
31
|
|
|
32
32
|
## 🖥 Environment Support
|
|
33
33
|
|
|
34
|
-
* Angular `^
|
|
34
|
+
* Angular `^21.0.0` [](https://www.npmjs.org/package/ngx-culqi)
|
|
35
35
|
|
|
36
36
|
## 📦 Installation
|
|
37
37
|
|
|
@@ -121,6 +121,6 @@ I welcome all contributions. Please read our [CONTRIBUTING.md](https://github.co
|
|
|
121
121
|
|
|
122
122
|
## 🎉 Author
|
|
123
123
|
|
|
124
|
-
- [Luis Eduardo](https://lperezp.dev/?utm_source=ngx-culqi&utm_medium=readme&utm_campaign=ngx-culqi&utm_id=github)
|
|
124
|
+
- [Luis Eduardo (lperezp)](https://lperezp.dev/?utm_source=ngx-culqi&utm_medium=readme&utm_campaign=ngx-culqi&utm_id=github)
|
|
125
125
|
|
|
126
126
|
**Love ngx-culqi? Give our repo a star :star: :arrow_up:.**
|
package/fesm2022/ngx-culqi.mjs
CHANGED
|
@@ -104,10 +104,10 @@ class NgxCulqiService {
|
|
|
104
104
|
this.tokenCreatedSubject.unsubscribe();
|
|
105
105
|
this.orderCreatedSubject.unsubscribe();
|
|
106
106
|
}
|
|
107
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
108
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
107
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: NgxCulqiService, deps: [{ token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
108
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: NgxCulqiService, providedIn: 'root' }); }
|
|
109
109
|
}
|
|
110
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
110
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: NgxCulqiService, decorators: [{
|
|
111
111
|
type: Injectable,
|
|
112
112
|
args: [{
|
|
113
113
|
providedIn: 'root'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngx-culqi.mjs","sources":["../../../projects/ngx-culqi/src/lib/ngx-culqi.service.ts","../../../projects/ngx-culqi/src/public-api.ts","../../../projects/ngx-culqi/src/ngx-culqi.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { HttpClient } from '@angular/common/http';\nimport { BehaviorSubject, Observable } from 'rxjs';\nimport { ICulqiOptions, ICulqiSettings, IOrderCulqi, IOrderCulqiResponse } from './models/culqi.model';\nexport declare let Culqi: any;\n\n@Injectable({\n providedIn: 'root'\n})\nexport class NgxCulqiService {\n tokenCreatedSubject = new BehaviorSubject<string | null>(null);\n tokenCreated$ = this.tokenCreatedSubject.asObservable();\n\n orderCreatedSubject = new BehaviorSubject<string | null>(null);\n orderCreated$ = this.orderCreatedSubject.asObservable();\n\n apiKeyCulqi: string | null = null;\n\n constructor(private http: HttpClient) {\n (window as any).culqi = this.culqi.bind(this);\n }\n\n /**\n * @param {value} value of the token created by Culqi for backend\n */\n setTokenCreated(value: string): void {\n this.tokenCreatedSubject.next(value);\n }\n\n /**\n * @param {value} value of the order id created by Culqi\n */\n setOrderCreated(value: string): void {\n this.orderCreatedSubject.next(value);\n }\n\n /**\n * @param {tokenCulqi} token offered by Culqi\n */\n initCulqi(tokenCulqi: string): void {\n Culqi.publicKey = tokenCulqi;\n }\n\n /**\n * @param {tokenCulqi} token offered by Culqi\n * @param {apiKeyCulqi} apiKey offered by Culqi\n */\n loadScriptCulqi(tokenCulqi: string, apiKeyCulqi: string): void {\n const script = document.createElement('script');\n script.type = 'text/javascript';\n script.src = 'https://checkout.culqi.com/js/v4';\n script.onload = () => {\n this.initCulqi(tokenCulqi);\n this.apiKeyCulqi = apiKeyCulqi;\n };\n document.head.appendChild(script);\n }\n\n /**\n * @param {order} order to be created for generate a payment\n * @returns returns the order created by Culqi API\n */\n generateOrder(order: IOrderCulqi): Observable<Partial<IOrderCulqiResponse>> {\n return this.http.post('https://api.culqi.com/v2/orders', order, {\n headers: {\n Authorization: `Bearer ${this.apiKeyCulqi}`\n }\n });\n }\n\n /**\n * @param {culqiSettings} e-commerce setup\n * @param {culqiOptions} payment pop up configuration\n */\n generateToken(culqiSettings: ICulqiSettings, culqiOptions?: ICulqiOptions): void {\n if (Culqi) {\n Culqi.settings(culqiSettings);\n const options: ICulqiOptions = {\n lang: \"es\",\n installments: false,\n paymentMethods: {\n tarjeta: true,\n yape: true,\n bancaMovil: true,\n agente: true,\n billetera: true,\n cuotealo: true,\n },\n ...culqiOptions\n };\n Culqi.options(options);\n Culqi.open();\n }\n }\n\n /**\n * function for open Culqi payment pop up\n */\n culqi(): void {\n if (Culqi.token) {\n const token = Culqi.token.id;\n this.setTokenCreated(token);\n } else if (Culqi.order) {\n const order = Culqi.order;\n this.setOrderCreated(order);\n } else {\n throw new Error('Culqi has not been loaded correctly.', Culqi.error);\n }\n }\n\n /**\n * function for close Culqi payment pop up\n */\n closeCulqi(): void {\n Culqi.close();\n this.tokenCreatedSubject.unsubscribe();\n this.orderCreatedSubject.unsubscribe();\n }\n}\n","/*\n * Public API Surface of ngx-culqi\n */\n\nexport * from './lib/ngx-culqi.service';\nexport { ICulqiOptions, IOrderCulqiResponse } from './lib/models/culqi.model';","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;MASa,eAAe,CAAA;AAS1B,IAAA,WAAA,CAAoB,IAAgB,EAAA;QAAhB,
|
|
1
|
+
{"version":3,"file":"ngx-culqi.mjs","sources":["../../../projects/ngx-culqi/src/lib/ngx-culqi.service.ts","../../../projects/ngx-culqi/src/public-api.ts","../../../projects/ngx-culqi/src/ngx-culqi.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { HttpClient } from '@angular/common/http';\nimport { BehaviorSubject, Observable } from 'rxjs';\nimport { ICulqiOptions, ICulqiSettings, IOrderCulqi, IOrderCulqiResponse } from './models/culqi.model';\nexport declare let Culqi: any;\n\n@Injectable({\n providedIn: 'root'\n})\nexport class NgxCulqiService {\n tokenCreatedSubject = new BehaviorSubject<string | null>(null);\n tokenCreated$ = this.tokenCreatedSubject.asObservable();\n\n orderCreatedSubject = new BehaviorSubject<string | null>(null);\n orderCreated$ = this.orderCreatedSubject.asObservable();\n\n apiKeyCulqi: string | null = null;\n\n constructor(private http: HttpClient) {\n (window as any).culqi = this.culqi.bind(this);\n }\n\n /**\n * @param {value} value of the token created by Culqi for backend\n */\n setTokenCreated(value: string): void {\n this.tokenCreatedSubject.next(value);\n }\n\n /**\n * @param {value} value of the order id created by Culqi\n */\n setOrderCreated(value: string): void {\n this.orderCreatedSubject.next(value);\n }\n\n /**\n * @param {tokenCulqi} token offered by Culqi\n */\n initCulqi(tokenCulqi: string): void {\n Culqi.publicKey = tokenCulqi;\n }\n\n /**\n * @param {tokenCulqi} token offered by Culqi\n * @param {apiKeyCulqi} apiKey offered by Culqi\n */\n loadScriptCulqi(tokenCulqi: string, apiKeyCulqi: string): void {\n const script = document.createElement('script');\n script.type = 'text/javascript';\n script.src = 'https://checkout.culqi.com/js/v4';\n script.onload = () => {\n this.initCulqi(tokenCulqi);\n this.apiKeyCulqi = apiKeyCulqi;\n };\n document.head.appendChild(script);\n }\n\n /**\n * @param {order} order to be created for generate a payment\n * @returns returns the order created by Culqi API\n */\n generateOrder(order: IOrderCulqi): Observable<Partial<IOrderCulqiResponse>> {\n return this.http.post('https://api.culqi.com/v2/orders', order, {\n headers: {\n Authorization: `Bearer ${this.apiKeyCulqi}`\n }\n });\n }\n\n /**\n * @param {culqiSettings} e-commerce setup\n * @param {culqiOptions} payment pop up configuration\n */\n generateToken(culqiSettings: ICulqiSettings, culqiOptions?: ICulqiOptions): void {\n if (Culqi) {\n Culqi.settings(culqiSettings);\n const options: ICulqiOptions = {\n lang: \"es\",\n installments: false,\n paymentMethods: {\n tarjeta: true,\n yape: true,\n bancaMovil: true,\n agente: true,\n billetera: true,\n cuotealo: true,\n },\n ...culqiOptions\n };\n Culqi.options(options);\n Culqi.open();\n }\n }\n\n /**\n * function for open Culqi payment pop up\n */\n culqi(): void {\n if (Culqi.token) {\n const token = Culqi.token.id;\n this.setTokenCreated(token);\n } else if (Culqi.order) {\n const order = Culqi.order;\n this.setOrderCreated(order);\n } else {\n throw new Error('Culqi has not been loaded correctly.', Culqi.error);\n }\n }\n\n /**\n * function for close Culqi payment pop up\n */\n closeCulqi(): void {\n Culqi.close();\n this.tokenCreatedSubject.unsubscribe();\n this.orderCreatedSubject.unsubscribe();\n }\n}\n","/*\n * Public API Surface of ngx-culqi\n */\n\nexport * from './lib/ngx-culqi.service';\nexport { ICulqiOptions, IOrderCulqiResponse } from './lib/models/culqi.model';","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;MASa,eAAe,CAAA;AAS1B,IAAA,WAAA,CAAoB,IAAgB,EAAA;QAAhB,IAAA,CAAA,IAAI,GAAJ,IAAI;AARxB,QAAA,IAAA,CAAA,mBAAmB,GAAG,IAAI,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C,WAAW,EAAE;AACtC,QAAA,IAAI,CAAC,mBAAmB,CAAC,WAAW,EAAE;IACxC;8GA5GW,eAAe,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAA,EAAA,CAAA,UAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAf,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,eAAe,cAFd,MAAM,EAAA,CAAA,CAAA;;2FAEP,eAAe,EAAA,UAAA,EAAA,CAAA;kBAH3B,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE;AACb,iBAAA;;;ACRD;;AAEG;;ACFH;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ngx-culqi",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "UNOFFICIAL Culqi payment gateway library made to use with Angular by lperezp.dev",
|
|
5
5
|
"author": "Luis Eduardo <luiseperezp.10@gmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
"ngx-culqi"
|
|
14
14
|
],
|
|
15
15
|
"peerDependencies": {
|
|
16
|
-
"@angular/common": "^
|
|
17
|
-
"@angular/core": "^
|
|
16
|
+
"@angular/common": "^21.1.0",
|
|
17
|
+
"@angular/core": "^21.1.0"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"tslib": "^2.3.0"
|
|
@@ -28,15 +28,13 @@
|
|
|
28
28
|
"url": "https://github.com/lperezp/ngx-culqi/issues"
|
|
29
29
|
},
|
|
30
30
|
"module": "fesm2022/ngx-culqi.mjs",
|
|
31
|
-
"typings": "
|
|
31
|
+
"typings": "types/ngx-culqi.d.ts",
|
|
32
32
|
"exports": {
|
|
33
33
|
"./package.json": {
|
|
34
34
|
"default": "./package.json"
|
|
35
35
|
},
|
|
36
36
|
".": {
|
|
37
|
-
"types": "./
|
|
38
|
-
"esm2022": "./esm2022/ngx-culqi.mjs",
|
|
39
|
-
"esm": "./esm2022/ngx-culqi.mjs",
|
|
37
|
+
"types": "./types/ngx-culqi.d.ts",
|
|
40
38
|
"default": "./fesm2022/ngx-culqi.mjs"
|
|
41
39
|
}
|
|
42
40
|
}
|
|
@@ -1,10 +1,79 @@
|
|
|
1
|
-
/// <reference path="ngx-culqi.service.ngtypecheck.d.ts" />
|
|
2
1
|
import { HttpClient } from '@angular/common/http';
|
|
3
2
|
import { BehaviorSubject, Observable } from 'rxjs';
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
import * as i0 from '@angular/core';
|
|
4
|
+
|
|
5
|
+
interface ICulqiSettings {
|
|
6
|
+
title: string;
|
|
7
|
+
currency: string;
|
|
8
|
+
amount: number;
|
|
9
|
+
order: string | undefined;
|
|
10
|
+
xculqirsaid: string;
|
|
11
|
+
rsapublickey: string;
|
|
12
|
+
}
|
|
13
|
+
interface ICulqiOptions {
|
|
14
|
+
lang?: string;
|
|
15
|
+
installments?: boolean;
|
|
16
|
+
paymentMethods?: IPaymentMethods;
|
|
17
|
+
style?: IStyle;
|
|
18
|
+
}
|
|
19
|
+
interface IPaymentMethods {
|
|
20
|
+
tarjeta: boolean;
|
|
21
|
+
yape: boolean;
|
|
22
|
+
bancaMovil: boolean;
|
|
23
|
+
agente: boolean;
|
|
24
|
+
billetera: boolean;
|
|
25
|
+
cuotealo: boolean;
|
|
26
|
+
}
|
|
27
|
+
interface IStyle {
|
|
28
|
+
logo: string;
|
|
29
|
+
bannerColor?: string;
|
|
30
|
+
buttonBackground?: string;
|
|
31
|
+
menuColor?: string;
|
|
32
|
+
linksColor?: string;
|
|
33
|
+
buttonText?: string;
|
|
34
|
+
buttonTextColor?: string;
|
|
35
|
+
priceColor?: string;
|
|
36
|
+
}
|
|
37
|
+
interface IOrderCulqi {
|
|
38
|
+
amount: number;
|
|
39
|
+
currency_code: string;
|
|
40
|
+
description: string;
|
|
41
|
+
order_number: number;
|
|
42
|
+
client_details: IClientDetails;
|
|
43
|
+
expiration_date: number;
|
|
44
|
+
confirm: boolean;
|
|
45
|
+
}
|
|
46
|
+
interface IClientDetails {
|
|
47
|
+
first_name: string;
|
|
48
|
+
last_name: string;
|
|
49
|
+
email: string;
|
|
50
|
+
phone_number: string;
|
|
51
|
+
}
|
|
52
|
+
interface IOrderCulqiResponse {
|
|
53
|
+
object: string;
|
|
54
|
+
id: string;
|
|
55
|
+
amount: number;
|
|
56
|
+
payment_code: null;
|
|
57
|
+
currency_code: string;
|
|
58
|
+
description: string;
|
|
59
|
+
order_number: string;
|
|
60
|
+
state: string;
|
|
61
|
+
total_fee: null;
|
|
62
|
+
net_amount: null;
|
|
63
|
+
fee_details: null;
|
|
64
|
+
creation_date: number;
|
|
65
|
+
expiration_date: number;
|
|
66
|
+
updated_at: number;
|
|
67
|
+
paid_at: null;
|
|
68
|
+
available_on: null;
|
|
69
|
+
metadata: null;
|
|
70
|
+
qr: null;
|
|
71
|
+
cuotealo: null;
|
|
72
|
+
url_pe: null;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
declare let Culqi: any;
|
|
76
|
+
declare class NgxCulqiService {
|
|
8
77
|
private http;
|
|
9
78
|
tokenCreatedSubject: BehaviorSubject<string | null>;
|
|
10
79
|
tokenCreated$: Observable<string | null>;
|
|
@@ -50,3 +119,6 @@ export declare class NgxCulqiService {
|
|
|
50
119
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgxCulqiService, never>;
|
|
51
120
|
static ɵprov: i0.ɵɵInjectableDeclaration<NgxCulqiService>;
|
|
52
121
|
}
|
|
122
|
+
|
|
123
|
+
export { Culqi, NgxCulqiService };
|
|
124
|
+
export type { ICulqiOptions, IOrderCulqiResponse };
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
export {};
|
|
2
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY3VscWkubW9kZWwuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9uZ3gtY3VscWkvc3JjL2xpYi9tb2RlbHMvY3VscWkubW9kZWwudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCBpbnRlcmZhY2UgSUN1bHFpU2V0dGluZ3Mge1xuICAgIHRpdGxlOiBzdHJpbmc7XG4gICAgY3VycmVuY3k6IHN0cmluZztcbiAgICBhbW91bnQ6IG51bWJlcjtcbiAgICBvcmRlcjogc3RyaW5nIHwgdW5kZWZpbmVkO1xuICAgIHhjdWxxaXJzYWlkOiBzdHJpbmc7XG4gICAgcnNhcHVibGlja2V5OiBzdHJpbmc7XG59XG5leHBvcnQgaW50ZXJmYWNlIElDdWxxaU9wdGlvbnMge1xuICAgIGxhbmc/OiBzdHJpbmc7XG4gICAgaW5zdGFsbG1lbnRzPzogYm9vbGVhbjtcbiAgICBwYXltZW50TWV0aG9kcz86IElQYXltZW50TWV0aG9kcztcbiAgICBzdHlsZT86IElTdHlsZVxufVxuXG5leHBvcnQgaW50ZXJmYWNlIElQYXltZW50TWV0aG9kcyB7XG4gICAgdGFyamV0YTogYm9vbGVhbjtcbiAgICB5YXBlOiBib29sZWFuO1xuICAgIGJhbmNhTW92aWw6IGJvb2xlYW47XG4gICAgYWdlbnRlOiBib29sZWFuO1xuICAgIGJpbGxldGVyYTogYm9vbGVhbjtcbiAgICBjdW90ZWFsbzogYm9vbGVhbjtcbn1cblxuZXhwb3J0IGludGVyZmFjZSBJU3R5bGUge1xuICAgIGxvZ286IHN0cmluZztcbiAgICBiYW5uZXJDb2xvcj86IHN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1xuICAgIGNyZWF0aW9uX2RhdGU6IG51bWJlcjtcbiAgICBleHBpcmF0aW9uX2RhdGU6IG51bWJlcjtcbiAgICB1cGRhdGVkX2F0OiBudW1iZXI7XG4gICAgcGFpZF9hdDogbnVsbDtcbiAgICBhdmFpbGFibGVfb246IG51bGw7XG4gICAgbWV0YWRhdGE6IG51bGw7XG4gICAgcXI6IG51bGw7XG4gICAgY3VvdGVhbG86IG51bGw7XG4gICAgdXJsX3BlOiBudWxsO1xufVxuIl19
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
import { Injectable } from '@angular/core';
|
|
2
|
-
import { BehaviorSubject } from 'rxjs';
|
|
3
|
-
import * as i0 from "@angular/core";
|
|
4
|
-
import * as i1 from "@angular/common/http";
|
|
5
|
-
export class NgxCulqiService {
|
|
6
|
-
constructor(http) {
|
|
7
|
-
this.http = http;
|
|
8
|
-
this.tokenCreatedSubject = new BehaviorSubject(null);
|
|
9
|
-
this.tokenCreated$ = this.tokenCreatedSubject.asObservable();
|
|
10
|
-
this.orderCreatedSubject = new BehaviorSubject(null);
|
|
11
|
-
this.orderCreated$ = this.orderCreatedSubject.asObservable();
|
|
12
|
-
this.apiKeyCulqi = null;
|
|
13
|
-
window.culqi = this.culqi.bind(this);
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* @param {value} value of the token created by Culqi for backend
|
|
17
|
-
*/
|
|
18
|
-
setTokenCreated(value) {
|
|
19
|
-
this.tokenCreatedSubject.next(value);
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* @param {value} value of the order id created by Culqi
|
|
23
|
-
*/
|
|
24
|
-
setOrderCreated(value) {
|
|
25
|
-
this.orderCreatedSubject.next(value);
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* @param {tokenCulqi} token offered by Culqi
|
|
29
|
-
*/
|
|
30
|
-
initCulqi(tokenCulqi) {
|
|
31
|
-
Culqi.publicKey = tokenCulqi;
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* @param {tokenCulqi} token offered by Culqi
|
|
35
|
-
* @param {apiKeyCulqi} apiKey offered by Culqi
|
|
36
|
-
*/
|
|
37
|
-
loadScriptCulqi(tokenCulqi, apiKeyCulqi) {
|
|
38
|
-
const script = document.createElement('script');
|
|
39
|
-
script.type = 'text/javascript';
|
|
40
|
-
script.src = 'https://checkout.culqi.com/js/v4';
|
|
41
|
-
script.onload = () => {
|
|
42
|
-
this.initCulqi(tokenCulqi);
|
|
43
|
-
this.apiKeyCulqi = apiKeyCulqi;
|
|
44
|
-
};
|
|
45
|
-
document.head.appendChild(script);
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* @param {order} order to be created for generate a payment
|
|
49
|
-
* @returns returns the order created by Culqi API
|
|
50
|
-
*/
|
|
51
|
-
generateOrder(order) {
|
|
52
|
-
return this.http.post('https://api.culqi.com/v2/orders', order, {
|
|
53
|
-
headers: {
|
|
54
|
-
Authorization: `Bearer ${this.apiKeyCulqi}`
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* @param {culqiSettings} e-commerce setup
|
|
60
|
-
* @param {culqiOptions} payment pop up configuration
|
|
61
|
-
*/
|
|
62
|
-
generateToken(culqiSettings, culqiOptions) {
|
|
63
|
-
if (Culqi) {
|
|
64
|
-
Culqi.settings(culqiSettings);
|
|
65
|
-
const options = {
|
|
66
|
-
lang: "es",
|
|
67
|
-
installments: false,
|
|
68
|
-
paymentMethods: {
|
|
69
|
-
tarjeta: true,
|
|
70
|
-
yape: true,
|
|
71
|
-
bancaMovil: true,
|
|
72
|
-
agente: true,
|
|
73
|
-
billetera: true,
|
|
74
|
-
cuotealo: true,
|
|
75
|
-
},
|
|
76
|
-
...culqiOptions
|
|
77
|
-
};
|
|
78
|
-
Culqi.options(options);
|
|
79
|
-
Culqi.open();
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
/**
|
|
83
|
-
* function for open Culqi payment pop up
|
|
84
|
-
*/
|
|
85
|
-
culqi() {
|
|
86
|
-
if (Culqi.token) {
|
|
87
|
-
const token = Culqi.token.id;
|
|
88
|
-
this.setTokenCreated(token);
|
|
89
|
-
}
|
|
90
|
-
else if (Culqi.order) {
|
|
91
|
-
const order = Culqi.order;
|
|
92
|
-
this.setOrderCreated(order);
|
|
93
|
-
}
|
|
94
|
-
else {
|
|
95
|
-
throw new Error('Culqi has not been loaded correctly.', Culqi.error);
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
/**
|
|
99
|
-
* function for close Culqi payment pop up
|
|
100
|
-
*/
|
|
101
|
-
closeCulqi() {
|
|
102
|
-
Culqi.close();
|
|
103
|
-
this.tokenCreatedSubject.unsubscribe();
|
|
104
|
-
this.orderCreatedSubject.unsubscribe();
|
|
105
|
-
}
|
|
106
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: NgxCulqiService, deps: [{ token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
107
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: NgxCulqiService, providedIn: 'root' }); }
|
|
108
|
-
}
|
|
109
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: NgxCulqiService, decorators: [{
|
|
110
|
-
type: Injectable,
|
|
111
|
-
args: [{
|
|
112
|
-
providedIn: 'root'
|
|
113
|
-
}]
|
|
114
|
-
}], ctorParameters: () => [{ type: i1.HttpClient }] });
|
|
115
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmd4LWN1bHFpLnNlcnZpY2UuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9wcm9qZWN0cy9uZ3gtY3VscWkvc3JjL2xpYi9uZ3gtY3VscWkuc2Vydm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5jdGlvbiBmb3IgY2xvc2UgQ3VscWkgcGF5bWVudCBwb3AgdXBcbiAgICAqL1xuICBjbG9zZUN1bHFpKCk6IHZvaWQge1xuICAgIEN1bHFpLmNsb3NlKCk7XG4gICAgdGhpcy50b2tlbkNyZWF0ZWRTdWJqZWN0LnVuc3Vic2NyaWJlKCk7XG4gICAgdGhpcy5vcmRlckNyZWF0ZWRTdWJqZWN0LnVuc3Vic2NyaWJlKCk7XG4gIH1cbn1cbiJdfQ==
|
package/esm2022/ngx-culqi.mjs
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Generated bundle index. Do not edit.
|
|
3
|
-
*/
|
|
4
|
-
export * from './public-api';
|
|
5
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmd4LWN1bHFpLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vcHJvamVjdHMvbmd4LWN1bHFpL3NyYy9uZ3gtY3VscWkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7O0dBRUc7QUFFSCxjQUFjLGNBQWMsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogR2VuZXJhdGVkIGJ1bmRsZSBpbmRleC4gRG8gbm90IGVkaXQuXG4gKi9cblxuZXhwb3J0ICogZnJvbSAnLi9wdWJsaWMtYXBpJztcbiJdfQ==
|
package/esm2022/public-api.mjs
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Public API Surface of ngx-culqi
|
|
3
|
-
*/
|
|
4
|
-
export * from './lib/ngx-culqi.service';
|
|
5
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljLWFwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3Byb2plY3RzL25neC1jdWxxaS9zcmMvcHVibGljLWFwaS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7R0FFRztBQUVILGNBQWMseUJBQXlCLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyIvKlxuICogUHVibGljIEFQSSBTdXJmYWNlIG9mIG5neC1jdWxxaVxuICovXG5cbmV4cG9ydCAqIGZyb20gJy4vbGliL25neC1jdWxxaS5zZXJ2aWNlJztcbmV4cG9ydCB7IElDdWxxaU9wdGlvbnMsIElPcmRlckN1bHFpUmVzcG9uc2UgfSBmcm9tICcuL2xpYi9tb2RlbHMvY3VscWkubW9kZWwnOyJdfQ==
|
package/index.d.ts
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
/// <reference path="culqi.model.ngtypecheck.d.ts" />
|
|
2
|
-
export interface ICulqiSettings {
|
|
3
|
-
title: string;
|
|
4
|
-
currency: string;
|
|
5
|
-
amount: number;
|
|
6
|
-
order: string | undefined;
|
|
7
|
-
xculqirsaid: string;
|
|
8
|
-
rsapublickey: string;
|
|
9
|
-
}
|
|
10
|
-
export interface ICulqiOptions {
|
|
11
|
-
lang?: string;
|
|
12
|
-
installments?: boolean;
|
|
13
|
-
paymentMethods?: IPaymentMethods;
|
|
14
|
-
style?: IStyle;
|
|
15
|
-
}
|
|
16
|
-
export interface IPaymentMethods {
|
|
17
|
-
tarjeta: boolean;
|
|
18
|
-
yape: boolean;
|
|
19
|
-
bancaMovil: boolean;
|
|
20
|
-
agente: boolean;
|
|
21
|
-
billetera: boolean;
|
|
22
|
-
cuotealo: boolean;
|
|
23
|
-
}
|
|
24
|
-
export interface IStyle {
|
|
25
|
-
logo: string;
|
|
26
|
-
bannerColor?: string;
|
|
27
|
-
buttonBackground?: string;
|
|
28
|
-
menuColor?: string;
|
|
29
|
-
linksColor?: string;
|
|
30
|
-
buttonText?: string;
|
|
31
|
-
buttonTextColor?: string;
|
|
32
|
-
priceColor?: string;
|
|
33
|
-
}
|
|
34
|
-
export interface IOrderCulqi {
|
|
35
|
-
amount: number;
|
|
36
|
-
currency_code: string;
|
|
37
|
-
description: string;
|
|
38
|
-
order_number: number;
|
|
39
|
-
client_details: IClientDetails;
|
|
40
|
-
expiration_date: number;
|
|
41
|
-
confirm: boolean;
|
|
42
|
-
}
|
|
43
|
-
export interface IClientDetails {
|
|
44
|
-
first_name: string;
|
|
45
|
-
last_name: string;
|
|
46
|
-
email: string;
|
|
47
|
-
phone_number: string;
|
|
48
|
-
}
|
|
49
|
-
export interface IOrderCulqiResponse {
|
|
50
|
-
object: string;
|
|
51
|
-
id: string;
|
|
52
|
-
amount: number;
|
|
53
|
-
payment_code: null;
|
|
54
|
-
currency_code: string;
|
|
55
|
-
description: string;
|
|
56
|
-
order_number: string;
|
|
57
|
-
state: string;
|
|
58
|
-
total_fee: null;
|
|
59
|
-
net_amount: null;
|
|
60
|
-
fee_details: null;
|
|
61
|
-
creation_date: number;
|
|
62
|
-
expiration_date: number;
|
|
63
|
-
updated_at: number;
|
|
64
|
-
paid_at: null;
|
|
65
|
-
available_on: null;
|
|
66
|
-
metadata: null;
|
|
67
|
-
qr: null;
|
|
68
|
-
cuotealo: null;
|
|
69
|
-
url_pe: null;
|
|
70
|
-
}
|
package/public-api.d.ts
DELETED