@akinon/projectzero 1.32.0 → 1.33.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/CHANGELOG.md +6 -0
- package/app-template/.editorconfig +7 -0
- package/app-template/.env.example +9 -0
- package/app-template/.eslintignore +1 -0
- package/app-template/.eslintrc.js +31 -0
- package/app-template/.gitattributes +18 -0
- package/app-template/.husky/pre-commit +4 -0
- package/app-template/.lintstagedrc.js +12 -0
- package/app-template/.prettierrc +13 -0
- package/app-template/.releaserc.json +49 -0
- package/app-template/.stylelintrc.json +37 -0
- package/app-template/.vscode/extensions.json +11 -0
- package/app-template/.vscode/launch.json +29 -0
- package/app-template/.yarnrc +1 -0
- package/app-template/CHANGELOG.md +636 -0
- package/app-template/LICENSE +21 -0
- package/app-template/Procfile +1 -0
- package/app-template/README.md +29 -0
- package/app-template/akinon.json +28 -0
- package/app-template/bitbucket-pipelines.yml +54 -0
- package/app-template/build.sh +7 -0
- package/app-template/docs/CHANGELOG.md +85 -0
- package/app-template/docs/advanced-usage.md +43 -0
- package/app-template/docs/basic-setup.md +59 -0
- package/app-template/docs/data-fetching/client/account.md +1064 -0
- package/app-template/docs/data-fetching/client/address.md +805 -0
- package/app-template/docs/data-fetching/client/basket.md +107 -0
- package/app-template/docs/data-fetching/client/checkout.md +904 -0
- package/app-template/docs/data-fetching/client/misc.md +135 -0
- package/app-template/docs/data-fetching/client/product.md +284 -0
- package/app-template/docs/data-fetching/client/user.md +56 -0
- package/app-template/docs/data-fetching/client/wishlist.md +111 -0
- package/app-template/docs/data-fetching/server/category.md +324 -0
- package/app-template/docs/data-fetching/server/flat-page.md +42 -0
- package/app-template/docs/data-fetching/server/list.md +353 -0
- package/app-template/docs/data-fetching/server/menu.md +363 -0
- package/app-template/docs/data-fetching/server/product.md +131 -0
- package/app-template/docs/data-fetching/server/seo.md +44 -0
- package/app-template/docs/data-fetching/server/special-page.md +79 -0
- package/app-template/docs/data-fetching/server/widget.md +218 -0
- package/app-template/docs/delete-account.md +25 -0
- package/app-template/docs/deployment.md +46 -0
- package/app-template/docs/dynamic-route.md +33 -0
- package/app-template/docs/icons.md +52 -0
- package/app-template/docs/localization.md +204 -0
- package/app-template/docs/logging.md +48 -0
- package/app-template/docs/plugins.md +76 -0
- package/app-template/docs/seo-management.md +125 -0
- package/app-template/docs/static-assets.md +36 -0
- package/app-template/docs/widgets.md +127 -0
- package/app-template/global.d.ts +1 -0
- package/app-template/jest.config.ts +34 -0
- package/app-template/next-env.d.ts +6 -0
- package/app-template/next.config.mjs +34 -0
- package/app-template/package.json +97 -0
- package/app-template/plugins.d.ts +1 -0
- package/app-template/postcss.config.js +6 -0
- package/app-template/public/404.png +0 -0
- package/app-template/public/500.png +0 -0
- package/app-template/public/apple-splash-1125-2436.jpg +0 -0
- package/app-template/public/apple-splash-1136-640.jpg +0 -0
- package/app-template/public/apple-splash-1170-2532.jpg +0 -0
- package/app-template/public/apple-splash-1242-2208.jpg +0 -0
- package/app-template/public/apple-splash-1242-2688.jpg +0 -0
- package/app-template/public/apple-splash-1284-2778.jpg +0 -0
- package/app-template/public/apple-splash-1334-750.jpg +0 -0
- package/app-template/public/apple-splash-1536-2048.jpg +0 -0
- package/app-template/public/apple-splash-1620-2160.jpg +0 -0
- package/app-template/public/apple-splash-1668-2224.jpg +0 -0
- package/app-template/public/apple-splash-1668-2388.jpg +0 -0
- package/app-template/public/apple-splash-1792-828.jpg +0 -0
- package/app-template/public/apple-splash-2048-1536.jpg +0 -0
- package/app-template/public/apple-splash-2048-2732.jpg +0 -0
- package/app-template/public/apple-splash-2160-1620.jpg +0 -0
- package/app-template/public/apple-splash-2208-1242.jpg +0 -0
- package/app-template/public/apple-splash-2224-1668.jpg +0 -0
- package/app-template/public/apple-splash-2388-1668.jpg +0 -0
- package/app-template/public/apple-splash-2436-1125.jpg +0 -0
- package/app-template/public/apple-splash-2532-1170.jpg +0 -0
- package/app-template/public/apple-splash-2688-1242.jpg +0 -0
- package/app-template/public/apple-splash-2732-2048.jpg +0 -0
- package/app-template/public/apple-splash-2778-1284.jpg +0 -0
- package/app-template/public/apple-splash-640-1136.jpg +0 -0
- package/app-template/public/apple-splash-750-1334.jpg +0 -0
- package/app-template/public/apple-splash-828-1792.jpg +0 -0
- package/app-template/public/apple-touch-icon-152x152.png +0 -0
- package/app-template/public/apple-touch-icon-167x167.png +0 -0
- package/app-template/public/apple-touch-icon-180x180.png +0 -0
- package/app-template/public/apple-touch-icon.png +0 -0
- package/app-template/public/apple.svg +47 -0
- package/app-template/public/cvv.jpg +0 -0
- package/app-template/public/facebook.svg +3 -0
- package/app-template/public/google.svg +12 -0
- package/app-template/public/icon-192x192.png +0 -0
- package/app-template/public/icon-256x256.png +0 -0
- package/app-template/public/icon-384x384.png +0 -0
- package/app-template/public/icon-512x512.png +0 -0
- package/app-template/public/icon-sprite.svg +528 -0
- package/app-template/public/locales/en/account.json +490 -0
- package/app-template/public/locales/en/auth.json +100 -0
- package/app-template/public/locales/en/basket.json +50 -0
- package/app-template/public/locales/en/category.json +26 -0
- package/app-template/public/locales/en/checkout.json +152 -0
- package/app-template/public/locales/en/common.json +65 -0
- package/app-template/public/locales/en/forgot_password.json +41 -0
- package/app-template/public/locales/en/form.json +5 -0
- package/app-template/public/locales/en/product.json +39 -0
- package/app-template/public/locales/tr/account.json +490 -0
- package/app-template/public/locales/tr/auth.json +100 -0
- package/app-template/public/locales/tr/basket.json +50 -0
- package/app-template/public/locales/tr/category.json +26 -0
- package/app-template/public/locales/tr/checkout.json +152 -0
- package/app-template/public/locales/tr/common.json +65 -0
- package/app-template/public/locales/tr/forgot_password.json +41 -0
- package/app-template/public/locales/tr/form.json +5 -0
- package/app-template/public/locales/tr/product.json +39 -0
- package/app-template/public/logo.svg +29 -0
- package/app-template/public/manifest.json +35 -0
- package/app-template/public/mastercard.png +0 -0
- package/app-template/public/mastersecure.png +0 -0
- package/app-template/public/mfs-client.min.js +3 -0
- package/app-template/public/noimage.jpg +0 -0
- package/app-template/public/safari-pinned-tab.svg +320 -0
- package/app-template/public/ssl-secure.png +0 -0
- package/app-template/public/vbv.png +0 -0
- package/app-template/public/visa.png +0 -0
- package/app-template/public/zepto.min.js +2 -0
- package/app-template/sentry.client.config.ts +16 -0
- package/app-template/sentry.edge.config.ts +3 -0
- package/app-template/sentry.properties +4 -0
- package/app-template/sentry.server.config.ts +3 -0
- package/app-template/setupTests.ts +4 -0
- package/app-template/src/__tests__/index.test.tsx +7 -0
- package/app-template/src/__tests__/tsconfig.json +7 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/account/address/page.tsx +74 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/account/change-email/page.tsx +174 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/account/change-password/page.tsx +206 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/account/contact/page.tsx +7 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/account/coupons/page.tsx +210 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/account/email-verification/page.tsx +5 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/account/faq/page.tsx +23 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/account/favourite-products/page.tsx +32 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/account/layout.tsx +28 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/account/my-quotations/page.tsx +7 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/account/orders/[id]/cancellation/page.tsx +255 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/account/orders/[id]/layout.tsx +5 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/account/orders/[id]/page.tsx +309 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/account/orders/page.tsx +137 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/account/page.tsx +226 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/account/profile/page.tsx +399 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/address/stores/page.tsx +271 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/anonymous-tracking/page.tsx +33 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/auth/oauth-login/page.tsx +3 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/auth/page.tsx +76 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/basket/page.tsx +77 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/basket-b2b/page.tsx +7 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/category/[pk]/loading.tsx +53 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/category/[pk]/page.tsx +16 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/client-root.tsx +9 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/contact-us/page.tsx +11 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/error.tsx +20 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/flat-page/[pk]/loading.tsx +5 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/flat-page/[pk]/page.tsx +18 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/forms/[pk]/generate/page.tsx +48 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/group-product/[pk]/loading.tsx +5 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/group-product/[pk]/page.tsx +72 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/landing-page/[pk]/loading.tsx +5 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/landing-page/[pk]/page.tsx +23 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/layout.tsx +78 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/list/loading.tsx +53 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/list/page.tsx +16 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/orders/checkout/page.tsx +140 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/orders/completed/[token]/layout.tsx +5 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/orders/completed/[token]/page.tsx +284 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/page.tsx +50 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/product/[pk]/loading.tsx +67 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/product/[pk]/page.tsx +81 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/special-page/[pk]/loading.tsx +53 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/special-page/[pk]/page.tsx +25 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/template.tsx +75 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/users/email-set-primary/[[...id]]/page.tsx +43 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/users/password/reset/page.tsx +79 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/users/registration/account-confirm-email/[[...id]]/page.tsx +43 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/users/reset/[[...id]]/page.tsx +110 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/xml-sitemap/[node]/route.ts +25 -0
- package/app-template/src/app/[commerce]/[locale]/[currency]/xml-sitemap/route.ts +37 -0
- package/app-template/src/app/api/cache/route.ts +1 -0
- package/app-template/src/app/api/client/[...slug]/route.ts +1 -0
- package/app-template/src/app/api/form/[...id]/route.ts +7 -0
- package/app-template/src/app/api/logout/route.ts +1 -0
- package/app-template/src/app/api/sentry/route.ts +9 -0
- package/app-template/src/app/api/web-vitals/route.ts +1 -0
- package/app-template/src/app/favicon.ico +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-Black.eot +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-Black.ttf +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-Black.woff +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-Black.woff2 +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-BlackItalic.eot +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-BlackItalic.ttf +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-BlackItalic.woff +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-BlackItalic.woff2 +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-Bold.eot +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-Bold.ttf +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-Bold.woff +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-Bold.woff2 +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-BoldItalic.eot +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-BoldItalic.ttf +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-BoldItalic.woff +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-BoldItalic.woff2 +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-ExtraBold.eot +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-ExtraBold.ttf +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-ExtraBold.woff +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-ExtraBold.woff2 +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-ExtraBoldItalic.eot +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-ExtraBoldItalic.ttf +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-ExtraBoldItalic.woff +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-ExtraBoldItalic.woff2 +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-ExtraLight.eot +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-ExtraLight.ttf +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-ExtraLight.woff +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-ExtraLight.woff2 +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-ExtraLightItalic.eot +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-ExtraLightItalic.ttf +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-ExtraLightItalic.woff +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-ExtraLightItalic.woff2 +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-Italic.eot +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-Italic.ttf +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-Italic.woff +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-Italic.woff2 +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-Light.eot +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-Light.ttf +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-Light.woff +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-Light.woff2 +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-LightItalic.eot +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-LightItalic.ttf +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-LightItalic.woff +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-LightItalic.woff2 +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-Medium.eot +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-Medium.ttf +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-Medium.woff +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-Medium.woff2 +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-MediumItalic.eot +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-MediumItalic.ttf +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-MediumItalic.woff +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-MediumItalic.woff2 +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-Regular.eot +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-Regular.ttf +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-Regular.woff +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-Regular.woff2 +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-SemiBold.eot +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-SemiBold.ttf +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-SemiBold.woff +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-SemiBold.woff2 +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-SemiBoldItalic.eot +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-SemiBoldItalic.ttf +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-SemiBoldItalic.woff +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-SemiBoldItalic.woff2 +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-Thin.eot +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-Thin.ttf +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-Thin.woff +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-Thin.woff2 +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-ThinItalic.eot +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-ThinItalic.ttf +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-ThinItalic.woff +0 -0
- package/app-template/src/assets/fonts/Jost/Jost-ThinItalic.woff2 +0 -0
- package/app-template/src/assets/fonts/Jost/index.scss +269 -0
- package/app-template/src/assets/fonts/index.scss +1 -0
- package/app-template/src/assets/fonts/pz-icon.css +154 -0
- package/app-template/src/assets/fonts/pz-icon.eot +0 -0
- package/app-template/src/assets/fonts/pz-icon.html +456 -0
- package/app-template/src/assets/fonts/pz-icon.scss +300 -0
- package/app-template/src/assets/fonts/pz-icon.svg +144 -0
- package/app-template/src/assets/fonts/pz-icon.ttf +0 -0
- package/app-template/src/assets/fonts/pz-icon.woff +0 -0
- package/app-template/src/assets/fonts/pz-icon.woff2 +0 -0
- package/app-template/src/assets/globals.scss +65 -0
- package/app-template/src/assets/icons/akinon.svg +11 -0
- package/app-template/src/assets/icons/arrow-up.svg +11 -0
- package/app-template/src/assets/icons/bell.svg +1 -0
- package/app-template/src/assets/icons/cart.svg +13 -0
- package/app-template/src/assets/icons/check.svg +19 -0
- package/app-template/src/assets/icons/chevron-down.svg +8 -0
- package/app-template/src/assets/icons/chevron-end.svg +8 -0
- package/app-template/src/assets/icons/chevron-start.svg +8 -0
- package/app-template/src/assets/icons/chevron-up.svg +8 -0
- package/app-template/src/assets/icons/close.svg +12 -0
- package/app-template/src/assets/icons/cvc.svg +54 -0
- package/app-template/src/assets/icons/default.svg +6 -0
- package/app-template/src/assets/icons/directions.svg +14 -0
- package/app-template/src/assets/icons/eye-off.svg +10 -0
- package/app-template/src/assets/icons/eye-on.svg +17 -0
- package/app-template/src/assets/icons/facebook-login.svg +11 -0
- package/app-template/src/assets/icons/facebook.svg +9 -0
- package/app-template/src/assets/icons/giftbox.svg +22 -0
- package/app-template/src/assets/icons/globe.svg +12 -0
- package/app-template/src/assets/icons/google-login.svg +19 -0
- package/app-template/src/assets/icons/google.svg +9 -0
- package/app-template/src/assets/icons/hamburger.svg +5 -0
- package/app-template/src/assets/icons/heart-full.svg +20 -0
- package/app-template/src/assets/icons/heart-stroke.svg +22 -0
- package/app-template/src/assets/icons/info.svg +1 -0
- package/app-template/src/assets/icons/instagram.svg +14 -0
- package/app-template/src/assets/icons/layout-2.svg +7 -0
- package/app-template/src/assets/icons/layout-3.svg +4 -0
- package/app-template/src/assets/icons/logo.svg +24 -0
- package/app-template/src/assets/icons/mail.svg +1 -0
- package/app-template/src/assets/icons/minus.svg +4 -0
- package/app-template/src/assets/icons/money.svg +4 -0
- package/app-template/src/assets/icons/mp-otp.svg +1 -0
- package/app-template/src/assets/icons/pin.svg +16 -0
- package/app-template/src/assets/icons/pinterest.svg +12 -0
- package/app-template/src/assets/icons/plus.svg +5 -0
- package/app-template/src/assets/icons/search.svg +13 -0
- package/app-template/src/assets/icons/share.svg +10 -0
- package/app-template/src/assets/icons/spinner.svg +6 -0
- package/app-template/src/assets/icons/store-pin.svg +14 -0
- package/app-template/src/assets/icons/track-order.svg +1 -0
- package/app-template/src/assets/icons/twitter.svg +11 -0
- package/app-template/src/assets/icons/user.svg +14 -0
- package/app-template/src/assets/icons/whatsapp.svg +45 -0
- package/app-template/src/components/__tests__/Modal.test.tsx +103 -0
- package/app-template/src/components/__tests__/accordion.test.tsx +65 -0
- package/app-template/src/components/__tests__/badge.test.tsx +20 -0
- package/app-template/src/components/__tests__/button.test.tsx +59 -0
- package/app-template/src/components/__tests__/checkbox.test.tsx +57 -0
- package/app-template/src/components/__tests__/file-input.test.tsx +42 -0
- package/app-template/src/components/__tests__/icon.test.tsx +39 -0
- package/app-template/src/components/__tests__/input.test.tsx +69 -0
- package/app-template/src/components/__tests__/language-select.test.tsx +81 -0
- package/app-template/src/components/__tests__/link.test.tsx +65 -0
- package/app-template/src/components/__tests__/price.test.tsx +72 -0
- package/app-template/src/components/__tests__/radio.test.tsx +52 -0
- package/app-template/src/components/__tests__/select.test.tsx +115 -0
- package/app-template/src/components/__tests__/tab.test.tsx +101 -0
- package/app-template/src/components/accordion.tsx +64 -0
- package/app-template/src/components/badge.tsx +21 -0
- package/app-template/src/components/button.tsx +46 -0
- package/app-template/src/components/canonical-url.tsx +21 -0
- package/app-template/src/components/carousel-core.tsx +42 -0
- package/app-template/src/components/checkbox.tsx +28 -0
- package/app-template/src/components/currency-select.tsx +81 -0
- package/app-template/src/components/custom-loader.tsx +21 -0
- package/app-template/src/components/dynamic-form.tsx +17 -0
- package/app-template/src/components/file-input.tsx +8 -0
- package/app-template/src/components/generate-form-fields.tsx +349 -0
- package/app-template/src/components/icon.tsx +18 -0
- package/app-template/src/components/index.ts +41 -0
- package/app-template/src/components/input.tsx +110 -0
- package/app-template/src/components/language-select.tsx +33 -0
- package/app-template/src/components/link.tsx +53 -0
- package/app-template/src/components/loader-spinner.tsx +23 -0
- package/app-template/src/components/modal.tsx +66 -0
- package/app-template/src/components/pagination.tsx +267 -0
- package/app-template/src/components/password-rules-feedback.tsx +60 -0
- package/app-template/src/components/price.tsx +54 -0
- package/app-template/src/components/pwa-tags.tsx +233 -0
- package/app-template/src/components/radio.tsx +18 -0
- package/app-template/src/components/react-portal.tsx +47 -0
- package/app-template/src/components/select.tsx +70 -0
- package/app-template/src/components/shimmer.tsx +21 -0
- package/app-template/src/components/skeleton-article.tsx +15 -0
- package/app-template/src/components/skeleton-product.tsx +14 -0
- package/app-template/src/components/skeleton-profile.tsx +19 -0
- package/app-template/src/components/skeleton-wrapper.tsx +19 -0
- package/app-template/src/components/skeleton.tsx +37 -0
- package/app-template/src/components/source.tsx +12 -0
- package/app-template/src/components/tab-panel.tsx +10 -0
- package/app-template/src/components/tab.tsx +58 -0
- package/app-template/src/components/tabs.tsx +58 -0
- package/app-template/src/components/types/index.ts +89 -0
- package/app-template/src/hooks/index.ts +1 -0
- package/app-template/src/hooks/use-add-product-to-basket.ts +48 -0
- package/app-template/src/hooks/use-contract.tsx +58 -0
- package/app-template/src/hooks/use-fav-button.tsx +99 -0
- package/app-template/src/instrumentation.ts +1 -0
- package/app-template/src/middleware.ts +33 -0
- package/app-template/src/pages/_error.js +14 -0
- package/app-template/src/pages/api/auth/[...nextauth].ts +3 -0
- package/app-template/src/plugins.js +14 -0
- package/app-template/src/redux/middlewares/category.ts +42 -0
- package/app-template/src/redux/reducers/category.ts +67 -0
- package/app-template/src/redux/store.ts +47 -0
- package/app-template/src/routes/index.ts +46 -0
- package/app-template/src/settings.js +62 -0
- package/app-template/src/theme.js +1 -0
- package/app-template/src/types/index.ts +72 -0
- package/app-template/src/types/next-auth.d.ts +24 -0
- package/app-template/src/types/widgets.ts +115 -0
- package/app-template/src/utils/convert-facet-search-params.ts +15 -0
- package/app-template/src/utils/generate-jsonld.ts +23 -0
- package/app-template/src/utils/gtm.ts +247 -0
- package/app-template/src/utils/index.ts +60 -0
- package/app-template/src/views/account/account-menu.tsx +117 -0
- package/app-template/src/views/account/address-card.tsx +157 -0
- package/app-template/src/views/account/address-form.tsx +374 -0
- package/app-template/src/views/account/back-button.tsx +27 -0
- package/app-template/src/views/account/contact-form.tsx +283 -0
- package/app-template/src/views/account/content-header.tsx +52 -0
- package/app-template/src/views/account/faq/faq-footer.tsx +30 -0
- package/app-template/src/views/account/faq/faq-search.tsx +35 -0
- package/app-template/src/views/account/faq/faq-tabs.tsx +54 -0
- package/app-template/src/views/account/faq/index.ts +3 -0
- package/app-template/src/views/account/favorite-item.tsx +191 -0
- package/app-template/src/views/account/favourite-products/favourite-products-list.tsx +65 -0
- package/app-template/src/views/account/index.ts +4 -0
- package/app-template/src/views/account/order.tsx +89 -0
- package/app-template/src/views/account/orders/order-cancellation-item.tsx +99 -0
- package/app-template/src/views/account/orders/order-detail-header.tsx +39 -0
- package/app-template/src/views/anonymous-tracking/index.tsx +109 -0
- package/app-template/src/views/anonymous-tracking/order-detail/index.tsx +318 -0
- package/app-template/src/views/basket/basket-item.tsx +231 -0
- package/app-template/src/views/basket/index.ts +2 -0
- package/app-template/src/views/basket/summary.tsx +220 -0
- package/app-template/src/views/breadcrumb.tsx +35 -0
- package/app-template/src/views/category/category-active-filters.tsx +98 -0
- package/app-template/src/views/category/category-banner.tsx +34 -0
- package/app-template/src/views/category/category-header.tsx +143 -0
- package/app-template/src/views/category/category-info.tsx +123 -0
- package/app-template/src/views/category/filters/index.tsx +163 -0
- package/app-template/src/views/category/filters/size-filter.tsx +27 -0
- package/app-template/src/views/category/layout.tsx +38 -0
- package/app-template/src/views/checkout/auth.tsx +54 -0
- package/app-template/src/views/checkout/index.tsx +3 -0
- package/app-template/src/views/checkout/layout/footer.tsx +48 -0
- package/app-template/src/views/checkout/layout/header.tsx +38 -0
- package/app-template/src/views/checkout/step-button.tsx +69 -0
- package/app-template/src/views/checkout/step-list.tsx +51 -0
- package/app-template/src/views/checkout/steps/payment/agreements.tsx +42 -0
- package/app-template/src/views/checkout/steps/payment/index.tsx +31 -0
- package/app-template/src/views/checkout/steps/payment/options/credit-card/index.tsx +382 -0
- package/app-template/src/views/checkout/steps/payment/options/credit-card/installments.tsx +100 -0
- package/app-template/src/views/checkout/steps/payment/options/credit-payment.tsx +14 -0
- package/app-template/src/views/checkout/steps/payment/options/funds-transfer.tsx +174 -0
- package/app-template/src/views/checkout/steps/payment/options/loyalty.tsx +19 -0
- package/app-template/src/views/checkout/steps/payment/options/pay-on-delivery.tsx +15 -0
- package/app-template/src/views/checkout/steps/payment/options/redirection.tsx +94 -0
- package/app-template/src/views/checkout/steps/payment/payment-header.tsx +17 -0
- package/app-template/src/views/checkout/steps/payment/payment-option-buttons.tsx +73 -0
- package/app-template/src/views/checkout/steps/shipping/address-box.tsx +244 -0
- package/app-template/src/views/checkout/steps/shipping/addresses.tsx +189 -0
- package/app-template/src/views/checkout/steps/shipping/index.tsx +27 -0
- package/app-template/src/views/checkout/steps/shipping/shipping-options.tsx +72 -0
- package/app-template/src/views/checkout/summary.tsx +181 -0
- package/app-template/src/views/coupon-item/index.tsx +80 -0
- package/app-template/src/views/find-in-store/index.tsx +183 -0
- package/app-template/src/views/footer.tsx +21 -0
- package/app-template/src/views/guest-login/index.tsx +130 -0
- package/app-template/src/views/header/action-menu.tsx +117 -0
- package/app-template/src/views/header/band.tsx +32 -0
- package/app-template/src/views/header/index.tsx +66 -0
- package/app-template/src/views/header/mini-basket.tsx +267 -0
- package/app-template/src/views/header/mobile-hamburger-button.tsx +35 -0
- package/app-template/src/views/header/mobile-menu.tsx +144 -0
- package/app-template/src/views/header/navbar.tsx +186 -0
- package/app-template/src/views/header/pwa-back-button.tsx +60 -0
- package/app-template/src/views/header/search/index.tsx +82 -0
- package/app-template/src/views/header/search/results.tsx +123 -0
- package/app-template/src/views/header/user-menu.tsx +72 -0
- package/app-template/src/views/index.tsx +2 -0
- package/app-template/src/views/installment-options/index.tsx +127 -0
- package/app-template/src/views/login/index.tsx +233 -0
- package/app-template/src/views/otp-login/index.tsx +152 -0
- package/app-template/src/views/page-loader-spinner/index.tsx +9 -0
- package/app-template/src/views/product/accordion-wrapper.tsx +59 -0
- package/app-template/src/views/product/combine-product-card.tsx +82 -0
- package/app-template/src/views/product/index.ts +8 -0
- package/app-template/src/views/product/layout.tsx +40 -0
- package/app-template/src/views/product/misc-buttons.tsx +65 -0
- package/app-template/src/views/product/price-wrapper.tsx +41 -0
- package/app-template/src/views/product/product-group-info.tsx +63 -0
- package/app-template/src/views/product/product-info.tsx +273 -0
- package/app-template/src/views/product/slider.tsx +124 -0
- package/app-template/src/views/product/variant.tsx +104 -0
- package/app-template/src/views/product-item/index.tsx +96 -0
- package/app-template/src/views/product-pointer-banner-item.tsx +243 -0
- package/app-template/src/views/register/index.tsx +417 -0
- package/app-template/src/views/root-modal.tsx +21 -0
- package/app-template/src/views/sales-contract-modal/index.tsx +288 -0
- package/app-template/src/views/share/index.tsx +71 -0
- package/app-template/src/views/widgets/home-hero-slider-content.tsx +54 -0
- package/app-template/src/views/widgets/recommendation-content.tsx +86 -0
- package/app-template/src/widgets/footer-copyright.tsx +25 -0
- package/app-template/src/widgets/footer-info.tsx +78 -0
- package/app-template/src/widgets/footer-menu.tsx +258 -0
- package/app-template/src/widgets/footer-social.tsx +53 -0
- package/app-template/src/widgets/footer-subscription/footer-subscription-form.tsx +110 -0
- package/app-template/src/widgets/footer-subscription/index.tsx +30 -0
- package/app-template/src/widgets/header-band-text.tsx +21 -0
- package/app-template/src/widgets/home-discovery.tsx +191 -0
- package/app-template/src/widgets/home-hero-slider.tsx +36 -0
- package/app-template/src/widgets/home-product-recommendation.tsx +18 -0
- package/app-template/src/widgets/home-single-banner.tsx +87 -0
- package/app-template/src/widgets/home-stories-eng.tsx +112 -0
- package/app-template/src/widgets/index.ts +25 -0
- package/app-template/src/widgets/product-pointer-banners.tsx +35 -0
- package/app-template/src/widgets/special-page-banner.tsx +49 -0
- package/app-template/src/widgets/special-page-carousel.tsx +68 -0
- package/app-template/src/widgets/widget-order.tsx +1 -0
- package/app-template/tailwind.config.js +170 -0
- package/app-template/tsconfig.json +44 -0
- package/app-template/tsconfig.test.json +6 -0
- package/app-template/yarn.lock +11278 -0
- package/commands/create.ts +49 -118
- package/dist/commands/create.js +32 -68
- package/package.json +1 -1
- package/tsconfig.json +9 -8
|
@@ -0,0 +1,904 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Checkout
|
|
3
|
+
sidebar_label: Checkout
|
|
4
|
+
slug: checkout
|
|
5
|
+
custom_edit_url: null
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## useFetchCheckoutQuery
|
|
9
|
+
|
|
10
|
+
This function is used to fetch all the data added during the payment steps.
|
|
11
|
+
|
|
12
|
+
The **useFetchCheckoutQuery** function is imported from `'@akinon/next/data/client/checkout'`.
|
|
13
|
+
|
|
14
|
+
```javascript
|
|
15
|
+
import { useFetchCheckoutQuery } from '@akinon/next/data/client/checkout';
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
To use this function, a variable can be created to retrieve checkout data as follows:
|
|
19
|
+
|
|
20
|
+
```javascript
|
|
21
|
+
const {
|
|
22
|
+
data: checkoutData,
|
|
23
|
+
isFetching,
|
|
24
|
+
isError,
|
|
25
|
+
isSuccess,
|
|
26
|
+
refetch: refetchCheckout
|
|
27
|
+
} = useFetchCheckoutQuery(null, {
|
|
28
|
+
refetchOnMountOrArgChange: true
|
|
29
|
+
});
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Data returned from the function:
|
|
33
|
+
|
|
34
|
+
```json
|
|
35
|
+
{
|
|
36
|
+
"context_list": [{
|
|
37
|
+
"page_context": {
|
|
38
|
+
"is_user_logged_in": true,
|
|
39
|
+
"can_guest_purchase": true,
|
|
40
|
+
"has_gift_box": true
|
|
41
|
+
},
|
|
42
|
+
"page_name": "IndexPage",
|
|
43
|
+
"page_slug": "indexpage"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"page_context": {
|
|
47
|
+
"delivery_options": [{
|
|
48
|
+
"pk": 2,
|
|
49
|
+
"slug": "store",
|
|
50
|
+
"name": "Mağazadan Teslimat",
|
|
51
|
+
"delivery_option_type": "retail_store",
|
|
52
|
+
"sort_order": 1
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"pk": 1,
|
|
56
|
+
"slug": "delivery_point",
|
|
57
|
+
"name": "Teslim Noktasına Teslimat",
|
|
58
|
+
"delivery_option_type": "customer",
|
|
59
|
+
"sort_order": 2
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"pk": 3,
|
|
63
|
+
"slug": "address",
|
|
64
|
+
"name": "Eve Teslim",
|
|
65
|
+
"delivery_option_type": "customer",
|
|
66
|
+
"sort_order": 3
|
|
67
|
+
}
|
|
68
|
+
]
|
|
69
|
+
},
|
|
70
|
+
"page_name": "DeliveryOptionSelectionPage",
|
|
71
|
+
"page_slug": "deliveryoptionselectionpage"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"page_context": {
|
|
75
|
+
"addresses": [{
|
|
76
|
+
"pk": 84,
|
|
77
|
+
"email": "akinon.mail@akinon.com",
|
|
78
|
+
"phone_number": "05555555555",
|
|
79
|
+
"first_name": "Firsname",
|
|
80
|
+
"last_name": "Lastname",
|
|
81
|
+
"country": {
|
|
82
|
+
"pk": 1,
|
|
83
|
+
"name": "Test Country",
|
|
84
|
+
"code": "tr"
|
|
85
|
+
},
|
|
86
|
+
"city": {
|
|
87
|
+
"pk": 2,
|
|
88
|
+
"name": "Test City 1",
|
|
89
|
+
"country": 1
|
|
90
|
+
},
|
|
91
|
+
"line": "this is a test address.",
|
|
92
|
+
"title": "Test Title",
|
|
93
|
+
"township": {
|
|
94
|
+
"pk": 2,
|
|
95
|
+
"name": "Test Township 1",
|
|
96
|
+
"city": 2
|
|
97
|
+
},
|
|
98
|
+
"district": {
|
|
99
|
+
"pk": 2,
|
|
100
|
+
"name": "Test District 1",
|
|
101
|
+
"city": 2,
|
|
102
|
+
"township": 2
|
|
103
|
+
},
|
|
104
|
+
"postcode": "00000",
|
|
105
|
+
"notes": null,
|
|
106
|
+
"company_name": null,
|
|
107
|
+
"tax_office": null,
|
|
108
|
+
"tax_no": null,
|
|
109
|
+
"e_bill_taxpayer": false,
|
|
110
|
+
"is_corporate": false,
|
|
111
|
+
"primary": false,
|
|
112
|
+
"identity_number": null,
|
|
113
|
+
"extra_field": null
|
|
114
|
+
}],
|
|
115
|
+
"retail_stores": [{
|
|
116
|
+
"pk": 1,
|
|
117
|
+
"name": "Shop 2",
|
|
118
|
+
"township": {
|
|
119
|
+
"pk": 1,
|
|
120
|
+
"name": "Test Township 3",
|
|
121
|
+
"city": {
|
|
122
|
+
"pk": 1,
|
|
123
|
+
"name": "Test City 2",
|
|
124
|
+
"country": 1
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
"district": {
|
|
128
|
+
"pk": 1,
|
|
129
|
+
"name": "Test District 3",
|
|
130
|
+
"city": 1,
|
|
131
|
+
"township": 1
|
|
132
|
+
},
|
|
133
|
+
"address": "Shop 2 Address"
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
"pk": 2,
|
|
137
|
+
"name": "Shop 1",
|
|
138
|
+
"township": {
|
|
139
|
+
"pk": 2,
|
|
140
|
+
"name": "Test Township 1",
|
|
141
|
+
"city": {
|
|
142
|
+
"pk": 2,
|
|
143
|
+
"name": "Test City 1",
|
|
144
|
+
"country": 1
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
"district": {
|
|
148
|
+
"pk": 2,
|
|
149
|
+
"name": "Test District 1",
|
|
150
|
+
"city": 2,
|
|
151
|
+
"township": 2
|
|
152
|
+
},
|
|
153
|
+
"address": "Shop Test Address"
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
"pk": 5,
|
|
157
|
+
"name": "Shop 4",
|
|
158
|
+
"township": {
|
|
159
|
+
"pk": 2,
|
|
160
|
+
"name": "Test Township 1",
|
|
161
|
+
"city": {
|
|
162
|
+
"pk": 2,
|
|
163
|
+
"name": "Test City 1",
|
|
164
|
+
"country": 1
|
|
165
|
+
}
|
|
166
|
+
},
|
|
167
|
+
"district": {
|
|
168
|
+
"pk": 2,
|
|
169
|
+
"name": "Test District 1",
|
|
170
|
+
"city": 2,
|
|
171
|
+
"township": 2
|
|
172
|
+
},
|
|
173
|
+
"address": "Istanbul Turkey"
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
"pk": 4,
|
|
177
|
+
"name": "Shop 3",
|
|
178
|
+
"township": {
|
|
179
|
+
"pk": 3,
|
|
180
|
+
"name": "Test Township 4",
|
|
181
|
+
"city": {
|
|
182
|
+
"pk": 3,
|
|
183
|
+
"name": "Test City 3",
|
|
184
|
+
"country": 1
|
|
185
|
+
}
|
|
186
|
+
},
|
|
187
|
+
"district": {
|
|
188
|
+
"pk": 3,
|
|
189
|
+
"name": "Test District 4",
|
|
190
|
+
"city": 3,
|
|
191
|
+
"township": 3
|
|
192
|
+
},
|
|
193
|
+
"address": "Boston Marriott Quincy"
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
"pk": 3,
|
|
197
|
+
"name": "Shop 3",
|
|
198
|
+
"township": {
|
|
199
|
+
"pk": 3,
|
|
200
|
+
"name": "Test Township 4",
|
|
201
|
+
"city": {
|
|
202
|
+
"pk": 3,
|
|
203
|
+
"name": "Test City 3",
|
|
204
|
+
"country": 1
|
|
205
|
+
}
|
|
206
|
+
},
|
|
207
|
+
"district": {
|
|
208
|
+
"pk": 3,
|
|
209
|
+
"name": "Test District 4",
|
|
210
|
+
"city": 3,
|
|
211
|
+
"township": 3
|
|
212
|
+
},
|
|
213
|
+
"address": "Boston Marriott Quincy 1000"
|
|
214
|
+
}
|
|
215
|
+
],
|
|
216
|
+
"country": {
|
|
217
|
+
"pk": 1,
|
|
218
|
+
"name": "Test Country",
|
|
219
|
+
"code": "tr"
|
|
220
|
+
}
|
|
221
|
+
},
|
|
222
|
+
"page_name": "RetailStoreSelectionPage",
|
|
223
|
+
"page_slug": "retailstoreselectionpage"
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
"page_context": {
|
|
227
|
+
"shipping_options": [{
|
|
228
|
+
"pk": 2,
|
|
229
|
+
"name": "UPS",
|
|
230
|
+
"slug": "ups",
|
|
231
|
+
"logo": null,
|
|
232
|
+
"shipping_amount": "8.50",
|
|
233
|
+
"description": null,
|
|
234
|
+
"kwargs": {}
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
"pk": 1,
|
|
238
|
+
"name": "MNG Kargo",
|
|
239
|
+
"slug": "Mng",
|
|
240
|
+
"logo": null,
|
|
241
|
+
"shipping_amount": "0",
|
|
242
|
+
"description": "{}",
|
|
243
|
+
"kwargs": {}
|
|
244
|
+
}
|
|
245
|
+
]
|
|
246
|
+
},
|
|
247
|
+
"page_name": "ShippingOptionSelectionPage",
|
|
248
|
+
"page_slug": "shippingoptionselectionpage"
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
"page_context": {
|
|
252
|
+
"checkout_url": null,
|
|
253
|
+
"status_url": null,
|
|
254
|
+
"payment_options": [{
|
|
255
|
+
"pk": 1,
|
|
256
|
+
"name": "Credit Card",
|
|
257
|
+
"slug": "credit-card",
|
|
258
|
+
"payment_type": "credit_card",
|
|
259
|
+
"payment_type_label": "Credit Card"
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
"pk": 34,
|
|
263
|
+
"name": "Masterpass",
|
|
264
|
+
"slug": "masterpass",
|
|
265
|
+
"payment_type": "masterpass",
|
|
266
|
+
"payment_type_label": "Masterpass"
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
"pk": 4,
|
|
270
|
+
"name": "havale",
|
|
271
|
+
"slug": "havale",
|
|
272
|
+
"payment_type": "funds_transfer",
|
|
273
|
+
"payment_type_label": "Funds Transfer"
|
|
274
|
+
},
|
|
275
|
+
{
|
|
276
|
+
"pk": 5,
|
|
277
|
+
"name": "İyzico ile Öde",
|
|
278
|
+
"slug": "pay_with_iyzico",
|
|
279
|
+
"payment_type": "redirection",
|
|
280
|
+
"payment_type_label": "Redirect to Bank"
|
|
281
|
+
},
|
|
282
|
+
{
|
|
283
|
+
"pk": 3,
|
|
284
|
+
"name": "Pay On Delivery",
|
|
285
|
+
"slug": "pay-on-delivery",
|
|
286
|
+
"payment_type": "pay_on_delivery",
|
|
287
|
+
"payment_type_label": "Pay On Delivery"
|
|
288
|
+
}
|
|
289
|
+
],
|
|
290
|
+
"unavailable_options": []
|
|
291
|
+
},
|
|
292
|
+
"page_name": "PaymentOptionSelectionPage",
|
|
293
|
+
"page_slug": "paymentoptionselectionpage"
|
|
294
|
+
},
|
|
295
|
+
{
|
|
296
|
+
"page_context": {},
|
|
297
|
+
"page_name": "BinNumberPage",
|
|
298
|
+
"page_slug": "binnumberpage"
|
|
299
|
+
}
|
|
300
|
+
],
|
|
301
|
+
"template_name": "orders/checkout.html",
|
|
302
|
+
"errors": [],
|
|
303
|
+
"pre_order": {
|
|
304
|
+
"basket": {
|
|
305
|
+
"basketitem_set": [{
|
|
306
|
+
"quantity": 1,
|
|
307
|
+
"unit_price": "54.49",
|
|
308
|
+
"tax_rate": "20.00",
|
|
309
|
+
"currency_type": "eur",
|
|
310
|
+
"product": {
|
|
311
|
+
"pk": 212,
|
|
312
|
+
"name": "Driving Shoes Soft Leather Brown",
|
|
313
|
+
"sku": "AKN-010-brown001-43",
|
|
314
|
+
"base_code": "AKN-010",
|
|
315
|
+
"attributes": {
|
|
316
|
+
...
|
|
317
|
+
},
|
|
318
|
+
"attribute_set": 7,
|
|
319
|
+
"attributes_kwargs": {
|
|
320
|
+
...
|
|
321
|
+
},
|
|
322
|
+
"extra_attributes": {},
|
|
323
|
+
"productimage_set": [{
|
|
324
|
+
"pk": 255,
|
|
325
|
+
"status": "active",
|
|
326
|
+
"image": "https://image-url.jpg",
|
|
327
|
+
"order": 0,
|
|
328
|
+
"created_date": "2023-01-09T07:02:08.250452Z",
|
|
329
|
+
"specialimage_set": []
|
|
330
|
+
}],
|
|
331
|
+
"price": "54.49",
|
|
332
|
+
"in_stock": true,
|
|
333
|
+
"currency_type": "eur",
|
|
334
|
+
"retail_price": "69.99",
|
|
335
|
+
"unit_type": "qty",
|
|
336
|
+
"absolute_url": "/product/212/",
|
|
337
|
+
"productvideo_set": [],
|
|
338
|
+
"product_type": "0",
|
|
339
|
+
"price_type": "default",
|
|
340
|
+
"form_schema": null,
|
|
341
|
+
"is_ready_to_basket": false,
|
|
342
|
+
"stock": 997,
|
|
343
|
+
"data_source": null
|
|
344
|
+
},
|
|
345
|
+
"total_amount": "54.49",
|
|
346
|
+
"shipping_discount": null,
|
|
347
|
+
"currency_type_label": "EUR",
|
|
348
|
+
"image": null,
|
|
349
|
+
"datasource": null,
|
|
350
|
+
"datasource_detailed": null,
|
|
351
|
+
"extra_product_stock_detailed": null,
|
|
352
|
+
"extra_product_price_detailed": null
|
|
353
|
+
}],
|
|
354
|
+
"total_quantity": 1,
|
|
355
|
+
"total_amount": "54.49",
|
|
356
|
+
"total_discount_amount": "0.00",
|
|
357
|
+
"discounts": [],
|
|
358
|
+
"upsell_messages": [],
|
|
359
|
+
"total_product_amount": "54.49",
|
|
360
|
+
"pk": 73,
|
|
361
|
+
"created_date": "2023-02-03T09:03:04.791076Z",
|
|
362
|
+
"modified_date": "2023-04-10T11:30:26.634021Z"
|
|
363
|
+
},
|
|
364
|
+
"shipping_address": {
|
|
365
|
+
"pk": null,
|
|
366
|
+
"email": "akinon.mail@akinon.com",
|
|
367
|
+
"phone_number": "+321321321",
|
|
368
|
+
"first_name": "Firsname",
|
|
369
|
+
"last_name": "Lastname",
|
|
370
|
+
"country": {
|
|
371
|
+
"pk": 1,
|
|
372
|
+
"name": "Test Country",
|
|
373
|
+
"code": "tr"
|
|
374
|
+
},
|
|
375
|
+
"city": {
|
|
376
|
+
"pk": 1,
|
|
377
|
+
"name": "Test City 2",
|
|
378
|
+
"country": 1
|
|
379
|
+
},
|
|
380
|
+
"line": "Shop 2 Address",
|
|
381
|
+
"title": "Shop 2",
|
|
382
|
+
"township": {
|
|
383
|
+
"pk": 1,
|
|
384
|
+
"name": "Test Township 3",
|
|
385
|
+
"city": 1
|
|
386
|
+
},
|
|
387
|
+
"district": {
|
|
388
|
+
"pk": 1,
|
|
389
|
+
"name": "Test District 3",
|
|
390
|
+
"city": 1,
|
|
391
|
+
"township": 1
|
|
392
|
+
},
|
|
393
|
+
"postcode": null,
|
|
394
|
+
"notes": null,
|
|
395
|
+
"company_name": null,
|
|
396
|
+
"tax_office": null,
|
|
397
|
+
"tax_no": null,
|
|
398
|
+
"e_bill_taxpayer": false,
|
|
399
|
+
"primary": null,
|
|
400
|
+
"identity_number": null,
|
|
401
|
+
"extra_field": null
|
|
402
|
+
},
|
|
403
|
+
"billing_address": {
|
|
404
|
+
"pk": 84,
|
|
405
|
+
"email": "akinon.mail@akinon.com",
|
|
406
|
+
"phone_number": "05555555555",
|
|
407
|
+
"first_name": "Firsname",
|
|
408
|
+
"last_name": "Lastname",
|
|
409
|
+
"country": {
|
|
410
|
+
"pk": 1,
|
|
411
|
+
"name": "Test Country",
|
|
412
|
+
"code": "tr"
|
|
413
|
+
},
|
|
414
|
+
"city": {
|
|
415
|
+
"pk": 2,
|
|
416
|
+
"name": "Test City 1",
|
|
417
|
+
"country": 1
|
|
418
|
+
},
|
|
419
|
+
"line": "this is a test address.",
|
|
420
|
+
"title": "Test Title",
|
|
421
|
+
"township": {
|
|
422
|
+
"pk": 2,
|
|
423
|
+
"name": "Test Township 1",
|
|
424
|
+
"city": 2
|
|
425
|
+
},
|
|
426
|
+
"district": {
|
|
427
|
+
"pk": 2,
|
|
428
|
+
"name": "Test District 1",
|
|
429
|
+
"city": 2,
|
|
430
|
+
"township": 2
|
|
431
|
+
},
|
|
432
|
+
"postcode": "00000",
|
|
433
|
+
"notes": null,
|
|
434
|
+
"company_name": null,
|
|
435
|
+
"tax_office": null,
|
|
436
|
+
"tax_no": null,
|
|
437
|
+
"e_bill_taxpayer": false,
|
|
438
|
+
"is_corporate": false,
|
|
439
|
+
"primary": false,
|
|
440
|
+
"identity_number": null,
|
|
441
|
+
"extra_field": null
|
|
442
|
+
},
|
|
443
|
+
"shipping_option": {
|
|
444
|
+
"pk": 2,
|
|
445
|
+
"name": "UPS",
|
|
446
|
+
"slug": "ups",
|
|
447
|
+
"logo": null,
|
|
448
|
+
"shipping_amount": "8.50",
|
|
449
|
+
"description": null,
|
|
450
|
+
"kwargs": {}
|
|
451
|
+
},
|
|
452
|
+
"billing_and_shipping_same": false,
|
|
453
|
+
"payment_option": {
|
|
454
|
+
"pk": 1,
|
|
455
|
+
"name": "Credit Card",
|
|
456
|
+
"slug": "credit-card",
|
|
457
|
+
"payment_type": "credit_card",
|
|
458
|
+
"payment_type_label": "Credit Card"
|
|
459
|
+
},
|
|
460
|
+
"notifications": null,
|
|
461
|
+
"shipping_amount": "8.50",
|
|
462
|
+
"total_amount": "62.99",
|
|
463
|
+
"unpaid_amount": "62.99",
|
|
464
|
+
"loyalty_money": "0.00",
|
|
465
|
+
"currency_type_label": "TL",
|
|
466
|
+
"installment": null,
|
|
467
|
+
"redirect_to_three_d": null,
|
|
468
|
+
"delivery_option": {
|
|
469
|
+
"pk": 2,
|
|
470
|
+
"slug": "store",
|
|
471
|
+
"name": "Mağazadan Teslimat",
|
|
472
|
+
"delivery_option_type": "retail_store",
|
|
473
|
+
"sort_order": 1
|
|
474
|
+
},
|
|
475
|
+
"retail_store": {
|
|
476
|
+
"pk": 1,
|
|
477
|
+
"name": "Shop 2",
|
|
478
|
+
"township": {
|
|
479
|
+
"pk": 1,
|
|
480
|
+
"name": "Test Township 3",
|
|
481
|
+
"city": {
|
|
482
|
+
"pk": 1,
|
|
483
|
+
"name": "Test City 2",
|
|
484
|
+
"country": 1
|
|
485
|
+
}
|
|
486
|
+
},
|
|
487
|
+
"district": {
|
|
488
|
+
"pk": 1,
|
|
489
|
+
"name": "Test District 3",
|
|
490
|
+
"city": 1,
|
|
491
|
+
"township": 1
|
|
492
|
+
},
|
|
493
|
+
"address": "Shop 2 Address"
|
|
494
|
+
},
|
|
495
|
+
"payment_choice": null,
|
|
496
|
+
"phone_number": null,
|
|
497
|
+
"gift_box": null,
|
|
498
|
+
"delivery_range": null,
|
|
499
|
+
"user_phone_number": "05555555555",
|
|
500
|
+
"total_amount_with_interest": "62.99",
|
|
501
|
+
"is_guest": false,
|
|
502
|
+
"is_post_order": false
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
```
|
|
506
|
+
|
|
507
|
+
## useFetchCheckoutResultQuery
|
|
508
|
+
|
|
509
|
+
This function is used to fetch order data and checkout data after the payment step is completed.
|
|
510
|
+
|
|
511
|
+
The **useFetchCheckoutResultQuery** function is imported from `'@akinon/next/data/client/checkout'`.
|
|
512
|
+
|
|
513
|
+
```javascript
|
|
514
|
+
import { useFetchCheckoutResultQuery } from '@akinon/next/data/client/checkout';
|
|
515
|
+
```
|
|
516
|
+
|
|
517
|
+
To use this function, a variable needs to be created and the token value needs to be given to the function, like this:
|
|
518
|
+
|
|
519
|
+
```javascript
|
|
520
|
+
const { data, isLoading } = useFetchCheckoutResultQuery(String(params.token));
|
|
521
|
+
```
|
|
522
|
+
|
|
523
|
+
Data returned from the function:
|
|
524
|
+
|
|
525
|
+
```json
|
|
526
|
+
{
|
|
527
|
+
"campaigns": [],
|
|
528
|
+
"order": {
|
|
529
|
+
"id": 164,
|
|
530
|
+
"status": {
|
|
531
|
+
"value": "400",
|
|
532
|
+
"label": "Onaylandı"
|
|
533
|
+
},
|
|
534
|
+
"currency": {
|
|
535
|
+
"value": "try",
|
|
536
|
+
"label": "TL"
|
|
537
|
+
},
|
|
538
|
+
"orderitem_set": [{
|
|
539
|
+
"id": 363,
|
|
540
|
+
"status": {
|
|
541
|
+
"value": "400",
|
|
542
|
+
"label": "Onaylandı"
|
|
543
|
+
},
|
|
544
|
+
"price_currency": {
|
|
545
|
+
"value": "try",
|
|
546
|
+
"label": "TL"
|
|
547
|
+
},
|
|
548
|
+
"product": {
|
|
549
|
+
"pk": 29,
|
|
550
|
+
"sku": "4546327",
|
|
551
|
+
"base_code": "TF9253",
|
|
552
|
+
"name": "Product Name",
|
|
553
|
+
"image": "https://image-url.jpg",
|
|
554
|
+
"absolute_url": "/product-url/",
|
|
555
|
+
"attributes": {
|
|
556
|
+
...
|
|
557
|
+
},
|
|
558
|
+
"attributes_kwargs": {
|
|
559
|
+
...
|
|
560
|
+
},
|
|
561
|
+
"form_schema": null,
|
|
562
|
+
"data_source": null,
|
|
563
|
+
"extra_attributes": {}
|
|
564
|
+
},
|
|
565
|
+
"is_cancelled": false,
|
|
566
|
+
"is_cancellable": true,
|
|
567
|
+
"is_refundable": false,
|
|
568
|
+
"cancellationrequest_set": [],
|
|
569
|
+
"active_cancellation_request": null,
|
|
570
|
+
"shipping_company": null,
|
|
571
|
+
"tracking_url": null,
|
|
572
|
+
"is_tradable": false,
|
|
573
|
+
"available_easy_return_shipping_companies": [{
|
|
574
|
+
"pk": 1,
|
|
575
|
+
"shipping_company": {
|
|
576
|
+
"value": "yurtici",
|
|
577
|
+
"label": "Yurtiçi Kargo"
|
|
578
|
+
}
|
|
579
|
+
}],
|
|
580
|
+
"datasource_detailed": null,
|
|
581
|
+
"extra_product_stock_detailed": null,
|
|
582
|
+
"extra_product_price_detailed": null,
|
|
583
|
+
"created_date": "2023-05-09T14:32:54.660351Z",
|
|
584
|
+
"modified_date": "2023-05-09T14:33:01.526676Z",
|
|
585
|
+
"attributes": {},
|
|
586
|
+
"attributes_kwargs": {},
|
|
587
|
+
"localized_attributes": {},
|
|
588
|
+
"localized_attributes_kwargs": {},
|
|
589
|
+
"price": "1349.00",
|
|
590
|
+
"tax_rate": "8.00",
|
|
591
|
+
"invoice_number": null,
|
|
592
|
+
"invoice_date": null,
|
|
593
|
+
"e_archive_url": null,
|
|
594
|
+
"tracking_number": null,
|
|
595
|
+
"retail_price": "1349.00",
|
|
596
|
+
"image": null,
|
|
597
|
+
"extra_field": {
|
|
598
|
+
"price_extra_field": {},
|
|
599
|
+
"stock_extra_field": {}
|
|
600
|
+
},
|
|
601
|
+
"estimated_delivery_date": null,
|
|
602
|
+
"shipping_tracking_url": null,
|
|
603
|
+
"order": 164,
|
|
604
|
+
"parent": null,
|
|
605
|
+
"extra_product_price": null,
|
|
606
|
+
"extra_product_stock": null,
|
|
607
|
+
"datasource": null
|
|
608
|
+
}],
|
|
609
|
+
"discountitem_set": [],
|
|
610
|
+
"is_cancelled": false,
|
|
611
|
+
"is_cancellable": true,
|
|
612
|
+
"is_refundable": false,
|
|
613
|
+
"shipping_address": {
|
|
614
|
+
"pk": 108,
|
|
615
|
+
"email": "akinon.mail@akinon.com",
|
|
616
|
+
"phone_number": "05555555555",
|
|
617
|
+
"first_name": "firsname",
|
|
618
|
+
"last_name": "lastname",
|
|
619
|
+
"country": {
|
|
620
|
+
"pk": 1,
|
|
621
|
+
"is_active": true,
|
|
622
|
+
"name": "TÜRKİYE",
|
|
623
|
+
"code": "TR",
|
|
624
|
+
"translations": null
|
|
625
|
+
},
|
|
626
|
+
"city": {
|
|
627
|
+
"pk": 1,
|
|
628
|
+
"is_active": true,
|
|
629
|
+
"name": "ADANA",
|
|
630
|
+
"country": 1,
|
|
631
|
+
"translations": null,
|
|
632
|
+
"priority": null,
|
|
633
|
+
"postcode": null
|
|
634
|
+
},
|
|
635
|
+
"line": "this is a test address.",
|
|
636
|
+
"title": "test",
|
|
637
|
+
"township": {
|
|
638
|
+
"pk": 1,
|
|
639
|
+
"is_active": true,
|
|
640
|
+
"name": "ALADAĞ",
|
|
641
|
+
"city": 1,
|
|
642
|
+
"postcode": null
|
|
643
|
+
},
|
|
644
|
+
"district": {
|
|
645
|
+
"pk": 5,
|
|
646
|
+
"is_active": true,
|
|
647
|
+
"name": "AKÖREN MAH",
|
|
648
|
+
"city": 1,
|
|
649
|
+
"township": 1,
|
|
650
|
+
"postcode": null
|
|
651
|
+
},
|
|
652
|
+
"postcode": "00000",
|
|
653
|
+
"notes": null,
|
|
654
|
+
"company_name": "",
|
|
655
|
+
"tax_office": "",
|
|
656
|
+
"tax_no": "",
|
|
657
|
+
"e_bill_taxpayer": false,
|
|
658
|
+
"hash_data": "testakinon",
|
|
659
|
+
"address_type": "customer",
|
|
660
|
+
"retail_store": null,
|
|
661
|
+
"remote_id": null,
|
|
662
|
+
"identity_number": null,
|
|
663
|
+
"extra_field": null,
|
|
664
|
+
"user": {
|
|
665
|
+
"pk": 97,
|
|
666
|
+
"username": "ddd5c81fdaa6c9625e077d270573a61f",
|
|
667
|
+
"first_name": "firsname",
|
|
668
|
+
"last_name": "lastname",
|
|
669
|
+
"email": "akinon.mail@akinon.com",
|
|
670
|
+
"is_active": true,
|
|
671
|
+
"date_joined": "2023-05-09T14:30:13.110643Z",
|
|
672
|
+
"last_login": "2023-05-09T14:30:13.531807Z",
|
|
673
|
+
"email_allowed": false,
|
|
674
|
+
"sms_allowed": false,
|
|
675
|
+
"call_allowed": null,
|
|
676
|
+
"gender": null,
|
|
677
|
+
"attributes": {
|
|
678
|
+
"register_client_type": "default",
|
|
679
|
+
"verified_phone": true,
|
|
680
|
+
"logged_ip": "31.223.57.74"
|
|
681
|
+
},
|
|
682
|
+
"phone": "05555555555",
|
|
683
|
+
"date_of_birth": null,
|
|
684
|
+
"attributes_kwargs": {},
|
|
685
|
+
"user_type": "registered",
|
|
686
|
+
"modified_date": "2023-05-09T14:30:13.140105Z"
|
|
687
|
+
},
|
|
688
|
+
"is_corporate": false,
|
|
689
|
+
"primary": false
|
|
690
|
+
},
|
|
691
|
+
"billing_address": {
|
|
692
|
+
"pk": 108,
|
|
693
|
+
"email": "akinon.mail@akinon.com",
|
|
694
|
+
"phone_number": "05555555555",
|
|
695
|
+
"first_name": "firsname",
|
|
696
|
+
"last_name": "lastname",
|
|
697
|
+
"country": {
|
|
698
|
+
"pk": 1,
|
|
699
|
+
"is_active": true,
|
|
700
|
+
"name": "TÜRKİYE",
|
|
701
|
+
"code": "TR",
|
|
702
|
+
"translations": null
|
|
703
|
+
},
|
|
704
|
+
"city": {
|
|
705
|
+
"pk": 1,
|
|
706
|
+
"is_active": true,
|
|
707
|
+
"name": "ADANA",
|
|
708
|
+
"country": 1,
|
|
709
|
+
"translations": null,
|
|
710
|
+
"priority": null,
|
|
711
|
+
"postcode": null
|
|
712
|
+
},
|
|
713
|
+
"line": "this is a test address.",
|
|
714
|
+
"title": "test",
|
|
715
|
+
"township": {
|
|
716
|
+
"pk": 1,
|
|
717
|
+
"is_active": true,
|
|
718
|
+
"name": "ALADAĞ",
|
|
719
|
+
"city": 1,
|
|
720
|
+
"postcode": null
|
|
721
|
+
},
|
|
722
|
+
"district": {
|
|
723
|
+
"pk": 5,
|
|
724
|
+
"is_active": true,
|
|
725
|
+
"name": "AKÖREN MAH",
|
|
726
|
+
"city": 1,
|
|
727
|
+
"township": 1,
|
|
728
|
+
"postcode": null
|
|
729
|
+
},
|
|
730
|
+
"postcode": "00000",
|
|
731
|
+
"notes": null,
|
|
732
|
+
"company_name": "",
|
|
733
|
+
"tax_office": "",
|
|
734
|
+
"tax_no": "",
|
|
735
|
+
"e_bill_taxpayer": false,
|
|
736
|
+
"hash_data": "da5af4d2cb10b8b38194991817154730",
|
|
737
|
+
"address_type": "customer",
|
|
738
|
+
"retail_store": null,
|
|
739
|
+
"remote_id": null,
|
|
740
|
+
"identity_number": null,
|
|
741
|
+
"extra_field": null,
|
|
742
|
+
"user": {
|
|
743
|
+
"pk": 97,
|
|
744
|
+
"username": "ddd5c81fdaa6c9625e077d270573a61f",
|
|
745
|
+
"first_name": "firsname",
|
|
746
|
+
"last_name": "lastname",
|
|
747
|
+
"email": "akinon.mail@akinon.com",
|
|
748
|
+
"is_active": true,
|
|
749
|
+
"date_joined": "2023-05-09T14:30:13.110643Z",
|
|
750
|
+
"last_login": "2023-05-09T14:30:13.531807Z",
|
|
751
|
+
"email_allowed": false,
|
|
752
|
+
"sms_allowed": false,
|
|
753
|
+
"call_allowed": null,
|
|
754
|
+
"gender": null,
|
|
755
|
+
"attributes": {
|
|
756
|
+
"register_client_type": "default",
|
|
757
|
+
"verified_phone": true,
|
|
758
|
+
"logged_ip": "31.223.57.74"
|
|
759
|
+
},
|
|
760
|
+
"phone": "05555555555",
|
|
761
|
+
"date_of_birth": null,
|
|
762
|
+
"attributes_kwargs": {},
|
|
763
|
+
"user_type": "registered",
|
|
764
|
+
"modified_date": "2023-05-09T14:30:13.140105Z"
|
|
765
|
+
},
|
|
766
|
+
"is_corporate": false,
|
|
767
|
+
"primary": false
|
|
768
|
+
},
|
|
769
|
+
"shipping_company": null,
|
|
770
|
+
"client_type": "default",
|
|
771
|
+
"payment_option": {
|
|
772
|
+
"pk": 1,
|
|
773
|
+
"name": "Credit Card",
|
|
774
|
+
"payment_type": "credit_card",
|
|
775
|
+
"slug": "credit-card"
|
|
776
|
+
},
|
|
777
|
+
"amount_without_discount": "1349.00",
|
|
778
|
+
"is_payable": false,
|
|
779
|
+
"tracking_url": null,
|
|
780
|
+
"bank": {
|
|
781
|
+
"pk": 1,
|
|
782
|
+
"name": "Other",
|
|
783
|
+
"slug": "other",
|
|
784
|
+
"logo": "https://aad216.cdn.akinoncloud.com/banks/2023/02/28/74cd8546-8ef4-4e61-a5cc-a17fdd12fdae.jpg"
|
|
785
|
+
},
|
|
786
|
+
"created_date": "2023-05-09T14:32:54.651818Z",
|
|
787
|
+
"modified_date": "2023-05-09T14:33:01.528271Z",
|
|
788
|
+
"number": "2284207301612555",
|
|
789
|
+
"amount": "1349.00",
|
|
790
|
+
"discount_amount": "0.00",
|
|
791
|
+
"shipping_amount": "0.00",
|
|
792
|
+
"shipping_tax_rate": null,
|
|
793
|
+
"refund_amount": "0.00",
|
|
794
|
+
"discount_refund_amount": "0.00",
|
|
795
|
+
"shipping_refund_amount": "0.00",
|
|
796
|
+
"invoice_number": null,
|
|
797
|
+
"invoice_date": null,
|
|
798
|
+
"e_archive_url": null,
|
|
799
|
+
"tracking_number": null,
|
|
800
|
+
"remote_addr": "31.223.57.74",
|
|
801
|
+
"has_gift_box": false,
|
|
802
|
+
"gift_box_note": null,
|
|
803
|
+
"language_code": "tr-tr",
|
|
804
|
+
"notes": null,
|
|
805
|
+
"delivery_range": null,
|
|
806
|
+
"extra_field": {},
|
|
807
|
+
"user_email": "akinon.mail@akinon.com",
|
|
808
|
+
"shipping_option_slug": "yurtici",
|
|
809
|
+
"payment_option_slug": "credit-card",
|
|
810
|
+
"bin_number": "545454",
|
|
811
|
+
"installment_count": 1,
|
|
812
|
+
"installment_interest_amount": "0.00",
|
|
813
|
+
"shipping_tracking_url": null,
|
|
814
|
+
"user": 97,
|
|
815
|
+
"basket": 332,
|
|
816
|
+
"shipping_option": 1,
|
|
817
|
+
"card": 1,
|
|
818
|
+
"installment": 1,
|
|
819
|
+
"segment": null,
|
|
820
|
+
"checkout_provider": null
|
|
821
|
+
}
|
|
822
|
+
}
|
|
823
|
+
```
|
|
824
|
+
|
|
825
|
+
## useGetContractQuery
|
|
826
|
+
|
|
827
|
+
This function is used to fetch data for contracts from Omnitron for the checkout process.
|
|
828
|
+
|
|
829
|
+
The **useGetContractQuery** function is imported from `'@akinon/next/data/client/checkout'`.
|
|
830
|
+
|
|
831
|
+
```javascript
|
|
832
|
+
import { useGetContractQuery } from '@akinon/next/data/client/checkout';
|
|
833
|
+
```
|
|
834
|
+
|
|
835
|
+
To use this function, a variable needs to be created and the slug value needs to be given to the function, like this:
|
|
836
|
+
|
|
837
|
+
```javascript
|
|
838
|
+
const { data } = useGetContractQuery(slug, { skip: !isModalOpen });
|
|
839
|
+
```
|
|
840
|
+
|
|
841
|
+
Data returned from the function:
|
|
842
|
+
|
|
843
|
+
```
|
|
844
|
+
{
|
|
845
|
+
"result": "<div id=\"js-modal-information\" class=\"modal\"></div>"
|
|
846
|
+
}
|
|
847
|
+
```
|
|
848
|
+
|
|
849
|
+
The returned data can be used as follows:
|
|
850
|
+
|
|
851
|
+
```jsx
|
|
852
|
+
<div dangerouslySetInnerHTML={{ __html: data.result }}></div>
|
|
853
|
+
```
|
|
854
|
+
|
|
855
|
+
## useGet3dRedirectFormQuery
|
|
856
|
+
|
|
857
|
+
The **useGet3dRedirectFormQuery** hook sends a request to the endpoint **"/orders/redirect-three-d"** and retrieves HTML data in text format.
|
|
858
|
+
|
|
859
|
+
The returned HTML data contains a form. This form is selected and submitted by adding session information to it.
|
|
860
|
+
|
|
861
|
+
The **useGet3dRedirectFormQuery** hook is imported from `'@akinon/next/data/client/checkout'`.
|
|
862
|
+
|
|
863
|
+
```javascript
|
|
864
|
+
import { useGet3dRedirectFormQuery } from '@akinon/next/data/client/checkout';
|
|
865
|
+
```
|
|
866
|
+
|
|
867
|
+
To use the function, create a variable:
|
|
868
|
+
|
|
869
|
+
```javascript
|
|
870
|
+
const { data } = useGet3dRedirectFormQuery();
|
|
871
|
+
```
|
|
872
|
+
|
|
873
|
+
Next, create a fragment element and assign the **data.result** to its innerHTML:
|
|
874
|
+
|
|
875
|
+
```javascript
|
|
876
|
+
const fragment = document.createElement('fragment');
|
|
877
|
+
fragment.innerHTML = data.result;
|
|
878
|
+
```
|
|
879
|
+
If the data contains a **link[rel="canonical"]** query selector, the router is replaced:
|
|
880
|
+
|
|
881
|
+
```javascript
|
|
882
|
+
if (fragment.querySelector('link[rel="canonical"]')) {
|
|
883
|
+
setError('Redirection to 3D Secure failed. Please wait...');
|
|
884
|
+
|
|
885
|
+
setTimeout(() => {
|
|
886
|
+
router.replace(ROUTES.CHECKOUT);
|
|
887
|
+
}, 3000);
|
|
888
|
+
return;
|
|
889
|
+
}
|
|
890
|
+
```
|
|
891
|
+
|
|
892
|
+
If there's no **link[rel="canonical"]** query selector in the fragment, locate the form element within the fragment. Then, create an input element for a session, set its **type**, **name**, and **value** attributes, and append it to the form. The form is appended to the body before submitting it:
|
|
893
|
+
|
|
894
|
+
```javascript
|
|
895
|
+
const form = fragment.querySelector('form');
|
|
896
|
+
const sessionInput = document.createElement('input');
|
|
897
|
+
sessionInput.setAttribute('type', 'hidden');
|
|
898
|
+
sessionInput.setAttribute('name', 'session');
|
|
899
|
+
sessionInput.setAttribute('value', getCookie('osessionid'));
|
|
900
|
+
form.appendChild(sessionInput);
|
|
901
|
+
form.style.display = 'none';
|
|
902
|
+
document.body.appendChild(form);
|
|
903
|
+
form.submit();
|
|
904
|
+
```
|