@tonder.io/ionic-full-sdk 0.0.27-beta → 0.0.29-beta

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.
@@ -0,0 +1,40 @@
1
+ export type Customer = {
2
+ firstName: string;
3
+ lastName: string;
4
+ country: string;
5
+ street: string;
6
+ city: string;
7
+ state: string;
8
+ postCode: string;
9
+ email: string;
10
+ phone: string;
11
+ };
12
+ export type Business = {
13
+ vault_id: string;
14
+ vault_url: string;
15
+ openpay_keys: {
16
+ merchant_id: string;
17
+ public_key: string;
18
+ };
19
+ reference: string;
20
+ business: {
21
+ pk: string;
22
+ };
23
+ };
24
+ export type OrderItem = {
25
+ description: string;
26
+ quantity: number;
27
+ price_unit: number;
28
+ discount: number;
29
+ taxes: number;
30
+ product_reference: number;
31
+ name: string;
32
+ amount_total: number;
33
+ };
34
+ export type PaymentData = {
35
+ customer: Customer;
36
+ cart: {
37
+ total: string | number;
38
+ items: OrderItem[];
39
+ };
40
+ };
@@ -33,6 +33,7 @@ export type OrderItem = {
33
33
  };
34
34
  export type PaymentData = {
35
35
  customer: Customer;
36
+ currency: string;
36
37
  cart: {
37
38
  total: string | number;
38
39
  items: OrderItem[];
@@ -0,0 +1,39 @@
1
+ type SkyflowRecord = {
2
+ method: string;
3
+ quorum?: boolean;
4
+ tableName: string;
5
+ fields?: {
6
+ [key: string]: string;
7
+ };
8
+ ID?: string;
9
+ tokenization?: boolean;
10
+ batchID?: string;
11
+ redaction?: "DEFAULT" | "REDACTED" | "MASKED" | "PLAIN_TEXT";
12
+ downloadURL?: boolean;
13
+ upsert?: string;
14
+ tokens?: {
15
+ [key: string]: string;
16
+ };
17
+ };
18
+ export type VaultRequest = {
19
+ records: SkyflowRecord[];
20
+ continueOnError?: boolean;
21
+ byot?: "DISABLE" | "ENABLE" | "ENABLE_STRICT";
22
+ };
23
+ export type TokensRequest = {
24
+ baseUrl: string;
25
+ vault_id: string;
26
+ vault_url: string;
27
+ apiKey: string;
28
+ signal: AbortSignal;
29
+ data: {
30
+ [key: string]: any;
31
+ };
32
+ };
33
+ export type TokensResponse = {
34
+ vaultID: string;
35
+ responses: {
36
+ [key: string]: string;
37
+ }[];
38
+ };
39
+ export {};
package/index.js.example CHANGED
@@ -1,50 +1,50 @@
1
- import { Checkout } from './classes/checkout'
2
- export {
3
- Checkout,
4
- }
5
-
6
- const config = {
7
- url: "http://localhost:8081/#/",
8
- apiKey: "e0f89d5328398b93634f56ba06c9474ec9388d5e",
9
- type: "payment",
10
- backgroundColor: "#F34616",
11
- color: "#F3F7F6"
12
- }
13
- const tonderCheckout = new Checkout(config)
14
- const params = {
15
- shippingCost: "129.99",
16
- email: "fuentesc91@gmail.com"
17
- }
18
- tonderCheckout.setOrder(params)
19
-
20
- let products = {products: [
21
- {
22
- name: 'first product',
23
- price_unit: 120.99,
24
- quantity: 1
25
- },
26
- {
27
- name: 'second product',
28
- price_unit: 12.99,
29
- }
30
- ]}
31
-
32
- tonderCheckout.setOrder(products)
33
-
34
- products = {products: [
35
- {
36
- name: 'first product',
37
- price_unit: 120.99,
38
- quantity: 3
39
- },
40
- {
41
- name: 'second product',
42
- price_unit: 12.99,
43
- }
44
- ]}
45
-
46
- tonderCheckout.setOrder(products)
47
-
48
- console.log(tonderCheckout.getUrlParams())
49
-
1
+ import { Checkout } from './classes/checkout'
2
+ export {
3
+ Checkout,
4
+ }
5
+
6
+ const config = {
7
+ url: "http://localhost:8081/#/",
8
+ apiKey: "e0f89d5328398b93634f56ba06c9474ec9388d5e",
9
+ type: "payment",
10
+ backgroundColor: "#F34616",
11
+ color: "#F3F7F6"
12
+ }
13
+ const tonderCheckout = new Checkout(config)
14
+ const params = {
15
+ shippingCost: "129.99",
16
+ email: "fuentesc91@gmail.com"
17
+ }
18
+ tonderCheckout.setOrder(params)
19
+
20
+ let products = {products: [
21
+ {
22
+ name: 'first product',
23
+ price_unit: 120.99,
24
+ quantity: 1
25
+ },
26
+ {
27
+ name: 'second product',
28
+ price_unit: 12.99,
29
+ }
30
+ ]}
31
+
32
+ tonderCheckout.setOrder(products)
33
+
34
+ products = {products: [
35
+ {
36
+ name: 'first product',
37
+ price_unit: 120.99,
38
+ quantity: 3
39
+ },
40
+ {
41
+ name: 'second product',
42
+ price_unit: 12.99,
43
+ }
44
+ ]}
45
+
46
+ tonderCheckout.setOrder(products)
47
+
48
+ console.log(tonderCheckout.getUrlParams())
49
+
50
50
  tonderCheckout.mountButton({ buttonText: 'Proceder al pago' })
package/package.json CHANGED
@@ -1,27 +1,27 @@
1
- {
2
- "name": "@tonder.io/ionic-full-sdk",
3
- "version": "0.0.27-beta",
4
- "description": "Tonder ionic full SDK",
5
- "main": "dist/index.js",
6
- "types": "dist/index.d.js",
7
- "scripts": {
8
- "build": "tsc -noEmit && rollup --config"
9
- },
10
- "author": "",
11
- "license": "ISC",
12
- "dependencies": {
13
- "@tonder.io/ionic-lite-sdk": "^0.0.29-beta",
14
- "crypto-js": "^4.1.1",
15
- "skyflow-js": "^1.34.1"
16
- },
17
- "devDependencies": {
18
- "@rollup/plugin-terser": "^0.4.4",
19
- "@rollup/plugin-typescript": "^11.1.6",
20
- "@types/crypto-js": "^4.2.2",
21
- "@types/node": "^20.11.5",
22
- "cypress": "^13.6.2",
23
- "rollup": "^4.9.6",
24
- "ts-loader": "^9.5.1",
25
- "typescript": "^5.3.3"
26
- }
27
- }
1
+ {
2
+ "name": "@tonder.io/ionic-full-sdk",
3
+ "version": "0.0.29-beta",
4
+ "description": "Tonder ionic full SDK",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.js",
7
+ "scripts": {
8
+ "build": "tsc -noEmit && rollup --config"
9
+ },
10
+ "author": "",
11
+ "license": "ISC",
12
+ "dependencies": {
13
+ "@tonder.io/ionic-lite-sdk": "^0.0.29-beta",
14
+ "crypto-js": "^4.1.1",
15
+ "skyflow-js": "^1.34.1"
16
+ },
17
+ "devDependencies": {
18
+ "@rollup/plugin-terser": "^0.4.4",
19
+ "@rollup/plugin-typescript": "^11.1.6",
20
+ "@types/crypto-js": "^4.2.2",
21
+ "@types/node": "^20.11.5",
22
+ "cypress": "^13.6.2",
23
+ "rollup": "^4.9.6",
24
+ "ts-loader": "^9.5.1",
25
+ "typescript": "^5.3.3"
26
+ }
27
+ }
package/rollup.config.js CHANGED
@@ -1,15 +1,15 @@
1
- const typescript = require('@rollup/plugin-typescript');
2
- const terser = require('@rollup/plugin-terser');
3
-
4
- module.exports = {
5
- input: './src/index.ts',
6
- output: {
7
- dir: 'dist',
8
- format: 'es',
9
- plugins: [terser()]
10
- },
11
- plugins: [
12
- typescript()
13
- ],
14
- external: ["skyflow-js", "crypto-js", "@tonder.io/ionic-lite-sdk"]
1
+ const typescript = require('@rollup/plugin-typescript');
2
+ const terser = require('@rollup/plugin-terser');
3
+
4
+ module.exports = {
5
+ input: './src/index.ts',
6
+ output: {
7
+ dir: 'dist',
8
+ format: 'es',
9
+ plugins: [terser()]
10
+ },
11
+ plugins: [
12
+ typescript()
13
+ ],
14
+ external: ["skyflow-js", "crypto-js", "@tonder.io/ionic-lite-sdk"]
15
15
  };