@solidgate/vue-sdk 1.0.1 → 1.1.1

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/CHANGELOG.md ADDED
@@ -0,0 +1,8 @@
1
+ **1.1.0**
2
+
3
+ ***
4
+
5
+ - Added **AdditionalFields** enum
6
+ - Fixed types which controlling labels visibility (like **initConfig.formParams.cardNumberLabel**)
7
+ - Deprecated **initConfig.allowedAdditionalFields** usage
8
+ - Added **CardMessage** event
package/LICENSE.md ADDED
@@ -0,0 +1,13 @@
1
+ Apache License, Version 2.0
2
+
3
+ Copyright 2015 - GTWS Tech Limited (https://solidgate.com/)
4
+
5
+ Licensed under the Apache License, Version 2.0 (the "License");
6
+ you may not use this file except in compliance with the License.
7
+ You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
8
+
9
+ Unless required by applicable law or agreed to in writing, software
10
+ distributed under the License is distributed on an "AS IS" BASIS,
11
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ See the License for the specific language governing permissions and
13
+ limitations under the License.
package/README.md CHANGED
@@ -30,7 +30,7 @@ const merchantData: InitConfig['merchantData'] = {
30
30
  </script>
31
31
  ```
32
32
 
33
- In order to render google/apple button in custom container define Payment as async component and pass l
33
+ In order to render google/apple button in custom container define Payment as async component and pass link to container element
34
34
  ```vue
35
35
  <template>
36
36
  <Payment
@@ -63,8 +63,8 @@ const merchantData: InitConfig['merchantData'] = {
63
63
  1. cd vue-sdk
64
64
  2. npm i
65
65
  3. npm run start
66
- 4. Navigate to `http://localhost:3000/`. The app will automatically reload if you change any of the
67
-
66
+ 4. Navigate to `http://localhost:3000/`.
67
+ 5.
68
68
  ## Build
69
69
 
70
70
  1. cd vue-sdk
@@ -1,4 +1,4 @@
1
- import { OrderStatusMessage, InteractionMessage, MountedMessage, SuccessMessage, ResizeMessage, SubmitMessage, ErrorMessage, FailMessage, SdkMessage, MessageType } from '@solidgate/client-sdk-loader';
1
+ import { CustomStylesAppendedMessage, OrderStatusMessage, InteractionMessage, RedirectMessage, MountedMessage, SuccessMessage, ResizeMessage, VerifyMessage, SubmitMessage, ErrorMessage, FailMessage, CardMessage } from '@solidgate/client-sdk-loader';
2
2
  declare const _default: import("vue").DefineComponent<{
3
3
  merchantData: {
4
4
  type: import("vue").PropType<{
@@ -27,12 +27,15 @@ declare const _default: import("vue").DefineComponent<{
27
27
  cardBrands: import("@solidgate/client-sdk-loader").CardBrand[];
28
28
  secureBrands: import("@solidgate/client-sdk-loader/dist/enums/SecureBrand").default[];
29
29
  allowSubmit: boolean;
30
- allowedAdditionalFields: import("@solidgate/client-sdk-loader/dist/enums/AdditionalField").default[];
31
30
  googleFontLink: string;
32
- }>>;
31
+ cardNumberLabel: string;
32
+ cardCvvLabel: string;
33
+ cardExpiryDateLabel: string;
34
+ } & Record<"zipСodeLabel" | "argentinaDniLabel" | "bangladeshNicLabel" | "boliviaCiLabel" | "brazilCpfLabel" | "cameroonCniLabel" | "chileCiLabel" | "chinaIdLabel" | "colombiaCcLabel" | "costaRicaCiLabel" | "dominicanaIdLabel" | "ecuadorCiLabel" | "elSalvadorIdLabel" | "egyptIdLabel" | "ghanaCardLabel" | "guatemalaCuiLabel" | "indiaPanLabel" | "indonesiaNikLabel" | "japanIdLabel" | "kenyaIdLabel" | "malaysiaNricLabel" | "mexicoCurpLabel" | "moroccoCnieLabel" | "nigeriaNinLabel" | "panamaIdLabel" | "paraguayCiLabel" | "peruDniLabel" | "philipinesPsnLabel" | "senegalCniLabel" | "southAfricaIdLabel" | "tanzaniaIdLabel" | "thailandIdLabel" | "turkeyTcKimlikNoLabel" | "ugandaNicLabel" | "uriguayCiLabel" | "vietnamVnidLabel", string>>>;
33
35
  };
34
36
  googlePayButtonParams: {
35
37
  type: import("vue").PropType<Omit<Partial<{
38
+ allowedAuthMethods: ["PAN_ONLY", "CRYPTOGRAM_3DS"] | ["PAN_ONLY"] | ["CRYPTOGRAM_3DS"];
36
39
  enabled: false;
37
40
  containerId: string;
38
41
  color: string;
@@ -82,17 +85,17 @@ declare const _default: import("vue").DefineComponent<{
82
85
  default: () => void;
83
86
  };
84
87
  onVerify: {
85
- type: import("vue").PropType<(e: SdkMessage[MessageType.Verify]) => void>;
88
+ type: import("vue").PropType<(e: VerifyMessage) => void>;
86
89
  } & {
87
90
  default: () => void;
88
91
  };
89
92
  onCustomStylesAppended: {
90
- type: import("vue").PropType<(e: SdkMessage[MessageType.CustomStylesAppended]) => void>;
93
+ type: import("vue").PropType<(e: CustomStylesAppendedMessage) => void>;
91
94
  } & {
92
95
  default: () => void;
93
96
  };
94
97
  onFormRedirect: {
95
- type: import("vue").PropType<(e: SdkMessage[MessageType.Redirect]) => void>;
98
+ type: import("vue").PropType<(e: RedirectMessage) => void>;
96
99
  } & {
97
100
  default: () => void;
98
101
  };
@@ -111,6 +114,11 @@ declare const _default: import("vue").DefineComponent<{
111
114
  } & {
112
115
  default: () => void;
113
116
  };
117
+ onCard: {
118
+ type: import("vue").PropType<(e: CardMessage) => void>;
119
+ } & {
120
+ default: () => void;
121
+ };
114
122
  }, () => void, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
115
123
  merchantData: {
116
124
  type: import("vue").PropType<{
@@ -139,12 +147,15 @@ declare const _default: import("vue").DefineComponent<{
139
147
  cardBrands: import("@solidgate/client-sdk-loader").CardBrand[];
140
148
  secureBrands: import("@solidgate/client-sdk-loader/dist/enums/SecureBrand").default[];
141
149
  allowSubmit: boolean;
142
- allowedAdditionalFields: import("@solidgate/client-sdk-loader/dist/enums/AdditionalField").default[];
143
150
  googleFontLink: string;
144
- }>>;
151
+ cardNumberLabel: string;
152
+ cardCvvLabel: string;
153
+ cardExpiryDateLabel: string;
154
+ } & Record<"zipСodeLabel" | "argentinaDniLabel" | "bangladeshNicLabel" | "boliviaCiLabel" | "brazilCpfLabel" | "cameroonCniLabel" | "chileCiLabel" | "chinaIdLabel" | "colombiaCcLabel" | "costaRicaCiLabel" | "dominicanaIdLabel" | "ecuadorCiLabel" | "elSalvadorIdLabel" | "egyptIdLabel" | "ghanaCardLabel" | "guatemalaCuiLabel" | "indiaPanLabel" | "indonesiaNikLabel" | "japanIdLabel" | "kenyaIdLabel" | "malaysiaNricLabel" | "mexicoCurpLabel" | "moroccoCnieLabel" | "nigeriaNinLabel" | "panamaIdLabel" | "paraguayCiLabel" | "peruDniLabel" | "philipinesPsnLabel" | "senegalCniLabel" | "southAfricaIdLabel" | "tanzaniaIdLabel" | "thailandIdLabel" | "turkeyTcKimlikNoLabel" | "ugandaNicLabel" | "uriguayCiLabel" | "vietnamVnidLabel", string>>>;
145
155
  };
146
156
  googlePayButtonParams: {
147
157
  type: import("vue").PropType<Omit<Partial<{
158
+ allowedAuthMethods: ["PAN_ONLY", "CRYPTOGRAM_3DS"] | ["PAN_ONLY"] | ["CRYPTOGRAM_3DS"];
148
159
  enabled: false;
149
160
  containerId: string;
150
161
  color: string;
@@ -194,17 +205,17 @@ declare const _default: import("vue").DefineComponent<{
194
205
  default: () => void;
195
206
  };
196
207
  onVerify: {
197
- type: import("vue").PropType<(e: SdkMessage[MessageType.Verify]) => void>;
208
+ type: import("vue").PropType<(e: VerifyMessage) => void>;
198
209
  } & {
199
210
  default: () => void;
200
211
  };
201
212
  onCustomStylesAppended: {
202
- type: import("vue").PropType<(e: SdkMessage[MessageType.CustomStylesAppended]) => void>;
213
+ type: import("vue").PropType<(e: CustomStylesAppendedMessage) => void>;
203
214
  } & {
204
215
  default: () => void;
205
216
  };
206
217
  onFormRedirect: {
207
- type: import("vue").PropType<(e: SdkMessage[MessageType.Redirect]) => void>;
218
+ type: import("vue").PropType<(e: RedirectMessage) => void>;
208
219
  } & {
209
220
  default: () => void;
210
221
  };
@@ -223,6 +234,11 @@ declare const _default: import("vue").DefineComponent<{
223
234
  } & {
224
235
  default: () => void;
225
236
  };
237
+ onCard: {
238
+ type: import("vue").PropType<(e: CardMessage) => void>;
239
+ } & {
240
+ default: () => void;
241
+ };
226
242
  }>>, {
227
243
  onError: (e: ErrorMessage) => void;
228
244
  onSubmit: (e: SubmitMessage) => void;
@@ -232,8 +248,9 @@ declare const _default: import("vue").DefineComponent<{
232
248
  onResize: (e: ResizeMessage) => void;
233
249
  onSuccess: (e: SuccessMessage) => void;
234
250
  onInteraction: (e: InteractionMessage) => void;
235
- onVerify: (e: SdkMessage[MessageType.Verify]) => void;
236
- onFormRedirect: (e: SdkMessage[MessageType.Redirect]) => void;
237
- onCustomStylesAppended: (e: SdkMessage[MessageType.CustomStylesAppended]) => void;
251
+ onCard: (e: CardMessage) => void;
252
+ onVerify: (e: VerifyMessage) => void;
253
+ onFormRedirect: (e: RedirectMessage) => void;
254
+ onCustomStylesAppended: (e: CustomStylesAppendedMessage) => void;
238
255
  }>;
239
256
  export default _default;
@@ -1927,19 +1927,9 @@ var MessageType$1;
1927
1927
  MessageType2["Interaction"] = "interaction";
1928
1928
  MessageType2["Submit"] = "submit";
1929
1929
  MessageType2["CustomStylesAppended"] = "customStylesAppended";
1930
+ MessageType2["Card"] = "card";
1930
1931
  })(MessageType$1 || (MessageType$1 = {}));
1931
1932
  MessageType$2.default = MessageType$1;
1932
- var AdditionalField$2 = {};
1933
- Object.defineProperty(AdditionalField$2, "__esModule", { value: true });
1934
- var AdditionalField$1;
1935
- (function(AdditionalField2) {
1936
- AdditionalField2["Zip"] = "ZIP";
1937
- AdditionalField2["Curp"] = "CURP";
1938
- AdditionalField2["Cpf"] = "CPF";
1939
- AdditionalField2["Dni"] = "DNI";
1940
- AdditionalField2["Pin"] = "PIN";
1941
- })(AdditionalField$1 || (AdditionalField$1 = {}));
1942
- AdditionalField$2.default = AdditionalField$1;
1943
1933
  var FieldName$2 = {};
1944
1934
  Object.defineProperty(FieldName$2, "__esModule", { value: true });
1945
1935
  var FieldName$1;
@@ -1948,11 +1938,6 @@ var FieldName$1;
1948
1938
  FieldName2["CardCvv"] = "cardCvv";
1949
1939
  FieldName2["CardHolder"] = "cardHolder";
1950
1940
  FieldName2["CardExpiryDate"] = "cardExpiryDate";
1951
- FieldName2["CardCpf"] = "cpf";
1952
- FieldName2["ZipCode"] = "zipCode";
1953
- FieldName2["CardDni"] = "dni";
1954
- FieldName2["CardPin"] = "cardPin";
1955
- FieldName2["CardCurp"] = "curp";
1956
1941
  })(FieldName$1 || (FieldName$1 = {}));
1957
1942
  FieldName$2.default = FieldName$1;
1958
1943
  var CardBrand$1 = {};
@@ -2025,6 +2010,48 @@ var InteractionTargetType$1;
2025
2010
  InteractionTargetType2["Button"] = "button";
2026
2011
  })(InteractionTargetType$1 || (InteractionTargetType$1 = {}));
2027
2012
  InteractionTargetType$2.default = InteractionTargetType$1;
2013
+ var AdditionalFieldName$2 = {};
2014
+ Object.defineProperty(AdditionalFieldName$2, "__esModule", { value: true });
2015
+ var AdditionalFieldName$1;
2016
+ (function(AdditionalFieldName2) {
2017
+ AdditionalFieldName2["ZipCode"] = "zip\u0421ode";
2018
+ AdditionalFieldName2["ArgentinaDni"] = "argentinaDni";
2019
+ AdditionalFieldName2["BangladeshNic"] = "bangladeshNic";
2020
+ AdditionalFieldName2["BoliviaCi"] = "boliviaCi";
2021
+ AdditionalFieldName2["BrazilCpf"] = "brazilCpf";
2022
+ AdditionalFieldName2["CameroonCni"] = "cameroonCni";
2023
+ AdditionalFieldName2["ChileCi"] = "chileCi";
2024
+ AdditionalFieldName2["ChinaId"] = "chinaId";
2025
+ AdditionalFieldName2["ColombiaCc"] = "colombiaCc";
2026
+ AdditionalFieldName2["CostaRicaCi"] = "costaRicaCi";
2027
+ AdditionalFieldName2["DominicanaId"] = "dominicanaId";
2028
+ AdditionalFieldName2["EcuadorCi"] = "ecuadorCi";
2029
+ AdditionalFieldName2["ElSalvadorId"] = "elSalvadorId";
2030
+ AdditionalFieldName2["EgyptId"] = "egyptId";
2031
+ AdditionalFieldName2["GhanaCard"] = "ghanaCard";
2032
+ AdditionalFieldName2["GuatemalaCui"] = "guatemalaCui";
2033
+ AdditionalFieldName2["IndiaPan"] = "indiaPan";
2034
+ AdditionalFieldName2["IndonesiaNik"] = "indonesiaNik";
2035
+ AdditionalFieldName2["JapanId"] = "japanId";
2036
+ AdditionalFieldName2["KenyaId"] = "kenyaId";
2037
+ AdditionalFieldName2["MalaysiaNric"] = "malaysiaNric";
2038
+ AdditionalFieldName2["MexicoCurp"] = "mexicoCurp";
2039
+ AdditionalFieldName2["MoroccoCnie"] = "moroccoCnie";
2040
+ AdditionalFieldName2["NigeriaNin"] = "nigeriaNin";
2041
+ AdditionalFieldName2["PanamaId"] = "panamaId";
2042
+ AdditionalFieldName2["ParaguayCi"] = "paraguayCi";
2043
+ AdditionalFieldName2["PeruDni"] = "peruDni";
2044
+ AdditionalFieldName2["PhilipinesPsn"] = "philipinesPsn";
2045
+ AdditionalFieldName2["SenegalCni"] = "senegalCni";
2046
+ AdditionalFieldName2["SouthAfricaId"] = "southAfricaId";
2047
+ AdditionalFieldName2["TanzaniaId"] = "tanzaniaId";
2048
+ AdditionalFieldName2["ThailandId"] = "thailandId";
2049
+ AdditionalFieldName2["TurkeyTcKimlikNo"] = "turkeyTcKimlikNo";
2050
+ AdditionalFieldName2["UgandaNic"] = "ugandaNic";
2051
+ AdditionalFieldName2["UriguayCi"] = "uriguayCi";
2052
+ AdditionalFieldName2["VietnamVnid"] = "vietnamVnid";
2053
+ })(AdditionalFieldName$1 || (AdditionalFieldName$1 = {}));
2054
+ AdditionalFieldName$2.default = AdditionalFieldName$1;
2028
2055
  var SdkLoader$2 = {};
2029
2056
  var __classPrivateFieldGet = commonjsGlobal && commonjsGlobal.__classPrivateFieldGet || function(receiver, state, kind, f) {
2030
2057
  if (kind === "a" && !f)
@@ -2081,11 +2108,9 @@ var __importDefault = commonjsGlobal && commonjsGlobal.__importDefault || functi
2081
2108
  return mod && mod.__esModule ? mod : { "default": mod };
2082
2109
  };
2083
2110
  Object.defineProperty(dist, "__esModule", { value: true });
2084
- var FormType = dist.FormType = SdkLoader = dist.SdkLoader = CardBrand = dist.CardBrand = FieldName = dist.FieldName = MessageType = dist.MessageType = SecureBrand = dist.SecureBrand = PayableEntity = dist.PayableEntity = AdditionalField = dist.AdditionalField = InteractionType = dist.InteractionType = InteractionTargetType = dist.InteractionTargetType = void 0;
2111
+ var FormType = dist.FormType = SdkLoader = dist.SdkLoader = CardBrand = dist.CardBrand = FieldName = dist.FieldName = MessageType = dist.MessageType = SecureBrand = dist.SecureBrand = PayableEntity = dist.PayableEntity = InteractionType = dist.InteractionType = AdditionalFieldName = dist.AdditionalFieldName = InteractionTargetType = dist.InteractionTargetType = void 0;
2085
2112
  const MessageType_1 = __importDefault(MessageType$2);
2086
2113
  var MessageType = dist.MessageType = MessageType_1.default;
2087
- const AdditionalField_1 = __importDefault(AdditionalField$2);
2088
- var AdditionalField = dist.AdditionalField = AdditionalField_1.default;
2089
2114
  const FieldName_1 = __importDefault(FieldName$2);
2090
2115
  var FieldName = dist.FieldName = FieldName_1.default;
2091
2116
  const CardBrand_1 = __importDefault(CardBrand$1);
@@ -2100,6 +2125,8 @@ const InteractionType_1 = __importDefault(InteractionType$2);
2100
2125
  var InteractionType = dist.InteractionType = InteractionType_1.default;
2101
2126
  const InteractionTargetType_1 = __importDefault(InteractionTargetType$2);
2102
2127
  var InteractionTargetType = dist.InteractionTargetType = InteractionTargetType_1.default;
2128
+ const AdditionalFieldName_1 = __importDefault(AdditionalFieldName$2);
2129
+ var AdditionalFieldName = dist.AdditionalFieldName = AdditionalFieldName_1.default;
2103
2130
  const SdkLoader_1 = __importDefault(SdkLoader$2);
2104
2131
  var SdkLoader = dist.SdkLoader = SdkLoader_1.default;
2105
2132
  const payButtonIds = {
@@ -2171,6 +2198,7 @@ const onSubscribe = (sdkInstanceValue, props) => {
2171
2198
  sdkInstanceValue.on(MessageType.Interaction, (e) => props.onInteraction(e.data));
2172
2199
  sdkInstanceValue.on(MessageType.OrderStatus, (e) => props.onOrderStatus(e.data));
2173
2200
  sdkInstanceValue.on(MessageType.Resize, (e) => props.onResize(e.data));
2201
+ sdkInstanceValue.on(MessageType.Card, (e) => props.onCard(e.data));
2174
2202
  };
2175
2203
  const _sfc_main = /* @__PURE__ */ defineComponent({
2176
2204
  props: {
@@ -2204,6 +2232,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
2204
2232
  onOrderStatus: { type: Function, default: () => {
2205
2233
  } },
2206
2234
  onResize: { type: Function, default: () => {
2235
+ } },
2236
+ onCard: { type: Function, default: () => {
2207
2237
  } }
2208
2238
  },
2209
2239
  setup(__props) {
@@ -2235,7 +2265,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
2235
2265
  onFormRedirect: props.onFormRedirect,
2236
2266
  onInteraction: props.onInteraction,
2237
2267
  onOrderStatus: props.onOrderStatus,
2238
- onResize: props.onResize
2268
+ onResize: props.onResize,
2269
+ onCard: props.onCard
2239
2270
  };
2240
2271
  onMounted(async () => {
2241
2272
  var _a2;
@@ -2258,4 +2289,4 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
2258
2289
  };
2259
2290
  }
2260
2291
  });
2261
- export { AdditionalField, CardBrand, FieldName, FormType, InteractionTargetType, InteractionType, MessageType, PayableEntity, SdkLoader, SecureBrand, _sfc_main as default };
2292
+ export { AdditionalFieldName, CardBrand, FieldName, FormType, InteractionTargetType, InteractionType, MessageType, PayableEntity, SdkLoader, SecureBrand, _sfc_main as default };
package/package.json CHANGED
@@ -1,5 +1,6 @@
1
1
  {
2
2
  "name": "@solidgate/vue-sdk",
3
+ "repository": "https://bitbucket.org/solidgate/vue-sdk",
3
4
  "files": [
4
5
  "dist"
5
6
  ],
@@ -9,7 +10,7 @@
9
10
  "import": "./dist/solid-payment.es.js"
10
11
  }
11
12
  },
12
- "version": "1.0.1",
13
+ "version": "1.1.1",
13
14
  "typings": "./dist/lib/index.d.ts",
14
15
  "scripts": {
15
16
  "start": "vite",
@@ -23,7 +24,7 @@
23
24
  "vue": "^3.2.25"
24
25
  },
25
26
  "dependencies": {
26
- "@solidgate/client-sdk-loader": "^1.0.0",
27
+ "@solidgate/client-sdk-loader": "^1.3.1",
27
28
  "vue3-styled-components": "^1.2.1"
28
29
  },
29
30
  "devDependencies": {