@fat-zebra/sdk 1.5.11 → 1.5.12-beta.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.
@@ -0,0 +1,13 @@
1
+ version: 2
2
+ registries:
3
+ cloudsmith_npm:
4
+ type: npm-registry
5
+ url: https://npm.cloudsmith.io/fat-zebra/npm
6
+ token: ${{ secrets.CLOUDSMITH_NPM_PASSWORD }}
7
+ updates:
8
+ - package-ecosystem: npm
9
+ directories:
10
+ - .
11
+ schedule:
12
+ interval: weekly
13
+ registries: '*'
package/README.dev.md CHANGED
@@ -32,42 +32,6 @@ Install dependencies
32
32
  $ npm install
33
33
  ```
34
34
 
35
- ### Generate an access token
36
- Mechant developers would follow the [JS SDK setup guide](https://docs.fatzebra.com/docs/obtain-oauth-token) to create an OAuth Client first in order to generate temporary access tokens. To simplify the local development workflow, we can simply generate an access token using the script below.
37
-
38
- Please note that the access token created will have a lifespan of 1 year!
39
-
40
- ```bash
41
-
42
- # The secret used for encoding JWT. Please make sure it is the same as the one used for decoding in PayNow and/or Gateway. Otherwise requests will get rejected.
43
- $ export JWT_HMAC_SECRET=fatzebra
44
-
45
- # Specify who the access token is created for. A JWT token can only have one subject.
46
- $ export MERCHANT_USERNAME=<USERNAME>
47
-
48
- # Access token will be outputted to stdout.
49
- $ npm run generate:jwt
50
- ```
51
-
52
- ### Start mock merchant website using HPP mode
53
- ```bash
54
- # HPP integration mode: Geared for merchants that use FZ HPP to collect customers' credit card details.
55
- $ npm run start:<local|staging>:hpp
56
- ```
57
-
58
- ### Start mock merchant website using API mode
59
- You rarely need to work with this as most FZ features revolve around HPP.
60
- ```bash
61
- # API integration mode: Geared for merchants that own their own payments form to collect credit card details.
62
- $ npm run start:<local|staging>:api
63
-
64
- ```
65
- The commands above do the following.
66
- * Build javascript files specified in _src_ directory. The js bundle is outputted to _dist_ directory as fz.js.
67
- * The bundle is inserted into merchant website templates (at /examples/{mode}/merchant.ejs).
68
- * Start up webpack-dev-server. Open index.html in Safari.
69
- * The app will be hosted at http://localhost:8080
70
-
71
35
  ### Start PayNow
72
36
 
73
37
  ```bash
@@ -130,38 +94,6 @@ The deployed SDKs are available from the following URLs.
130
94
  * Sandbox: https://cdn.pmnts-sandbox.io/sdk/v1/fatzebra.js
131
95
  * Production: https://cdn.pmnts.io/sdk/v1/fatzebra.js
132
96
 
133
- ## Release react npm package
134
-
135
- Prerequisite: it is essential that you have been added to the https://www.npmjs.com/ group account.
136
-
137
- To release the react npm package
138
-
139
- ```
140
- git checkout master
141
- git pull
142
- ```
143
-
144
- then run
145
-
146
- ```
147
- npm run npm:publish
148
- ```
149
-
150
- You will be prompted with:
151
-
152
- ```
153
- enter (y) for minor release or (n) for patch release
154
- ```
155
-
156
- if it is a major release i.e. a breaking change please update the script/consult with management as major release would indicate a breaking change.
157
-
158
- You will then see the project build and finally be prompted to:
159
- ```
160
- Press ENTER to open in the browser...
161
- ```
162
-
163
- from here enter your 2FA code and voila! You have published a new version of the SDK. Go tell some merchants.
164
-
165
97
 
166
98
  ## Release Management
167
99
 
package/package.json CHANGED
@@ -1,23 +1,17 @@
1
1
  {
2
2
  "name": "@fat-zebra/sdk",
3
- "version": "1.5.11",
3
+ "version": "1.5.12-beta.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
7
7
  "test": "jest --clearCache && jest --passWithNoTests --verbose",
8
- "build:local": "cp .env.local .env && export ENVIRONMENT=local && npx webpack --config webpack.config.dev.js && node build-styles.js",
9
- "build:staging": "cp .env.staging .env && export ENVIRONMENT=staging && npx webpack --config webpack.config.dev.js && node build-styles.js",
10
- "build:sandbox": "cp .env.sandbox .env && export ENVIRONMENT=sandbox && npx webpack --config webpack.config.prod.js && node build-styles.js",
11
- "build:production": "cp .env.production .env && export ENVIRONMENT=production && npx webpack --config webpack.config.prod.js && node build-styles.js",
12
- "build:package": "tsc -p tsconfig.package.json && REACT=true ENVIRONMENT=production node build-styles.js",
13
- "start:local:api": "export MERCHANT_MODE=api && npm run build:local --watch && webpack serve --config webpack.config.dev.js --open 'Google Chrome'",
14
- "start:local:hpp": "export MERCHANT_MODE=hpp && npm run build:local --watch && webpack serve --config webpack.config.dev.js --open 'Google Chrome'",
15
- "start:staging:api": "export MERCHANT_MODE=api && npm run build:staging --watch && webpack serve --config webpack.config.dev.js --open 'Google Chrome'",
16
- "start:staging:hpp": "export MERCHANT_MODE=hpp && npm run build:staging --watch && webpack serve --config webpack.config.dev.js --open 'Google Chrome'",
17
- "start:staging:es5": "export MERCHANT_MODE=es5 && npm run build:staging --watch && webpack serve --config webpack.config.dev.js --open 'Google Chrome'",
18
- "start:docker": "npm run build:dev --watch && webpack serve --config webpack.config.dev.js --host 0.0.0.0",
19
- "generate:jwt": "node scripts/generate-access-token.js",
20
- "npm:publish": "ts-node scripts/release-package.ts",
8
+ "build": "ts-node ./build.ts && npm run build:styles",
9
+ "build:local": "cp .env.local .env && export ENVIRONMENT=local && npm run build",
10
+ "build:staging": "cp .env.staging .env && export ENVIRONMENT=staging && npm run build",
11
+ "build:sandbox": "cp .env.sandbox .env && export ENVIRONMENT=sandbox && npm run build",
12
+ "build:production": "cp .env.production .env && export ENVIRONMENT=production && npm run build",
13
+ "build:package": "tsc -p tsconfig.package.json && REACT=true ENVIRONMENT=production",
14
+ "build:styles": "node build-styles.js",
21
15
  "prepare": "husky install"
22
16
  },
23
17
  "keywords": [],
@@ -44,9 +38,8 @@
44
38
  "commitizen": "^4.3.1",
45
39
  "cz-conventional-changelog": "^3.3.0",
46
40
  "dotenv": "^16.0.1",
47
- "dotenv-webpack": "^8.0.0",
48
41
  "ejs": "^3.0.1",
49
- "html-webpack-plugin": "^5.3.1",
42
+ "esbuild": "^0.25.10",
50
43
  "husky": "^8.0.0",
51
44
  "jest": "^29.6.1",
52
45
  "jest-environment-jsdom": "^29.6.1",
@@ -61,10 +54,7 @@
61
54
  "ts-jest": "^29.1.1",
62
55
  "ts-loader": "^9.4.4",
63
56
  "ts-node": "^10.9.2",
64
- "typescript": "^5.1.6",
65
- "webpack": "^5.76.0",
66
- "webpack-cli": "^4.10.0",
67
- "webpack-dev-server": "^4.7.4"
57
+ "typescript": "^5.1.6"
68
58
  },
69
59
  "dependencies": {
70
60
  "ajv": "^8.17.1",
package/dist/fatzebra.css DELETED
@@ -1,91 +0,0 @@
1
- .checkout-button-wrapper {
2
- display: flex;
3
- justify-content: center;
4
- align-items: center;
5
- height: 200px;
6
- }
7
-
8
- .iframe-checkout {
9
- flex: 1;
10
- border: none;
11
- width: 100%;
12
- height: 100%;
13
- min-height: 0;
14
- overflow: auto;
15
- -webkit-overflow-scrolling: touch;
16
- }
17
-
18
- .iframe-foreground,
19
- .iframe-background {
20
- top: 0;
21
- left: 0;
22
- right: 0;
23
- bottom: 0;
24
- flex-direction: column;
25
- }
26
-
27
- .iframe-foreground,
28
- .iframe-background {
29
- position: fixed;
30
- }
31
-
32
- .iframe-foreground {
33
- z-index: -1;
34
- }
35
-
36
- .iframe-background {
37
- background: rgba(0, 0, 0, 0.5);
38
- }
39
-
40
- .iframe-foreground {
41
- flex-grow: 1;
42
- top: auto;
43
- width: 100%;
44
- max-width: 480px;
45
- height: 80vh;
46
- background-color: #ffffff;
47
- border-radius: 25px 25px 0 0;
48
- }
49
-
50
- .slide-in .iframe-foreground {
51
- transform: translateY(100vh);
52
- transition: transform 0.4s ease, z-index 0.3s ease 0.4s;
53
- z-index: -1;
54
- }
55
-
56
- .slide-in .iframe-background {
57
- opacity: 0;
58
- z-index: -1;
59
- transition: opacity 0.3s ease, z-index 0.3s ease 0.3s;
60
- }
61
-
62
- .slide-in.show .iframe-foreground {
63
- transform: none;
64
- transition: transform 0.4s ease;
65
- z-index: 100;
66
- }
67
-
68
- .slide-in.show .iframe-background {
69
- opacity: 1;
70
- z-index: 0;
71
- transition: opacity 0.3s ease;
72
- }
73
-
74
- @media only screen and (min-width: 480px) {
75
- .iframe-foreground {
76
- margin: 0 auto;
77
- }
78
- }
79
-
80
- @media only screen and (min-width: 768px) {
81
- .iframe-foreground {
82
- margin: 0;
83
- width: 400px;
84
- height: 100vh;
85
- left: 0;
86
- }
87
-
88
- .slide-in .iframe-foreground {
89
- transform: translateX(-400px);
90
- }
91
- }