mkfashion-sdk 2.3.8 → 2.3.9

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/index.html CHANGED
@@ -12,8 +12,8 @@
12
12
 
13
13
  <script>
14
14
  (function() {
15
- var projectid = '698c7cc61d3129430f15dddc';
16
- var identifier = '16255';
15
+ var projectid = '698c806c1d3129430f15ddde';
16
+ var identifier = '1183C102.751';
17
17
 
18
18
  function initMkFashion() {
19
19
  mkfashion.addToCart(function(payload) {
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mkfashion-sdk",
3
- "version": "2.3.8",
3
+ "version": "2.3.9",
4
4
  "description": "SDK para integrar o provador virtual mKFashion com suporte a Wake Commerce",
5
5
  "main": "src/mkfashion.js",
6
6
  "scripts": {
package/src/mkfashion.js CHANGED
@@ -251,7 +251,7 @@ const mkfashion = {
251
251
  this._log('Verificando disponibilidade', { projectId: resolved, identifier })
252
252
 
253
253
  try {
254
- const url = `${this.apiUrl}/availability/${resolved}/${encodeURIComponent(identifier)}`
254
+ const url = `${this.apiUrl}/availability/${resolved}/${encodeURIComponent(identifier).replace(/\./g, '%2E')}`
255
255
  const response = await fetch(url)
256
256
 
257
257
  if (!response.ok) {
@@ -341,14 +341,14 @@ const mkfashion = {
341
341
  this._log('Buscando produto', { projectId: resolved, identifier })
342
342
 
343
343
  try {
344
- const url = `${this.apiUrl}/products/${resolved}/${encodeURIComponent(identifier)}`
344
+ const url = `${this.apiUrl}/products/${resolved}/${encodeURIComponent(identifier).replace(/\./g, '%2E')}`
345
345
  const response = await fetch(url)
346
346
 
347
347
  if (!response.ok) {
348
348
  // Fallback: tenta com productId do config caso caller tenha passado variantSku
349
349
  if (response.status === 404 && this._config?.identifier && this._config.identifier !== identifier) {
350
350
  this._log(`Identifier ${identifier} não encontrado, tentando com productId: ${this._config.identifier}`)
351
- const fallbackUrl = `${this.apiUrl}/products/${resolved}/${encodeURIComponent(this._config.identifier)}`
351
+ const fallbackUrl = `${this.apiUrl}/products/${resolved}/${encodeURIComponent(this._config.identifier).replace(/\./g, '%2E')}`
352
352
  const fallbackResponse = await fetch(fallbackUrl)
353
353
  if (fallbackResponse.ok) {
354
354
  const data = await fallbackResponse.json()
@@ -409,7 +409,10 @@ const mkfashion = {
409
409
  },
410
410
 
411
411
  _buildUrl() {
412
- return `${this.appUrl}/${this._config.projectId}/${encodeURIComponent(this._config.identifier)}`
412
+ const encoded = encodeURIComponent(this._config.identifier).replace(/\./g, '%2E')
413
+ const url = `${this.appUrl}/${this._config.projectId}/${encoded}`
414
+ console.log('[mKFashion] iframe URL:', url)
415
+ return url
413
416
  },
414
417
 
415
418
  _openModal() {
Binary file