From 34b0e4753c23d74c77ee7ae5284c79f9fafc832d Mon Sep 17 00:00:00 2001 From: victor mendoza Date: Fri, 19 Jul 2024 17:55:06 -0300 Subject: [PATCH 001/103] feat: add image for dark mode --- public/images/moon.svg | 1 + public/images/son.svg | 1 + 2 files changed, 2 insertions(+) create mode 100644 public/images/moon.svg create mode 100644 public/images/son.svg diff --git a/public/images/moon.svg b/public/images/moon.svg new file mode 100644 index 0000000..c2f0dce --- /dev/null +++ b/public/images/moon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/images/son.svg b/public/images/son.svg new file mode 100644 index 0000000..4518d6f --- /dev/null +++ b/public/images/son.svg @@ -0,0 +1 @@ + \ No newline at end of file From 025af990760eb758cdac65e29c2157c60dc40840 Mon Sep 17 00:00:00 2001 From: victor mendoza Date: Fri, 19 Jul 2024 17:56:51 -0300 Subject: [PATCH 002/103] feat: add css for dark mode --- public/css/app.css | 199 +++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 185 insertions(+), 14 deletions(-) diff --git a/public/css/app.css b/public/css/app.css index 168e18a..ab31cb5 100644 --- a/public/css/app.css +++ b/public/css/app.css @@ -21,22 +21,50 @@ font-style: normal; } +/*------------- Dark mode------------ */ + +:root[data-theme="dark"] { + --primary-text: #f6f7f9; + --text-black: #ebecf0; + --tbk-black-bg: rgb(35 39 47/0.95); + --background: #1b1e25; + --elevation: rgb(35 39 47/0.95); + --elevation-w: rgb(35 39 47/0.95); + --images-dark: contrast(100) brightness(100%) saturate(0%) invert(100%); + --bg-hover: #343a46; + --tbk-red: #f6f7f9; + --shadow-elevation: inset 0 0 0 1px hsla(0, 0%, 100%, 0.08); + --white-elevation: 0 0 0 1px hsla(0, 0%, 100%, 0.15), + 0px 0.8px 2px rgba(0, 0, 0, 0.032), 0px 2.7px 6.7px rgba(0, 0, 0, 0.048), + 0px 12px 30px rgba(0, 0, 0, 0.08); +} + :root { - --foreground-rgb: 0, 0, 0; - --tbk-white: #fcfdfe; + --images-dark: none; + --primary-text: #0e1520; + --elevation: #fcfdfe; + --elevation-w: #fff; --tbk-red: #d5006c; --tbk-red-dark: #cc0066; --tbk-light-red: #d5006c0d; --tbk-border: #e7ebf3; + --background: #ffffff; + --white: #ffffff; --tbk-grey: #828ea5; --tbk-grey-2: #707382; --tbk-grey-3: #8c939f; + --tbk-grey-4: #343a46; --tbk-black: #0e1520; --tbk-black-2: #2d3338; - --tbk-black-3: #333333; + --text-black: #333333; --tbk-black-bg: #1f242e; --tbk-border-blue: #c9d0e4; --tbk-table-header: rgba(213, 0, 108, 0.05); + + ---bg-hover: #343a46; + + /* --wbox-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), + var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow); */ } * { @@ -44,7 +72,7 @@ } body { - color: rgb(var(--foreground-rgb)); + background-color: var(--background); font-family: "Roboto", sans-serif; margin: 0px; padding: 0px; @@ -57,6 +85,9 @@ h1 { line-height: 32px; letter-spacing: 0.25px; font-weight: 700; + .dark & { + color: var(--primary-text); + } } h2 { @@ -66,6 +97,9 @@ h2 { font-size: 1em; font-weight: 700; letter-spacing: 0.25px; + .dark & { + color: var(--primary-text); + } } p { @@ -76,6 +110,9 @@ p { font-weight: 400; line-height: 24px; letter-spacing: 0.25px; + .dark & { + color: var(--primary-text); + } } a { @@ -83,13 +120,17 @@ a { text-decoration: none; } -ul { - padding: 0px; +ul, +ol { + padding-left: 30px; margin: 0px; } li { - list-style: none; + margin-bottom: 5px; + .dark & { + color: var(--primary-text); + } } input { @@ -100,6 +141,16 @@ input { letter-spacing: 0.25px; } +h1.title { + color: var(--primary-text); + text-align: center; + font-family: "Roboto", sans-serif; + font-size: 2.125em; + font-weight: 700; + line-height: 54px; + letter-spacing: 0.25px; +} + /* utils */ .aling-self-end { @@ -115,9 +166,16 @@ input { flex-direction: column; } +.fw-700 { + font-weight: 700; +} + .text-tbk-red { --tw-text-opacity: 1; color: rgb(213 0 108 / var(--tw-text-opacity)); + .dark & { + color: var(--primary-text); + } } .underline { @@ -163,6 +221,10 @@ input { flex-direction: column; box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.25); max-width: 607px; + .dark & { + background-color: var(--tbk-black-bg); + box-shadow: var(--white-elevation); + } } .tbk-card-footer { @@ -175,6 +237,9 @@ input { font-weight: 500; font-size: 1em; margin-bottom: 38px; + .dark & { + color: var(--primary-text); + } } /* inputs */ @@ -185,6 +250,9 @@ input { line-height: 1.25rem; font-weight: 500; color: var(--tbk-grey); + .dark & { + color: var(--primary-text); + } } .tbk-input-text { @@ -198,6 +266,9 @@ input { border: 0px solid #e5e7eb; border-color: var(--tbk-border-blue); border-bottom-width: 1px; + .dark & { + color: var(--primary-text); + } } .tbk-input-text:focus { @@ -224,7 +295,17 @@ input { width: 100%; height: 80px; box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.08); - background-color: var(--tbk-white); + background-color: var(--elevation); +} + +.tbk-header-options { + display: flex; + align-items: center; + gap: 15px; +} + +.tbk-logo { + filter: var(--images-dark); } /* footer */ @@ -263,9 +344,13 @@ input { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px; border-radius: 0.25rem; - color: #000000; + color: var(--text-black); border-color: var(--tbk-light-red); background: var(--tbk-light-red); + .dark & { + background-color: var(--tbk-black-bg); + color: var(--text-black); + } } .question-item { @@ -277,6 +362,9 @@ input { .question-item .title { text-align: center; color: var(--tbk-black); + .dark & { + color: var(--primary-text); + } } .question-item .inner-container { @@ -286,10 +374,16 @@ input { gap: 16px; align-items: center; background-color: #ffffff; + .dark & { + background-color: var(--tbk-grey-4); + } } .question-item .inner-container img { cursor: pointer; + .dark & { + filter: var(--images-dark); + } } .question-item .inner-container .content { @@ -312,6 +406,10 @@ input { 0px 0px 2px 0px rgba(0, 0, 0, 0.04); color: var(--tbk-black); top: 20px; + .dark & { + background-color: var(--tbk-black-bg); + box-shadow: var(--shadow-elevation); + } } .nav-title { @@ -321,6 +419,9 @@ input { color: var(--tbk-black); padding: 8px 0px; border-bottom: 1px solid var(--tbk-red); + .dark & { + color: var(--primary-text); + } } .nav-container .item { @@ -341,6 +442,8 @@ input { display: flex; flex-direction: column; row-gap: 24px; + list-style: none; + padding: 0px; } /* bottons */ @@ -355,6 +458,12 @@ input { color: white; cursor: pointer; border: none; + + .dark & { + background-color: transparent; + color: var(--primary-text); + border: 1px solid var(--white); + } } .tbk-button.small-button { @@ -365,10 +474,18 @@ input { .tbk-button.primary { border-radius: 0.25rem; height: 40px; + .dark & { + background-color: transparent; + color: var(--primary-text); + border: 1px solid var(--white); + } } .tbk-button.primary:hover { background-color: var(--tbk-red-dark); + .dark & { + background-color: transparent; + } } .tbk-button.secondary { @@ -378,6 +495,28 @@ input { line-height: 1.5rem; height: 46px; border-radius: 10px; + .dark & { + background-color: transparent; + color: var(--primary-text); + border: 1px solid var(--white); + } +} + +.dark-mode-btn { + cursor: pointer; + border: none; + background-color: transparent; +} + +.dark .moon-img { + display: none; +} + +.son-img { + display: none; + .dark & { + display: block; + } } /* menu */ @@ -394,7 +533,7 @@ input { padding-left: 8px; padding-right: 8px; flex-direction: column; - row-gap: 24px; + row-gap: 8px; } .tbk-menu-item-text { @@ -403,13 +542,22 @@ input { line-height: 1.75rem; font-weight: 700; color: var(--tbk-grey); + .dark & { + color: var(--primary-text); + } } .tbk-menu-item { - padding-left: 12px; - padding-right: 12px; + padding: 8px 12px; color: var(--tbk-black); cursor: pointer; + border-radius: 10px; + &:hover { + background-color: var(--bg-hover); + } + .dark & { + color: var(--tbk-grey); + } } .tbk-menu-item:hover { @@ -418,6 +566,9 @@ input { .tbk-menu-item.active { color: var(--tbk-red); + .dark & { + background-color: var(--bg-hover); + } } /* pages content styles */ @@ -452,7 +603,7 @@ input { } .tbk-home-text { - color: var(--tbk-black-3); + color: var(--text-black); font-size: 1.25em; line-height: 30px; letter-spacing: 0.25px; @@ -484,6 +635,9 @@ input { border-radius: 15px; height: 385px; max-width: 552px; + .dark & { + box-shadow: var(--white-elevation); + } } .card-info-body { @@ -491,14 +645,18 @@ input { align-items: center; flex-direction: column; padding: 40px 32px 0 32px; + border-top-left-radius: 15px; + border-top-right-radius: 15px; + background-color: var(--elevation-w); } .card-info-image { + filter: var(--images-dark); margin-bottom: 34px; } .card-info-text { - color: var(--tbk-black-3); + color: var(--text-black); font-size: 20px; line-height: 30px; letter-spacing: 0.25px; @@ -516,4 +674,17 @@ input { background-color: var(--tbk-red); border-bottom-left-radius: 15px; border-bottom-right-radius: 15px; + + .dark & { + background-color: var(--tbk-grey-4); + } +} + +@media (max-width: 1439.98px) { + .body-container { + grid-template-columns: 280px 1fr; + } + .helper-content { + display: none; + } } From b5c2f9f8845bb14d713a011d1ecde0013d38bc58 Mon Sep 17 00:00:00 2001 From: victor mendoza Date: Fri, 19 Jul 2024 17:57:51 -0300 Subject: [PATCH 003/103] fix: use correct tag for text --- resources/views/webpay/commit.blade.php | 20 +++++++++----------- resources/views/webpay/create.blade.php | 6 ++++-- resources/views/webpay/refund.blade.php | 4 +--- 3 files changed, 14 insertions(+), 16 deletions(-) diff --git a/resources/views/webpay/commit.blade.php b/resources/views/webpay/commit.blade.php index 831e7ce..82aedf6 100644 --- a/resources/views/webpay/commit.blade.php +++ b/resources/views/webpay/commit.blade.php @@ -11,8 +11,10 @@

Paso 1 - Datos recibidos:

    -
    Después de completar el flujo en el formulario de pago, recibirás un POST con la siguiente - información:
    +

    + Después de completar el flujo en el formulario de pago, recibirás un POST con la siguiente + información: +

@dump($resp)
@@ -42,22 +44,18 @@

Después de confirmar la transacción, podrás realizar otras operaciones útiles: +

  • - Reembolsar: Puedes reversar o anular el pago según ciertas condiciones comerciales. + Reembolsar: Puedes reversar o anular el pago según ciertas condiciones + comerciales.
  • - Consultar Estado: Hasta 7 días después de la transacción, podrás consultar el estado de la + Consultar Estado: Hasta 7 días después de la transacción, podrás consultar el + estado de la transacción.
-

- -
- Por último, con la respuesta del servicio que confirma la creación de la transacción, procedemos - a crear el formulario de pago. Para fines de este ejemplo, haremos visible el campo "token_ws", el cual es - esencial para completar el proceso de pago de manera exitosa. -
@csrf diff --git a/resources/views/webpay/create.blade.php b/resources/views/webpay/create.blade.php index 7afe56e..37c47ea 100644 --- a/resources/views/webpay/create.blade.php +++ b/resources/views/webpay/create.blade.php @@ -43,9 +43,11 @@ tabla -
Por último, con la respuesta del servicio que confirma la creación de la transacción, procedemos +

Por último, con la respuesta del servicio que confirma la creación de la transacción, procedemos a crear el formulario de pago. Para fines de este ejemplo, haremos visible el campo "token_ws", el cual es - esencial para completar el proceso de pago de manera exitosa.

+ esencial para completar el proceso de pago de manera exitosa. +

+ url }} action="POST">
Formulario de redirección diff --git a/resources/views/webpay/refund.blade.php b/resources/views/webpay/refund.blade.php index dbcd959..1ef1e2e 100644 --- a/resources/views/webpay/refund.blade.php +++ b/resources/views/webpay/refund.blade.php @@ -17,7 +17,7 @@ una Anulación Parcial si el monto es menor al total.

- Condiciones Importantes: +

Condiciones Importantes:

  • No es posible realizar Anulaciones ni Anulaciones Parciales en tarjetas que no sean de crédito. @@ -35,6 +35,4 @@
    @dump($resp)
    - - From 1b937d602888f407922a67e0e8718b74c466113a Mon Sep 17 00:00:00 2001 From: victor mendoza Date: Fri, 19 Jul 2024 17:58:07 -0300 Subject: [PATCH 004/103] feat: create dark mode component --- resources/views/components/darkMode.blade.php | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 resources/views/components/darkMode.blade.php diff --git a/resources/views/components/darkMode.blade.php b/resources/views/components/darkMode.blade.php new file mode 100644 index 0000000..47bd70d --- /dev/null +++ b/resources/views/components/darkMode.blade.php @@ -0,0 +1,25 @@ + + +@push('scripts') + +@endpush From df4caf6ba59fce9f2021da4ab90bd81d578c1df6 Mon Sep 17 00:00:00 2001 From: victor mendoza Date: Fri, 19 Jul 2024 17:58:44 -0300 Subject: [PATCH 005/103] feat: prepare dark mode ins layouts --- resources/views/components/layout.blade.php | 2 +- resources/views/home.blade.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/resources/views/components/layout.blade.php b/resources/views/components/layout.blade.php index 946402a..e4a27bf 100644 --- a/resources/views/components/layout.blade.php +++ b/resources/views/components/layout.blade.php @@ -1,5 +1,5 @@ - + diff --git a/resources/views/home.blade.php b/resources/views/home.blade.php index 449f9e4..4678659 100644 --- a/resources/views/home.blade.php +++ b/resources/views/home.blade.php @@ -1,5 +1,5 @@ - + @@ -13,7 +13,7 @@ @include('partials.header')
    -

    Proyectos de Ejemplo del SDK para PHP

    +

    Proyectos de Ejemplo del SDK para PHP

    Node.js Logo @@ -92,7 +92,7 @@ class="card-info-image" />
    @include('partials.footer')
    - + @stack('scripts') From 647d5c29bd201b2ec04c28b47dd2b60c8904a6d4 Mon Sep 17 00:00:00 2001 From: victor mendoza Date: Fri, 19 Jul 2024 17:59:02 -0300 Subject: [PATCH 006/103] fix: use correct html tag for images --- resources/views/partials/channels.blade.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/resources/views/partials/channels.blade.php b/resources/views/partials/channels.blade.php index 441c64f..3561131 100644 --- a/resources/views/partials/channels.blade.php +++ b/resources/views/partials/channels.blade.php @@ -6,8 +6,7 @@ Escríbenos por slack
    - slack + slack Únete a nuestra comunidad de integradores. Nuestro equipo está ahí para ayudarte @@ -18,8 +17,7 @@ Envíanos un mensaje
    - outlook + outlook Necesitas resolver algún tipo de incidencia, contáctanos a través de correo electrónico From 3bc2c0825a07d191ab4108a633ddb00ae5d7e3b3 Mon Sep 17 00:00:00 2001 From: victor mendoza Date: Fri, 19 Jul 2024 17:59:22 -0300 Subject: [PATCH 007/103] feat: add dark mode component in header --- resources/views/partials/header.blade.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/resources/views/partials/header.blade.php b/resources/views/partials/header.blade.php index 2d1e88d..df06925 100644 --- a/resources/views/partials/header.blade.php +++ b/resources/views/partials/header.blade.php @@ -1,7 +1,10 @@ From 9b05f65ffef01d1bba695bf39253dd344919c33a Mon Sep 17 00:00:00 2001 From: victor mendoza Date: Fri, 19 Jul 2024 18:39:44 -0300 Subject: [PATCH 008/103] fix: typo --- public/css/app.css | 2 +- public/images/{son.svg => sun.svg} | 0 resources/views/components/darkMode.blade.php | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) rename public/images/{son.svg => sun.svg} (100%) diff --git a/public/css/app.css b/public/css/app.css index ab31cb5..7990356 100644 --- a/public/css/app.css +++ b/public/css/app.css @@ -512,7 +512,7 @@ h1.title { display: none; } -.son-img { +.sun-img { display: none; .dark & { display: block; diff --git a/public/images/son.svg b/public/images/sun.svg similarity index 100% rename from public/images/son.svg rename to public/images/sun.svg diff --git a/resources/views/components/darkMode.blade.php b/resources/views/components/darkMode.blade.php index 47bd70d..7ff6306 100644 --- a/resources/views/components/darkMode.blade.php +++ b/resources/views/components/darkMode.blade.php @@ -1,5 +1,5 @@ From 1e85ff2fde833b7324e57150749a29611e7f9fd5 Mon Sep 17 00:00:00 2001 From: victor mendoza Date: Fri, 19 Jul 2024 18:39:57 -0300 Subject: [PATCH 009/103] fix: remove commet --- public/css/app.css | 3 --- 1 file changed, 3 deletions(-) diff --git a/public/css/app.css b/public/css/app.css index 7990356..650a8ca 100644 --- a/public/css/app.css +++ b/public/css/app.css @@ -62,9 +62,6 @@ --tbk-table-header: rgba(213, 0, 108, 0.05); ---bg-hover: #343a46; - - /* --wbox-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), - var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow); */ } * { From 8f528d0f48e4416040aed704e9d5bcfffd259fe0 Mon Sep 17 00:00:00 2001 From: victor mendoza Date: Fri, 19 Jul 2024 18:40:12 -0300 Subject: [PATCH 010/103] feat: add dark mode in local storage --- resources/views/components/darkMode.blade.php | 30 ++++++++++++++----- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/resources/views/components/darkMode.blade.php b/resources/views/components/darkMode.blade.php index 7ff6306..5c452b5 100644 --- a/resources/views/components/darkMode.blade.php +++ b/resources/views/components/darkMode.blade.php @@ -6,19 +6,35 @@ @push('scripts') From 332b92ecab354f2d8b58d5777c41cba8f9049ad1 Mon Sep 17 00:00:00 2001 From: victor mendoza Date: Fri, 19 Jul 2024 18:43:16 -0300 Subject: [PATCH 011/103] fix: correct method in docs --- resources/views/webpay/commit.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/webpay/commit.blade.php b/resources/views/webpay/commit.blade.php index 82aedf6..dd96227 100644 --- a/resources/views/webpay/commit.blade.php +++ b/resources/views/webpay/commit.blade.php @@ -12,7 +12,7 @@

    Paso 1 - Datos recibidos:

      - Después de completar el flujo en el formulario de pago, recibirás un POST con la siguiente + Después de completar el flujo en el formulario de pago, recibirás un GET con la siguiente información:

    From 43881380836638fb0ce0a7a213cdf81e93b03620 Mon Sep 17 00:00:00 2001 From: victor mendoza Date: Wed, 24 Jul 2024 17:57:20 -0300 Subject: [PATCH 012/103] chore: add highlight for snippets --- package-lock.json | 1050 +++++++++++++++++++++++++++++++++++++++++++++ package.json | 4 + 2 files changed, 1054 insertions(+) create mode 100644 package-lock.json diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..72f4491 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,1050 @@ +{ + "name": "transbank-sdk-php-example", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "dependencies": { + "clipboard": "^2.0.11", + "highlight.js": "^11.10.0" + }, + "devDependencies": { + "axios": "^1.6.4", + "laravel-vite-plugin": "^1.0", + "vite": "^5.0" + } + }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz", + "integrity": "sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.5.tgz", + "integrity": "sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.5.tgz", + "integrity": "sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.5.tgz", + "integrity": "sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz", + "integrity": "sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz", + "integrity": "sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.5.tgz", + "integrity": "sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.5.tgz", + "integrity": "sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.5.tgz", + "integrity": "sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.5.tgz", + "integrity": "sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.5.tgz", + "integrity": "sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.5.tgz", + "integrity": "sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.5.tgz", + "integrity": "sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.5.tgz", + "integrity": "sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.5.tgz", + "integrity": "sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.5.tgz", + "integrity": "sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz", + "integrity": "sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz", + "integrity": "sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz", + "integrity": "sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.5.tgz", + "integrity": "sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.5.tgz", + "integrity": "sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.5.tgz", + "integrity": "sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz", + "integrity": "sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@rollup/rollup-android-arm-eabi": { + "version": "4.19.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.19.0.tgz", + "integrity": "sha512-JlPfZ/C7yn5S5p0yKk7uhHTTnFlvTgLetl2VxqE518QgyM7C9bSfFTYvB/Q/ftkq0RIPY4ySxTz+/wKJ/dXC0w==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-android-arm64": { + "version": "4.19.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.19.0.tgz", + "integrity": "sha512-RDxUSY8D1tWYfn00DDi5myxKgOk6RvWPxhmWexcICt/MEC6yEMr4HNCu1sXXYLw8iAsg0D44NuU+qNq7zVWCrw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-darwin-arm64": { + "version": "4.19.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.19.0.tgz", + "integrity": "sha512-emvKHL4B15x6nlNTBMtIaC9tLPRpeA5jMvRLXVbl/W9Ie7HhkrE7KQjvgS9uxgatL1HmHWDXk5TTS4IaNJxbAA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-darwin-x64": { + "version": "4.19.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.19.0.tgz", + "integrity": "sha512-fO28cWA1dC57qCd+D0rfLC4VPbh6EOJXrreBmFLWPGI9dpMlER2YwSPZzSGfq11XgcEpPukPTfEVFtw2q2nYJg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-linux-arm-gnueabihf": { + "version": "4.19.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.19.0.tgz", + "integrity": "sha512-2Rn36Ubxdv32NUcfm0wB1tgKqkQuft00PtM23VqLuCUR4N5jcNWDoV5iBC9jeGdgS38WK66ElncprqgMUOyomw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm-musleabihf": { + "version": "4.19.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.19.0.tgz", + "integrity": "sha512-gJuzIVdq/X1ZA2bHeCGCISe0VWqCoNT8BvkQ+BfsixXwTOndhtLUpOg0A1Fcx/+eA6ei6rMBzlOz4JzmiDw7JQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-gnu": { + "version": "4.19.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.19.0.tgz", + "integrity": "sha512-0EkX2HYPkSADo9cfeGFoQ7R0/wTKb7q6DdwI4Yn/ULFE1wuRRCHybxpl2goQrx4c/yzK3I8OlgtBu4xvted0ug==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-musl": { + "version": "4.19.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.19.0.tgz", + "integrity": "sha512-GlIQRj9px52ISomIOEUq/IojLZqzkvRpdP3cLgIE1wUWaiU5Takwlzpz002q0Nxxr1y2ZgxC2obWxjr13lvxNQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-powerpc64le-gnu": { + "version": "4.19.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.19.0.tgz", + "integrity": "sha512-N6cFJzssruDLUOKfEKeovCKiHcdwVYOT1Hs6dovDQ61+Y9n3Ek4zXvtghPPelt6U0AH4aDGnDLb83uiJMkWYzQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-gnu": { + "version": "4.19.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.19.0.tgz", + "integrity": "sha512-2DnD3mkS2uuam/alF+I7M84koGwvn3ZVD7uG+LEWpyzo/bq8+kKnus2EVCkcvh6PlNB8QPNFOz6fWd5N8o1CYg==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-s390x-gnu": { + "version": "4.19.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.19.0.tgz", + "integrity": "sha512-D6pkaF7OpE7lzlTOFCB2m3Ngzu2ykw40Nka9WmKGUOTS3xcIieHe82slQlNq69sVB04ch73thKYIWz/Ian8DUA==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-gnu": { + "version": "4.19.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.19.0.tgz", + "integrity": "sha512-HBndjQLP8OsdJNSxpNIN0einbDmRFg9+UQeZV1eiYupIRuZsDEoeGU43NQsS34Pp166DtwQOnpcbV/zQxM+rWA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-musl": { + "version": "4.19.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.19.0.tgz", + "integrity": "sha512-HxfbvfCKJe/RMYJJn0a12eiOI9OOtAUF4G6ozrFUK95BNyoJaSiBjIOHjZskTUffUrB84IPKkFG9H9nEvJGW6A==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-win32-arm64-msvc": { + "version": "4.19.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.19.0.tgz", + "integrity": "sha512-HxDMKIhmcguGTiP5TsLNolwBUK3nGGUEoV/BO9ldUBoMLBssvh4J0X8pf11i1fTV7WShWItB1bKAKjX4RQeYmg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-ia32-msvc": { + "version": "4.19.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.19.0.tgz", + "integrity": "sha512-xItlIAZZaiG/u0wooGzRsx11rokP4qyc/79LkAOdznGRAbOFc+SfEdfUOszG1odsHNgwippUJavag/+W/Etc6Q==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-msvc": { + "version": "4.19.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.19.0.tgz", + "integrity": "sha512-xNo5fV5ycvCCKqiZcpB65VMR11NJB+StnxHz20jdqRAktfdfzhgjTiJ2doTDQE/7dqGaV5I7ZGqKpgph6lCIag==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@types/estree": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", + "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==", + "dev": true, + "license": "MIT" + }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/axios": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.2.tgz", + "integrity": "sha512-2A8QhOMrbomlDuiLeK9XibIBzuHeRcqqNOHp0Cyp5EoJ1IFDh+XZH3A6BkXtv0K4gFGCI0Y4BM7B1wOEi0Rmgw==", + "dev": true, + "license": "MIT", + "dependencies": { + "follow-redirects": "^1.15.6", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" + } + }, + "node_modules/clipboard": { + "version": "2.0.11", + "resolved": "https://registry.npmjs.org/clipboard/-/clipboard-2.0.11.tgz", + "integrity": "sha512-C+0bbOqkezLIsmWSvlsXS0Q0bmkugu7jcfMIACB+RDEntIzQIkdr148we28AfSloQLRdZlYL/QYyrq05j/3Faw==", + "license": "MIT", + "dependencies": { + "good-listener": "^1.2.2", + "select": "^1.1.2", + "tiny-emitter": "^2.0.0" + } + }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dev": true, + "license": "MIT", + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/delegate": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/delegate/-/delegate-3.2.0.tgz", + "integrity": "sha512-IofjkYBZaZivn0V8nnsMJGBr4jVLxHDheKSW88PyxS5QC4Vo9ZbZVvhzlSxY87fVq3STR6r+4cGepyHkcWOQSw==", + "license": "MIT" + }, + "node_modules/esbuild": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.5.tgz", + "integrity": "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.21.5", + "@esbuild/android-arm": "0.21.5", + "@esbuild/android-arm64": "0.21.5", + "@esbuild/android-x64": "0.21.5", + "@esbuild/darwin-arm64": "0.21.5", + "@esbuild/darwin-x64": "0.21.5", + "@esbuild/freebsd-arm64": "0.21.5", + "@esbuild/freebsd-x64": "0.21.5", + "@esbuild/linux-arm": "0.21.5", + "@esbuild/linux-arm64": "0.21.5", + "@esbuild/linux-ia32": "0.21.5", + "@esbuild/linux-loong64": "0.21.5", + "@esbuild/linux-mips64el": "0.21.5", + "@esbuild/linux-ppc64": "0.21.5", + "@esbuild/linux-riscv64": "0.21.5", + "@esbuild/linux-s390x": "0.21.5", + "@esbuild/linux-x64": "0.21.5", + "@esbuild/netbsd-x64": "0.21.5", + "@esbuild/openbsd-x64": "0.21.5", + "@esbuild/sunos-x64": "0.21.5", + "@esbuild/win32-arm64": "0.21.5", + "@esbuild/win32-ia32": "0.21.5", + "@esbuild/win32-x64": "0.21.5" + } + }, + "node_modules/follow-redirects": { + "version": "1.15.6", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.6.tgz", + "integrity": "sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "license": "MIT", + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, + "node_modules/form-data": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "dev": true, + "license": "MIT", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/good-listener": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/good-listener/-/good-listener-1.2.2.tgz", + "integrity": "sha512-goW1b+d9q/HIwbVYZzZ6SsTr4IgE+WA44A0GmPIQstuOrgsFcT7VEJ48nmr9GaRtNu0XTKacFLGnBPAM6Afouw==", + "license": "MIT", + "dependencies": { + "delegate": "^3.1.2" + } + }, + "node_modules/highlight.js": { + "version": "11.10.0", + "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-11.10.0.tgz", + "integrity": "sha512-SYVnVFswQER+zu1laSya563s+F8VDGt7o35d4utbamowvUNLLMovFqwCLSocpZTz3MgaSRA1IbqRWZv97dtErQ==", + "license": "BSD-3-Clause", + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/laravel-vite-plugin": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/laravel-vite-plugin/-/laravel-vite-plugin-1.0.5.tgz", + "integrity": "sha512-Zv+to82YLBknDCZ6g3iwOv9wZ7f6EWStb9pjSm7MGe9Mfoy5ynT2ssZbGsMr1udU6rDg9HOoYEVGw5Qf+p9zbw==", + "dev": true, + "license": "MIT", + "dependencies": { + "picocolors": "^1.0.0", + "vite-plugin-full-reload": "^1.1.0" + }, + "bin": { + "clean-orphaned-assets": "bin/clean.js" + }, + "engines": { + "node": "^18.0.0 || >=20.0.0" + }, + "peerDependencies": { + "vite": "^5.0.0" + } + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "dev": true, + "license": "MIT", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/nanoid": { + "version": "3.3.7", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz", + "integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/picocolors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.1.tgz", + "integrity": "sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==", + "dev": true, + "license": "ISC" + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/postcss": { + "version": "8.4.39", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.39.tgz", + "integrity": "sha512-0vzE+lAiG7hZl1/9I8yzKLx3aR9Xbof3fBHKunvMfOCYAtMhrsnccJY2iTURb9EZd5+pLuiNV9/c/GZJOHsgIw==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "nanoid": "^3.3.7", + "picocolors": "^1.0.1", + "source-map-js": "^1.2.0" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==", + "dev": true, + "license": "MIT" + }, + "node_modules/rollup": { + "version": "4.19.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.19.0.tgz", + "integrity": "sha512-5r7EYSQIowHsK4eTZ0Y81qpZuJz+MUuYeqmmYmRMl1nwhdmbiYqt5jwzf6u7wyOzJgYqtCRMtVRKOtHANBz7rA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "1.0.5" + }, + "bin": { + "rollup": "dist/bin/rollup" + }, + "engines": { + "node": ">=18.0.0", + "npm": ">=8.0.0" + }, + "optionalDependencies": { + "@rollup/rollup-android-arm-eabi": "4.19.0", + "@rollup/rollup-android-arm64": "4.19.0", + "@rollup/rollup-darwin-arm64": "4.19.0", + "@rollup/rollup-darwin-x64": "4.19.0", + "@rollup/rollup-linux-arm-gnueabihf": "4.19.0", + "@rollup/rollup-linux-arm-musleabihf": "4.19.0", + "@rollup/rollup-linux-arm64-gnu": "4.19.0", + "@rollup/rollup-linux-arm64-musl": "4.19.0", + "@rollup/rollup-linux-powerpc64le-gnu": "4.19.0", + "@rollup/rollup-linux-riscv64-gnu": "4.19.0", + "@rollup/rollup-linux-s390x-gnu": "4.19.0", + "@rollup/rollup-linux-x64-gnu": "4.19.0", + "@rollup/rollup-linux-x64-musl": "4.19.0", + "@rollup/rollup-win32-arm64-msvc": "4.19.0", + "@rollup/rollup-win32-ia32-msvc": "4.19.0", + "@rollup/rollup-win32-x64-msvc": "4.19.0", + "fsevents": "~2.3.2" + } + }, + "node_modules/select": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/select/-/select-1.1.2.tgz", + "integrity": "sha512-OwpTSOfy6xSs1+pwcNrv0RBMOzI39Lp3qQKUTPVVPRjCdNa5JH/oPRiqsesIskK8TVgmRiHwO4KXlV2Li9dANA==", + "license": "MIT" + }, + "node_modules/source-map-js": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.0.tgz", + "integrity": "sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/tiny-emitter": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/tiny-emitter/-/tiny-emitter-2.1.0.tgz", + "integrity": "sha512-NB6Dk1A9xgQPMoGqC5CVXn123gWyte215ONT5Pp5a0yt4nlEoO1ZWeCwpncaekPHXO60i47ihFnZPiRPjRMq4Q==", + "license": "MIT" + }, + "node_modules/vite": { + "version": "5.3.4", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.3.4.tgz", + "integrity": "sha512-Cw+7zL3ZG9/NZBB8C+8QbQZmR54GwqIz+WMI4b3JgdYJvX+ny9AjJXqkGQlDXSXRP9rP0B4tbciRMOVEKulVOA==", + "dev": true, + "license": "MIT", + "dependencies": { + "esbuild": "^0.21.3", + "postcss": "^8.4.39", + "rollup": "^4.13.0" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^18.0.0 || >=20.0.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + }, + "peerDependencies": { + "@types/node": "^18.0.0 || >=20.0.0", + "less": "*", + "lightningcss": "^1.21.0", + "sass": "*", + "stylus": "*", + "sugarss": "*", + "terser": "^5.4.0" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "less": { + "optional": true + }, + "lightningcss": { + "optional": true + }, + "sass": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + } + } + }, + "node_modules/vite-plugin-full-reload": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/vite-plugin-full-reload/-/vite-plugin-full-reload-1.2.0.tgz", + "integrity": "sha512-kz18NW79x0IHbxRSHm0jttP4zoO9P9gXh+n6UTwlNKnviTTEpOlum6oS9SmecrTtSr+muHEn5TUuC75UovQzcA==", + "dev": true, + "license": "MIT", + "dependencies": { + "picocolors": "^1.0.0", + "picomatch": "^2.3.1" + } + } + } +} diff --git a/package.json b/package.json index 4e934ca..ae0083e 100644 --- a/package.json +++ b/package.json @@ -9,5 +9,9 @@ "axios": "^1.6.4", "laravel-vite-plugin": "^1.0", "vite": "^5.0" + }, + "dependencies": { + "clipboard": "^2.0.11", + "highlight.js": "^11.10.0" } } From 9beeca99c90f9eb481586bd526aa3d3073dbddea Mon Sep 17 00:00:00 2001 From: victor mendoza Date: Wed, 24 Jul 2024 17:58:10 -0300 Subject: [PATCH 013/103] refactor: move css to resources file --- public/css/app.css | 687 --------------------------------------------- 1 file changed, 687 deletions(-) delete mode 100644 public/css/app.css diff --git a/public/css/app.css b/public/css/app.css deleted file mode 100644 index 650a8ca..0000000 --- a/public/css/app.css +++ /dev/null @@ -1,687 +0,0 @@ -/* config */ - -@font-face { - font-family: "Roboto"; - src: url("/fonts/Roboto-Regular.ttf") format("truetype"); - font-weight: 400; - font-style: normal; -} - -@font-face { - font-family: "Roboto"; - src: url("/fonts/Roboto-Medium.ttf") format("truetype"); - font-weight: 500; - font-style: normal; -} - -@font-face { - font-family: "Roboto"; - src: url("/fonts/Roboto-Bold.ttf") format("truetype"); - font-weight: 700; - font-style: normal; -} - -/*------------- Dark mode------------ */ - -:root[data-theme="dark"] { - --primary-text: #f6f7f9; - --text-black: #ebecf0; - --tbk-black-bg: rgb(35 39 47/0.95); - --background: #1b1e25; - --elevation: rgb(35 39 47/0.95); - --elevation-w: rgb(35 39 47/0.95); - --images-dark: contrast(100) brightness(100%) saturate(0%) invert(100%); - --bg-hover: #343a46; - --tbk-red: #f6f7f9; - --shadow-elevation: inset 0 0 0 1px hsla(0, 0%, 100%, 0.08); - --white-elevation: 0 0 0 1px hsla(0, 0%, 100%, 0.15), - 0px 0.8px 2px rgba(0, 0, 0, 0.032), 0px 2.7px 6.7px rgba(0, 0, 0, 0.048), - 0px 12px 30px rgba(0, 0, 0, 0.08); -} - -:root { - --images-dark: none; - --primary-text: #0e1520; - --elevation: #fcfdfe; - --elevation-w: #fff; - --tbk-red: #d5006c; - --tbk-red-dark: #cc0066; - --tbk-light-red: #d5006c0d; - --tbk-border: #e7ebf3; - --background: #ffffff; - --white: #ffffff; - --tbk-grey: #828ea5; - --tbk-grey-2: #707382; - --tbk-grey-3: #8c939f; - --tbk-grey-4: #343a46; - --tbk-black: #0e1520; - --tbk-black-2: #2d3338; - --text-black: #333333; - --tbk-black-bg: #1f242e; - --tbk-border-blue: #c9d0e4; - --tbk-table-header: rgba(213, 0, 108, 0.05); - - ---bg-hover: #343a46; -} - -* { - box-sizing: border-box; -} - -body { - background-color: var(--background); - font-family: "Roboto", sans-serif; - margin: 0px; - padding: 0px; -} - -h1 { - margin-top: 0px; - margin-bottom: 16px; - font-size: 1.25em; - line-height: 32px; - letter-spacing: 0.25px; - font-weight: 700; - .dark & { - color: var(--primary-text); - } -} - -h2 { - margin-top: 0px; - margin-bottom: 8px; - line-height: 24px; - font-size: 1em; - font-weight: 700; - letter-spacing: 0.25px; - .dark & { - color: var(--primary-text); - } -} - -p { - margin: 0px; - font-family: "Roboto", sans-serif; - font-size: 1em; - font-style: normal; - font-weight: 400; - line-height: 24px; - letter-spacing: 0.25px; - .dark & { - color: var(--primary-text); - } -} - -a { - color: inherit; - text-decoration: none; -} - -ul, -ol { - padding-left: 30px; - margin: 0px; -} - -li { - margin-bottom: 5px; - .dark & { - color: var(--primary-text); - } -} - -input { - font-family: "Roboto", sans-serif; - font-size: 0.875em; - font-weight: 500; - line-height: 24px; - letter-spacing: 0.25px; -} - -h1.title { - color: var(--primary-text); - text-align: center; - font-family: "Roboto", sans-serif; - font-size: 2.125em; - font-weight: 700; - line-height: 54px; - letter-spacing: 0.25px; -} - -/* utils */ - -.aling-self-end { - align-self: flex-end; -} - -.boder-t-gray3 { - border-top: 1px solid var(--tbk-grey-3); -} - -.flex-col { - display: flex; - flex-direction: column; -} - -.fw-700 { - font-weight: 700; -} - -.text-tbk-red { - --tw-text-opacity: 1; - color: rgb(213 0 108 / var(--tw-text-opacity)); - .dark & { - color: var(--primary-text); - } -} - -.underline { - text-decoration-line: underline; -} - -.self-center { - align-self: center; -} - -.mb-32 { - margin-bottom: 32px; -} - -/* layout */ - -.main-container { - display: grid; - grid-template-rows: auto 1fr auto; -} - -.body-container { - display: grid; - grid-template-columns: 280px 1fr 264px; - padding: 24px 96px 0px 80px; -} - -.body-content { - padding: 0px 48px 100px; -} - -.helper-content { - margin-left: 16px; -} - -/* cards */ -.tbk-card { - display: flex; - padding: 32px; - margin-top: 16px; - margin-bottom: 32px; - color: var(--tbk-black); - flex-direction: column; - box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.25); - max-width: 607px; - .dark & { - background-color: var(--tbk-black-bg); - box-shadow: var(--white-elevation); - } -} - -.tbk-card-footer { - display: flex; - justify-content: end; - margin-top: 24px; -} - -.tbk-card-title { - font-weight: 500; - font-size: 1em; - margin-bottom: 38px; - .dark & { - color: var(--primary-text); - } -} - -/* inputs */ - -.tbk-label { - padding-left: 4px; - font-size: 0.875rem; - line-height: 1.25rem; - font-weight: 500; - color: var(--tbk-grey); - .dark & { - color: var(--primary-text); - } -} - -.tbk-input-text { - padding-bottom: 4px; - padding-left: 4px; - outline-style: none; - font-size: 0.875rem; - line-height: 1.25rem; - font-weight: 500; - background-color: transparent; - border: 0px solid #e5e7eb; - border-color: var(--tbk-border-blue); - border-bottom-width: 1px; - .dark & { - color: var(--primary-text); - } -} - -.tbk-input-text:focus { - border-color: var(--tbk-red); - border-bottom-width: 2px; -} - -.input-container { - display: flex; - flex-direction: column; -} - -.input-container:focus-within .tbk-label { - color: var(--tbk-red); -} - -/* header */ -.tbk-header { - display: flex; - justify-content: space-between; - align-items: center; - padding-left: 160px; - padding-right: 160px; - width: 100%; - height: 80px; - box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.08); - background-color: var(--elevation); -} - -.tbk-header-options { - display: flex; - align-items: center; - gap: 15px; -} - -.tbk-logo { - filter: var(--images-dark); -} - -/* footer */ -.tbk-footer { - display: grid; - grid-template-rows: 1fr 1fr; - height: 160px; - background-color: var(--tbk-black-bg); -} - -.footer-item { - display: flex; - justify-content: center; - align-items: center; - color: var(--tbk-grey-3); -} - -/* channels */ -.questions-container { - display: flex; - flex-direction: column; -} - -.questions-container .header { - font-size: 1.125rem; - line-height: 1.75rem; - font-weight: 700; - text-align: center; - color: var(--tbk-red); -} - -.questions-container .list { - display: grid; - padding: 24px; - margin-top: 24px; - grid-template-columns: repeat(2, minmax(0, 1fr)); - gap: 40px; - border-radius: 0.25rem; - color: var(--text-black); - border-color: var(--tbk-light-red); - background: var(--tbk-light-red); - .dark & { - background-color: var(--tbk-black-bg); - color: var(--text-black); - } -} - -.question-item { - display: flex; - flex-direction: column; - gap: 16px; -} - -.question-item .title { - text-align: center; - color: var(--tbk-black); - .dark & { - color: var(--primary-text); - } -} - -.question-item .inner-container { - display: flex; - padding: 24px; - flex-direction: column; - gap: 16px; - align-items: center; - background-color: #ffffff; - .dark & { - background-color: var(--tbk-grey-4); - } -} - -.question-item .inner-container img { - cursor: pointer; - .dark & { - filter: var(--images-dark); - } -} - -.question-item .inner-container .content { - font-size: 0.875rem; - line-height: 1.25rem; - color: #000000; -} - -/* navigation */ -.nav-container { - position: sticky; - width: 248px; - padding: 24px; - gap: 22px; - display: flex; - flex-direction: column; - border-radius: 4px; - box-shadow: 0px 1px 2px 0px rgba(14, 21, 32, 0.18), - 0px 0px 2px 0px rgba(14, 21, 32, 0.12), - 0px 0px 2px 0px rgba(0, 0, 0, 0.04); - color: var(--tbk-black); - top: 20px; - .dark & { - background-color: var(--tbk-black-bg); - box-shadow: var(--shadow-elevation); - } -} - -.nav-title { - font-size: 14px; - font-weight: 500; - line-height: 24px; - color: var(--tbk-black); - padding: 8px 0px; - border-bottom: 1px solid var(--tbk-red); - .dark & { - color: var(--primary-text); - } -} - -.nav-container .item { - color: var(--tbk-grey-2); - font-size: 14px; -} - -.nav-container li:last-of-type { - margin-bottom: 8px; -} - -.nav-container .item.active { - color: var(--tbk-red); - font-weight: 500; -} - -.nav-list { - display: flex; - flex-direction: column; - row-gap: 24px; - list-style: none; - padding: 0px; -} - -/* bottons */ -.tbk-button { - display: inline-flex; - padding-left: 24px; - padding-right: 24px; - justify-content: center; - align-items: center; - font-size: 1rem; - background-color: var(--tbk-red); - color: white; - cursor: pointer; - border: none; - - .dark & { - background-color: transparent; - color: var(--primary-text); - border: 1px solid var(--white); - } -} - -.tbk-button.small-button { - padding-right: 16px; - padding-left: 16px; -} - -.tbk-button.primary { - border-radius: 0.25rem; - height: 40px; - .dark & { - background-color: transparent; - color: var(--primary-text); - border: 1px solid var(--white); - } -} - -.tbk-button.primary:hover { - background-color: var(--tbk-red-dark); - .dark & { - background-color: transparent; - } -} - -.tbk-button.secondary { - border: 1px solid var(--tbk-red); - color: var(--tbk-red); - background-color: white; - line-height: 1.5rem; - height: 46px; - border-radius: 10px; - .dark & { - background-color: transparent; - color: var(--primary-text); - border: 1px solid var(--white); - } -} - -.dark-mode-btn { - cursor: pointer; - border: none; - background-color: transparent; -} - -.dark .moon-img { - display: none; -} - -.sun-img { - display: none; - .dark & { - display: block; - } -} - -/* menu */ -.tbk-menu { - display: flex; - flex-direction: column; - row-gap: 56px; - padding: 32px 0px; - border-right: 1px solid var(--tbk-border); -} - -.tbk-menu-item-container { - display: flex; - padding-left: 8px; - padding-right: 8px; - flex-direction: column; - row-gap: 8px; -} - -.tbk-menu-item-text { - margin-bottom: 12px; - font-size: 1.125rem; - line-height: 1.75rem; - font-weight: 700; - color: var(--tbk-grey); - .dark & { - color: var(--primary-text); - } -} - -.tbk-menu-item { - padding: 8px 12px; - color: var(--tbk-black); - cursor: pointer; - border-radius: 10px; - &:hover { - background-color: var(--bg-hover); - } - .dark & { - color: var(--tbk-grey); - } -} - -.tbk-menu-item:hover { - color: var(--tbk-red); -} - -.tbk-menu-item.active { - color: var(--tbk-red); - .dark & { - background-color: var(--bg-hover); - } -} - -/* pages content styles */ -.step-title { - font-family: "Roboto", sans-serif; - font-size: 1em; - font-style: normal; - font-weight: 700; - line-height: 24px; - letter-spacing: 0.25px; -} - -/* homepage */ - -.layout-home { - display: grid; - grid-template-rows: auto 1fr auto; -} - -.tbk-home-container { - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; - margin: 80px 156px; -} - -.tbk-home-intro { - display: flex; - column-gap: 24px; - align-self: flex-start; -} - -.tbk-home-text { - color: var(--text-black); - font-size: 1.25em; - line-height: 30px; - letter-spacing: 0.25px; - font-weight: 400; -} - -.separed-home { - height: 1px; - width: 100%; - background-color: var(--tbk-border-blue); - margin: 70px 0; - border: none; -} - -.contact-container { - max-width: 576px; -} - -.cards-info-container { - display: grid; - grid-template-columns: 1fr 1fr; - gap: 24px; -} - -.card-info { - display: grid; - grid-template-rows: 1fr auto; - box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.1); - border-radius: 15px; - height: 385px; - max-width: 552px; - .dark & { - box-shadow: var(--white-elevation); - } -} - -.card-info-body { - display: flex; - align-items: center; - flex-direction: column; - padding: 40px 32px 0 32px; - border-top-left-radius: 15px; - border-top-right-radius: 15px; - background-color: var(--elevation-w); -} - -.card-info-image { - filter: var(--images-dark); - margin-bottom: 34px; -} - -.card-info-text { - color: var(--text-black); - font-size: 20px; - line-height: 30px; - letter-spacing: 0.25px; - font-weight: 400; -} - -.card-info-link { - display: flex; - justify-content: center; - align-items: center; - font-size: 20px; - letter-spacing: 0.25px; - color: white; - height: 58px; - background-color: var(--tbk-red); - border-bottom-left-radius: 15px; - border-bottom-right-radius: 15px; - - .dark & { - background-color: var(--tbk-grey-4); - } -} - -@media (max-width: 1439.98px) { - .body-container { - grid-template-columns: 280px 1fr; - } - .helper-content { - display: none; - } -} From 8f05d170abe2591f135f3e9cdd4b4720434a76f0 Mon Sep 17 00:00:00 2001 From: victor mendoza Date: Wed, 24 Jul 2024 17:58:38 -0300 Subject: [PATCH 014/103] feat: add table css --- resources/css/app.css | 772 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 772 insertions(+) diff --git a/resources/css/app.css b/resources/css/app.css index e69de29..1d414ac 100644 --- a/resources/css/app.css +++ b/resources/css/app.css @@ -0,0 +1,772 @@ +/* config */ + +@font-face { + font-family: "Roboto"; + src: url("/public/fonts/Roboto-Regular.ttf") format("truetype"); + font-weight: 400; + font-style: normal; +} + +@font-face { + font-family: "Roboto"; + src: url("/public/fonts/Roboto-Medium.ttf") format("truetype"); + font-weight: 500; + font-style: normal; +} + +@font-face { + font-family: "Roboto"; + src: url("/public/fonts/Roboto-Bold.ttf") format("truetype"); + font-weight: 700; + font-style: normal; +} + +/*------------- Dark mode------------ */ + +:root[data-theme="dark"] { + --primary-text: #f6f7f9; + --text-black: #ebecf0; + --tbk-black-bg: rgb(35 39 47/0.95); + --background: #1b1e25; + --elevation: rgb(35 39 47/0.95); + --elevation-w: rgb(35 39 47/0.95); + --images-dark: contrast(100) brightness(100%) saturate(0%) invert(100%); + --bg-hover: #343a46; + --tbk-red: #f6f7f9; + --tbk-table-header: rgb(35 39 47/0.95); + --shadow-elevation: inset 0 0 0 1px hsla(0, 0%, 100%, 0.08); + --white-elevation: 0 0 0 1px hsla(0, 0%, 100%, 0.15), + 0px 0.8px 2px rgba(0, 0, 0, 0.032), 0px 2.7px 6.7px rgba(0, 0, 0, 0.048), + 0px 12px 30px rgba(0, 0, 0, 0.08); +} + +:root { + --snippets-b: #9aa5ce; + --images-dark: none; + --primary-text: #0e1520; + --elevation: #fcfdfe; + --elevation-w: #fff; + --tbk-red: #d5006c; + --tbk-red-dark: #cc0066; + --tbk-light-red: #d5006c0d; + --tbk-border: #e7ebf3; + --background: #ffffff; + --white: #ffffff; + --tbk-grey: #828ea5; + --tbk-grey-2: #707382; + --tbk-grey-3: #8c939f; + --tbk-grey-4: #343a46; + --tbk-black: #0e1520; + --tbk-black-2: #2d3338; + --text-black: #333333; + --tbk-black-bg: #1f242e; + --tbk-border-blue: #c9d0e4; + --tbk-table-header: hsl(329.58deg 100% 41.76% / 5%); + ---bg-hover: #343a46; +} + +* { + box-sizing: border-box; +} + +body { + background-color: var(--background); + font-family: "Roboto", sans-serif; + margin: 0px; + padding: 0px; +} + +code { + border: 1px solid var(--snippets-b); +} + +div.code { + white-space: pre; +} + +h1 { + margin-top: 0px; + margin-bottom: 16px; + font-size: 1.25em; + line-height: 32px; + letter-spacing: 0.25px; + font-weight: 700; + .dark & { + color: var(--primary-text); + } +} + +h2 { + margin-top: 0px; + margin-bottom: 8px; + line-height: 24px; + font-size: 1em; + font-weight: 700; + letter-spacing: 0.25px; + .dark & { + color: var(--primary-text); + } +} + +p { + margin: 0px; + font-family: "Roboto", sans-serif; + font-size: 1em; + font-style: normal; + font-weight: 400; + line-height: 24px; + letter-spacing: 0.25px; + .dark & { + color: var(--primary-text); + } +} + +a { + color: inherit; + text-decoration: none; +} + +ul, +ol { + padding-left: 30px; + margin: 0px; +} + +li { + margin-bottom: 5px; + .dark & { + color: var(--primary-text); + } +} + +input { + font-family: "Roboto", sans-serif; + font-size: 0.875em; + font-weight: 500; + line-height: 24px; + letter-spacing: 0.25px; +} + +h1.title { + color: var(--primary-text); + text-align: center; + font-family: "Roboto", sans-serif; + font-size: 2.125em; + font-weight: 700; + line-height: 54px; + letter-spacing: 0.25px; +} + +pre, +code { + overflow-x: auto; /* Permite desplazamiento horizontal si el contenido es demasiado ancho */ + white-space: pre-wrap; /* Mantiene los espacios en blanco y permite el envoltorio de líneas */ + word-wrap: break-word; /* Permite que las palabras largas se rompan y continúen en la siguiente línea */ + max-width: 100%; +} + +/* utils */ + +.aling-self-end { + align-self: flex-end; +} + +.boder-t-gray3 { + border-top: 1px solid var(--tbk-grey-3); +} + +.flex-col { + display: flex; + flex-direction: column; +} + +.fw-700 { + font-weight: 700; +} + +.text-tbk-red { + --tw-text-opacity: 1; + color: rgb(213 0 108 / var(--tw-text-opacity)); + .dark & { + color: var(--primary-text); + } +} + +.underline { + text-decoration-line: underline; +} + +.self-center { + align-self: center; +} + +.mb-32 { + margin-bottom: 32px; +} + +/* layout */ + +.main-container { + display: grid; + grid-template-rows: auto 1fr auto; +} + +.body-container { + display: grid; + grid-template-columns: 280px 1fr 264px; + padding: 24px 96px 0px 80px; +} + +.body-content { + padding: 0px 48px 100px; +} + +.helper-content { + margin-left: 16px; +} +/* snippet */ + +.snippet-container { + position: relative; + max-width: 650px; + min-width: 300px; + width: auto; +} + +.snippet-container .clipboard { + position: absolute; + right: 5px; + top: 5px; + background-color: transparent; + border: none; + cursor: pointer; +} + +/* table */ + +.tbk-table { + display: grid; + grid-template-columns: 262px 295px; +} + +.tbk-table .table-column { + padding: 16px; + border-bottom: 1px solid var(--tbk-border-blue); + border-right: 1px solid var(--tbk-border-blue); +} + +.tbk-table .table-column.tbk-head { + display: flex; + justify-content: center; + background-color: var(--tbk-table-header); + font-weight: 700; + line-height: 24px; + color: var(--tbk-red); +} + +.tbk-table-xs { + display: none; +} + +.tbk-table-xs .table-row-xs { + padding: 8px; + gap: 8px; + border: 1px solid var(--primary-text); + display: flex; + flex-direction: column; +} + +.tbk-table-xs .table-row-xs span { + font-weight: bold; +} + +.dark .tbk-table .table-column { + color: var(--primary-text); +} + +/* cards */ +.tbk-card { + display: flex; + padding: 32px; + margin-top: 16px; + margin-bottom: 32px; + color: var(--tbk-black); + flex-direction: column; + box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.25); + max-width: 607px; + .dark & { + background-color: var(--tbk-black-bg); + box-shadow: var(--white-elevation); + } +} + +.tbk-card-footer { + display: flex; + justify-content: end; + margin-top: 24px; +} + +.tbk-card-title { + font-weight: 500; + font-size: 1em; + margin-bottom: 38px; + .dark & { + color: var(--primary-text); + } +} + +/* inputs */ + +.tbk-label { + padding-left: 4px; + font-size: 0.875rem; + line-height: 1.25rem; + font-weight: 500; + color: var(--tbk-grey); + .dark & { + color: var(--primary-text); + } +} + +.tbk-input-text { + padding-bottom: 4px; + padding-left: 4px; + outline-style: none; + font-size: 0.875rem; + line-height: 1.25rem; + font-weight: 500; + background-color: transparent; + border: 0px solid #e5e7eb; + border-color: var(--tbk-border-blue); + border-bottom-width: 1px; + .dark & { + color: var(--primary-text); + } +} + +.tbk-input-text:focus { + border-color: var(--tbk-red); + border-bottom-width: 2px; +} + +.input-container { + display: flex; + flex-direction: column; +} + +.input-container:focus-within .tbk-label { + color: var(--tbk-red); +} + +/* header */ +.tbk-header { + display: flex; + justify-content: space-between; + align-items: center; + padding-left: 160px; + padding-right: 160px; + width: 100%; + height: 80px; + box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.08); + background-color: var(--elevation); +} + +.tbk-header-options { + display: flex; + align-items: center; + gap: 15px; +} + +.tbk-logo { + filter: var(--images-dark); +} + +/* footer */ +.tbk-footer { + display: grid; + grid-template-rows: 1fr 1fr; + height: 160px; + background-color: var(--tbk-black-bg); +} + +.footer-item { + display: flex; + justify-content: center; + align-items: center; + color: var(--tbk-grey-3); +} + +/* channels */ +.questions-container { + display: flex; + flex-direction: column; +} + +.questions-container .header { + font-size: 1.125rem; + line-height: 1.75rem; + font-weight: 700; + text-align: center; + color: var(--tbk-red); +} + +.questions-container .list { + display: grid; + padding: 24px; + margin-top: 24px; + grid-template-columns: repeat(2, minmax(0, 1fr)); + gap: 40px; + border-radius: 0.25rem; + color: var(--text-black); + border-color: var(--tbk-light-red); + background: var(--tbk-light-red); + .dark & { + background-color: var(--tbk-black-bg); + color: var(--text-black); + } +} + +.question-item { + display: flex; + flex-direction: column; + gap: 16px; +} + +.question-item .title { + text-align: center; + color: var(--tbk-black); + .dark & { + color: var(--primary-text); + } +} + +.question-item .inner-container { + display: flex; + padding: 24px; + flex-direction: column; + gap: 16px; + align-items: center; + background-color: #ffffff; + .dark & { + background-color: var(--tbk-grey-4); + } +} + +.question-item .inner-container img { + cursor: pointer; + .dark & { + filter: var(--images-dark); + } +} + +.question-item .inner-container .content { + font-size: 0.875rem; + line-height: 1.25rem; + color: #000000; +} + +/* navigation */ +.nav-container { + position: sticky; + width: 248px; + padding: 24px; + gap: 22px; + display: flex; + flex-direction: column; + border-radius: 4px; + box-shadow: 0px 1px 2px 0px rgba(14, 21, 32, 0.18), + 0px 0px 2px 0px rgba(14, 21, 32, 0.12), + 0px 0px 2px 0px rgba(0, 0, 0, 0.04); + color: var(--tbk-black); + top: 20px; + .dark & { + background-color: var(--tbk-black-bg); + box-shadow: var(--shadow-elevation); + } +} + +.nav-title { + font-size: 14px; + font-weight: 500; + line-height: 24px; + color: var(--tbk-black); + padding: 8px 0px; + border-bottom: 1px solid var(--tbk-red); + .dark & { + color: var(--primary-text); + } +} + +.nav-container .item { + color: var(--tbk-grey-2); + font-size: 14px; +} + +.nav-container li:last-of-type { + margin-bottom: 8px; +} + +.nav-container .item.active { + color: var(--tbk-red); + font-weight: 500; +} + +.nav-list { + display: flex; + flex-direction: column; + row-gap: 24px; + list-style: none; + padding: 0px; +} + +/* bottons */ +.tbk-button { + display: inline-flex; + padding-left: 24px; + padding-right: 24px; + justify-content: center; + align-items: center; + font-size: 1rem; + background-color: var(--tbk-red); + color: white; + cursor: pointer; + border: none; + + .dark & { + background-color: transparent; + color: var(--primary-text); + border: 1px solid var(--white); + } +} + +.tbk-button.small-button { + padding-right: 16px; + padding-left: 16px; +} + +.tbk-button.primary { + border-radius: 0.25rem; + height: 40px; + .dark & { + background-color: transparent; + color: var(--primary-text); + border: 1px solid var(--white); + } +} + +.tbk-button.primary:hover { + background-color: var(--tbk-red-dark); + .dark & { + background-color: transparent; + } +} + +.tbk-button.secondary { + border: 1px solid var(--tbk-red); + color: var(--tbk-red); + background-color: white; + line-height: 1.5rem; + height: 46px; + border-radius: 10px; + .dark & { + background-color: transparent; + color: var(--primary-text); + border: 1px solid var(--white); + } +} + +.dark-mode-btn { + cursor: pointer; + border: none; + background-color: transparent; +} + +.dark .moon-img { + display: none; +} + +.sun-img { + display: none; + .dark & { + display: block; + } +} + +/* menu */ +.tbk-menu { + display: flex; + flex-direction: column; + row-gap: 56px; + padding: 32px 0px; + border-right: 1px solid var(--tbk-border); +} + +.tbk-menu-item-container { + display: flex; + padding-left: 8px; + padding-right: 8px; + flex-direction: column; + row-gap: 8px; +} + +.tbk-menu-item-text { + margin-bottom: 12px; + font-size: 1.125rem; + line-height: 1.75rem; + font-weight: 700; + color: var(--tbk-grey); + .dark & { + color: var(--primary-text); + } +} + +.tbk-menu-item { + padding: 8px 12px; + color: var(--tbk-black); + cursor: pointer; + border-radius: 10px; + &:hover { + background-color: var(--bg-hover); + } + .dark & { + color: var(--tbk-grey); + } +} + +.tbk-menu-item:hover { + color: var(--tbk-red); +} + +.tbk-menu-item.active { + color: var(--tbk-red); + .dark & { + background-color: var(--bg-hover); + } +} + +/* pages content styles */ +.step-title { + font-family: "Roboto", sans-serif; + font-size: 1em; + font-style: normal; + font-weight: 700; + line-height: 24px; + letter-spacing: 0.25px; +} + +/* homepage */ + +.layout-home { + display: grid; + grid-template-rows: auto 1fr auto; +} + +.tbk-home-container { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + margin: 80px 156px; +} + +.tbk-home-intro { + display: flex; + column-gap: 24px; + align-self: flex-start; +} + +.tbk-home-text { + color: var(--text-black); + font-size: 1.25em; + line-height: 30px; + letter-spacing: 0.25px; + font-weight: 400; +} + +.separed-home { + height: 1px; + width: 100%; + background-color: var(--tbk-border-blue); + margin: 70px 0; + border: none; +} + +.contact-container { + max-width: 576px; +} + +.cards-info-container { + display: grid; + grid-template-columns: 1fr 1fr; + gap: 24px; +} + +.card-info { + display: grid; + grid-template-rows: 1fr auto; + box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.1); + border-radius: 15px; + height: 385px; + max-width: 552px; + .dark & { + box-shadow: var(--white-elevation); + } +} + +.card-info-body { + display: flex; + align-items: center; + flex-direction: column; + padding: 40px 32px 0 32px; + border-top-left-radius: 15px; + border-top-right-radius: 15px; + background-color: var(--elevation-w); +} + +.card-info-image { + filter: var(--images-dark); + margin-bottom: 34px; +} + +.card-info-text { + color: var(--text-black); + font-size: 20px; + line-height: 30px; + letter-spacing: 0.25px; + font-weight: 400; +} + +.card-info-link { + display: flex; + justify-content: center; + align-items: center; + font-size: 20px; + letter-spacing: 0.25px; + color: white; + height: 58px; + background-color: var(--tbk-red); + border-bottom-left-radius: 15px; + border-bottom-right-radius: 15px; + + .dark & { + background-color: var(--tbk-grey-4); + } +} + +@media (max-width: 1439.98px) { + .body-container { + grid-template-columns: 280px 1fr; + } + .helper-content { + display: none; + } +} + +@media (max-width: 576px) { + .tbk-table { + display: none; + } + .tbk-table-xs { + display: block; + } +} From 9a93860d0ac5fa570fdac85277ff7e244b8813f6 Mon Sep 17 00:00:00 2001 From: victor mendoza Date: Wed, 24 Jul 2024 17:59:02 -0300 Subject: [PATCH 015/103] feat: add image for copy text in snippet --- public/images/copy.svg | 1 + 1 file changed, 1 insertion(+) create mode 100644 public/images/copy.svg diff --git a/public/images/copy.svg b/public/images/copy.svg new file mode 100644 index 0000000..fd64dc3 --- /dev/null +++ b/public/images/copy.svg @@ -0,0 +1 @@ + \ No newline at end of file From 5e2353b848cc40ba275a9b30f4e56e010d3a1965 Mon Sep 17 00:00:00 2001 From: victor mendoza Date: Wed, 24 Jul 2024 17:59:23 -0300 Subject: [PATCH 016/103] fix: remove empty line --- app/Http/Controllers/WebpayController.php | 1 - 1 file changed, 1 deletion(-) diff --git a/app/Http/Controllers/WebpayController.php b/app/Http/Controllers/WebpayController.php index e4d070a..1a77a53 100644 --- a/app/Http/Controllers/WebpayController.php +++ b/app/Http/Controllers/WebpayController.php @@ -36,7 +36,6 @@ public function index() } public function commit(Request $request) { - //flujo error if ($request->exists("TBK_TOKEN") && $request->exists("token_ws")) { return view('webpay.error', ["request" => $request]); From da3fe207b0b5be2fa9725d151a2b3d89edae3d45 Mon Sep 17 00:00:00 2001 From: victor mendoza Date: Wed, 24 Jul 2024 17:59:46 -0300 Subject: [PATCH 017/103] feat: create snippet component --- resources/js/app.js | 16 +++++++++++++++- resources/views/components/snippet.blade.php | 13 +++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 resources/views/components/snippet.blade.php diff --git a/resources/js/app.js b/resources/js/app.js index e59d6a0..7adb133 100644 --- a/resources/js/app.js +++ b/resources/js/app.js @@ -1 +1,15 @@ -import './bootstrap'; +import hljs from "highlight.js"; +import ClipboardJS from "clipboard"; +import "highlight.js/styles/tokyo-night-dark.css"; + +document.addEventListener("DOMContentLoaded", function () { + new ClipboardJS(".clipboard"); + + hljs.configure({ + languages: ["php", "json", "html"], + }); + + document.querySelectorAll("pre code").forEach((el) => { + hljs.highlightElement(el); + }); +}); diff --git a/resources/views/components/snippet.blade.php b/resources/views/components/snippet.blade.php new file mode 100644 index 0000000..2608253 --- /dev/null +++ b/resources/views/components/snippet.blade.php @@ -0,0 +1,13 @@ +@php + $clipboard = $slot->isNotEmpty() + ? preg_replace('/\n\s+/', "\n", $slot) + : json_encode($content, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES); +@endphp +
    + +
    
    +{!! $clipboard !!}
    +    
    +
    From 8ba0ed150e054fd80406043f00f4ae4e633568c6 Mon Sep 17 00:00:00 2001 From: victor mendoza Date: Wed, 24 Jul 2024 18:00:09 -0300 Subject: [PATCH 018/103] feat: create responsive table component --- resources/views/components/table.blade.php | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 resources/views/components/table.blade.php diff --git a/resources/views/components/table.blade.php b/resources/views/components/table.blade.php new file mode 100644 index 0000000..a7ff801 --- /dev/null +++ b/resources/views/components/table.blade.php @@ -0,0 +1,24 @@ +
    + +
    + Campo +
    +
    + Valor +
    + + @foreach ($request as $property => $value) +
    {{ $property }}
    +
    {{ $value }}
    + @endforeach + +
    + +
    + @foreach ($request as $property => $value) +
    +

    Campo: {{ $property }}

    +

    Valor: {{ $value }}

    +
    + @endforeach +
    From c0622eed7516a607e9385aae55f5e032817215de Mon Sep 17 00:00:00 2001 From: victor mendoza Date: Wed, 24 Jul 2024 18:01:03 -0300 Subject: [PATCH 019/103] refactor: use vite for compile css and js --- resources/views/components/layout.blade.php | 4 ++-- resources/views/home.blade.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/resources/views/components/layout.blade.php b/resources/views/components/layout.blade.php index e4a27bf..d60bc09 100644 --- a/resources/views/components/layout.blade.php +++ b/resources/views/components/layout.blade.php @@ -4,9 +4,9 @@ - {{ $title ?? 'Webpay Plus' }} - + @vite(['resources/css/app.css', 'resources/js/app.js']) + diff --git a/resources/views/home.blade.php b/resources/views/home.blade.php index 4678659..2d9e624 100644 --- a/resources/views/home.blade.php +++ b/resources/views/home.blade.php @@ -4,8 +4,8 @@ - - Transbank developers + Transbank Developers + @vite(['resources/css/app.css', 'resources/js/app.js']) From de41556bf66865fc98f7f9b6d0b51062f5c7e454 Mon Sep 17 00:00:00 2001 From: victor mendoza Date: Wed, 24 Jul 2024 18:01:48 -0300 Subject: [PATCH 020/103] feat: use snippet component --- resources/views/webpay/commit.blade.php | 13 ++++++------ resources/views/webpay/create.blade.php | 28 ++++++++++++++++--------- resources/views/webpay/refund.blade.php | 6 ++---- resources/views/webpay/status.blade.php | 8 +++---- 4 files changed, 29 insertions(+), 26 deletions(-) diff --git a/resources/views/webpay/commit.blade.php b/resources/views/webpay/commit.blade.php index dd96227..53e9ac9 100644 --- a/resources/views/webpay/commit.blade.php +++ b/resources/views/webpay/commit.blade.php @@ -16,16 +16,16 @@ información:

-
@dump($resp)
+ (returnUrl)?token_ws={{ $token }}

Paso 2 - Petición:

Utilizarás el token recibido para confirmar la transacción mediante una nueva llamada a WebpayPlus.

-
- {{-- @dump($respond) --}}snippet -
+ + $resp = $transaction->commit($token); +

Paso 3 - Respuesta:

@@ -33,9 +33,8 @@ validación necesaria es que el campo "response_code" sea igual a cero.

-
- snippet -
+ +

¡Listo!

diff --git a/resources/views/webpay/create.blade.php b/resources/views/webpay/create.blade.php index 37c47ea..2b4f255 100644 --- a/resources/views/webpay/create.blade.php +++ b/resources/views/webpay/create.blade.php @@ -3,8 +3,7 @@ @endphp - -

Webpay Plus - Creación de transacción

+

Webpay Plus - Creación de transacción

En esta etapa, se procederá a la creación de una transacción con el fin de obtener un identificador único. Esto nos permitirá redirigir al Tarjetahabiente hacia el formulario de pago en el siguiente paso. @@ -15,32 +14,41 @@

  • Comienza por importar la librería WebpayPlus en tu proyecto.
  • Luego, crea una transacción utilizando las funciones proporcionadas por WebpayPlus.
  • -
    @dump($request)
    + + use Transbank\Webpay\WebpayPlus\Transaction; + use Transbank\Webpay\Options; + //configuración de la transacción + $option = new Options(API_KEY, COMMERCE_CODE, Options::ENVIRONMENT_INTEGRATION); + $transaction = new Transaction($option); + $transaction->create($buyOrder, $sessionId, $amount, $returnUrl); +

    Paso 2: Respuesta

    Una vez que hayas creado la transacción, aquí encontrarás los datos de respuesta generados por el proceso.

    -
    - @dump($respond) -
    +

    Paso 3: Creación del formulario

    Utiliza estos datos de respuesta para generar y presentar un formulario de pago al Tarjetahabiente. Este formulario será la interfaz a través de la cual el usuario realizará su transacción.

    -
    - snippet -
    + + form action="https://webpay3gint.transbank.cl/webpayserver/initTransaction" method="POST"> + input type="hidden" name="token_ws" value="01ab3dd2f9249e253ec4ebd0f835de8f0bd59177be7cf4c95240f9dd42c823d7" /> + input type="submit" value="Pagar" /> + form> +

    Ejemplo

    Para llevar a cabo una transacción de compra en nuestro sistema, primero debemos crear la transacción. Utilizaremos los siguientes datos para configurar la transacción:

    +
    - tabla +

    Por último, con la respuesta del servicio que confirma la creación de la transacción, procedemos diff --git a/resources/views/webpay/refund.blade.php b/resources/views/webpay/refund.blade.php index 1ef1e2e..52a443c 100644 --- a/resources/views/webpay/refund.blade.php +++ b/resources/views/webpay/refund.blade.php @@ -25,14 +25,12 @@

  • No se admiten reembolsos de compras en cuotas.
  • -
    snippet
    + $resp = $transaction->refund($token, $amount);

    Paso 2: Respuesta

    Transbank responderá con el resultado del proceso de reembolso, indicando si se ha realizado una Reversa, Anulación o Anulación Parcial.

    -
    - @dump($resp) -
    + diff --git a/resources/views/webpay/status.blade.php b/resources/views/webpay/status.blade.php index bfd9ba9..ea75439 100644 --- a/resources/views/webpay/status.blade.php +++ b/resources/views/webpay/status.blade.php @@ -16,7 +16,8 @@ este token para realizar una llamada a WebpayPlus.Transaction.

    -
    snippet
    + $resp = $transaction->status($token); +

    Paso 2: Respuesta

    @@ -24,9 +25,6 @@ necesaria es que el campo "response_code" sea igual a cero.

    -
    - @dump($resp) -
    - + From 3a84566e67b1ca2a03d0c1306ca3c0c887e6b555 Mon Sep 17 00:00:00 2001 From: victor mendoza Date: Wed, 24 Jul 2024 18:12:21 -0300 Subject: [PATCH 021/103] fix: remove coments --- resources/css/app.css | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/resources/css/app.css b/resources/css/app.css index 1d414ac..9cc2eff 100644 --- a/resources/css/app.css +++ b/resources/css/app.css @@ -159,9 +159,9 @@ h1.title { pre, code { - overflow-x: auto; /* Permite desplazamiento horizontal si el contenido es demasiado ancho */ - white-space: pre-wrap; /* Mantiene los espacios en blanco y permite el envoltorio de líneas */ - word-wrap: break-word; /* Permite que las palabras largas se rompan y continúen en la siguiente línea */ + overflow-x: auto; + white-space: pre-wrap; + word-wrap: break-word; max-width: 100%; } @@ -519,7 +519,7 @@ code { padding: 0px; } -/* bottons */ +/* buttons */ .tbk-button { display: inline-flex; padding-left: 24px; From 37bdfc5110c139f8d1ba30031673b680e0766215 Mon Sep 17 00:00:00 2001 From: victor mendoza Date: Wed, 24 Jul 2024 18:16:35 -0300 Subject: [PATCH 022/103] feat: use dinamic token for snippet --- resources/views/webpay/create.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/webpay/create.blade.php b/resources/views/webpay/create.blade.php index 2b4f255..d0218b3 100644 --- a/resources/views/webpay/create.blade.php +++ b/resources/views/webpay/create.blade.php @@ -37,7 +37,7 @@ form action="https://webpay3gint.transbank.cl/webpayserver/initTransaction" method="POST"> - input type="hidden" name="token_ws" value="01ab3dd2f9249e253ec4ebd0f835de8f0bd59177be7cf4c95240f9dd42c823d7" /> + input type="hidden" name="token_ws" value="{{ $request['token'] }}" /> input type="submit" value="Pagar" /> form> From 1e23f92805dc66e9497ae161f8dc0a4cd1459a88 Mon Sep 17 00:00:00 2001 From: victor mendoza Date: Wed, 24 Jul 2024 18:18:53 -0300 Subject: [PATCH 023/103] fix: use correct variable --- resources/views/webpay/create.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/webpay/create.blade.php b/resources/views/webpay/create.blade.php index d0218b3..dcbd001 100644 --- a/resources/views/webpay/create.blade.php +++ b/resources/views/webpay/create.blade.php @@ -37,7 +37,7 @@ form action="https://webpay3gint.transbank.cl/webpayserver/initTransaction" method="POST"> - input type="hidden" name="token_ws" value="{{ $request['token'] }}" /> + input type="hidden" name="token_ws" value="{{ $respond->token }}" /> input type="submit" value="Pagar" /> form> From 195a76d75fe3785217af036bbb829c44c74e3eed Mon Sep 17 00:00:00 2001 From: victor mendoza Date: Thu, 25 Jul 2024 10:03:22 -0300 Subject: [PATCH 024/103] Create routes --- routes/web.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/routes/web.php b/routes/web.php index 8a92d83..8bf7eb2 100644 --- a/routes/web.php +++ b/routes/web.php @@ -15,3 +15,10 @@ Route::post('/refund', [WebpayController::class, 'refund'])->name("refund"); Route::get('/status', [WebpayController::class, 'status'])->name("status"); }); + +Route::prefix('webpay-plus-mall')->name("webpay-mall.")->group(function () { + Route::get('/create', [WebpayController::class, 'index'])->name("create"); + Route::get('/commit', [WebpayController::class, 'commit'])->name("commit"); + Route::post('/refund', [WebpayController::class, 'refund'])->name("refund"); + Route::get('/status', [WebpayController::class, 'status'])->name("status"); +}); From ae67e309a60a0b25df57a5611380aea0da9db2ce Mon Sep 17 00:00:00 2001 From: victor mendoza Date: Thu, 25 Jul 2024 10:03:54 -0300 Subject: [PATCH 025/103] feat: add webpayMall controler --- .../Controllers/WebpayPlusMallController.php | 89 +++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 app/Http/Controllers/WebpayPlusMallController.php diff --git a/app/Http/Controllers/WebpayPlusMallController.php b/app/Http/Controllers/WebpayPlusMallController.php new file mode 100644 index 0000000..2dba3d7 --- /dev/null +++ b/app/Http/Controllers/WebpayPlusMallController.php @@ -0,0 +1,89 @@ +MallTransaction = new MallTransaction($option); + } + + public function create() + { + + $createTx = [ + 'buyOrder' => "O-" . rand(1, 10000), + "sessionId" => "S-" . (string)(rand(1, 10000)), + 'returnUrl' => url('/') . '/webpay-mall/commit', + ]; + $detail=[ + + ] + + $resp = $this->MallTransaction->create($req["buy_order"], $req["session_id"], $req["return_url"], $req["detail"]); + + return view('webpay-mall.create', compact('commerceCodeList')); + } + + public function createdMallTransaction(Request $request) + { + + $req = $request->except('_token'); + $resp = (new WebpayPlus\MallTransaction)->create($req["buy_order"], $req["session_id"], $req["return_url"], $req["detail"]); + + return view('webpayplus/transaction_created', ["params" => $req, "response" => $resp]); + } + + + public function commitmallTransaction(Request $request) + { + //Flujo normal + if ($request->exists("token_ws")) { + $req = $request->except('_token'); + $token = $req["token_ws"]; + $resp = (new WebpayPlus\MallTransaction)->commit($token); + + return view('webpayplus/mall_transaction_committed', ["params" => $req, "response" => $resp]); + } + + //Pago abortado + if ($request->exists("TBK_TOKEN")) { + return view('webpayplus/mall_transaction_aborted', ["resp" => $request->all()]); + } + + //Timeout + return view('webpayplus/mall_transaction_timeout', ["resp" => $request->all()]); + } + + public function getMallTransactionStatus(Request $request) + { + $req = $request->except('_token'); + $token = $req["token"]; + $resp = (new WebpayPlus\MallTransaction)->status($token); + + return view('webpayplus/mall_transaction_status', ["resp" => $resp, "req" => $req]); + } + + public function refundMallTransaction(Request $request) + { + $req = $request->except('_token'); + $token = $req["token"]; + try { + $resp = (new WebpayPlus\MallTransaction)->refund($token, $req["buy_order"], $req["commerce_code"], $req["amount"]); + } catch (WebpayPlus\Exceptions\TransactionRefundException $e) { + dd($e); + } + + + return view('webpayplus/mall_refund_success', ["req" => $req, "resp" => $resp]); + } +} From bcfb602d9cb2c37ddc964fbd65512c7b8ac240b7 Mon Sep 17 00:00:00 2001 From: victor mendoza Date: Sun, 28 Jul 2024 18:50:46 -0300 Subject: [PATCH 026/103] docs: update readme description --- README.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 58e2eff..262612a 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,13 @@ -# ChatBot para soporte +# Proyecto de Ejemplo SDK PHP ## Descripción -ChatBot de Slack que se conecta con un LLM para apoyar el soporte a las comunidades. +Proyecto de ejemplo mostrando el paso a paso de como usar el SDK PHP de transbank ## Requisitos -- Node 18+ -- Slack Bolt -- Dotenv +- PHP 8.3+ +- laravel 11 ## Iniciar aplicación From 34e44fd55076e1ca6cdd2d7619c4544eec9328e0 Mon Sep 17 00:00:00 2001 From: victor mendoza Date: Sun, 28 Jul 2024 18:52:20 -0300 Subject: [PATCH 027/103] feat: create methods for webpay mall --- app/Http/Controllers/WebpayController.php | 26 ++++++++++++----------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/app/Http/Controllers/WebpayController.php b/app/Http/Controllers/WebpayController.php index 1a77a53..a968736 100644 --- a/app/Http/Controllers/WebpayController.php +++ b/app/Http/Controllers/WebpayController.php @@ -20,7 +20,7 @@ public function __construct() $this->transaction = new Transaction($option); } - public function index() + public function create() { $createTx = [ @@ -36,24 +36,26 @@ public function index() } public function commit(Request $request) { + //Timeout + $view = 'webpay.timeout'; + $data = ["request" => $request]; + //flujo error if ($request->exists("TBK_TOKEN") && $request->exists("token_ws")) { - return view('webpay.error', ["request" => $request]); + $view = 'webpay.error'; + } + //Pago abortadoas + elseif ($request->exists("TBK_TOKEN")) { + $view = 'webpay.error'; } - //Flujo normal - if ($request->exists("token_ws")) { + elseif ($request->exists("token_ws")) { $resp = $this->transaction->commit($request["token_ws"]); - return view('webpay.commit', ["resp" => $resp, "token" => $request["token_ws"]]); + $view = 'webpay.commit'; + $data = ["resp" => $resp, "token" => $request["token_ws"]]; } - //Pago abortadoas - if ($request->exists("TBK_TOKEN")) { - return view('webpay.error', ["request" => $request]); - } - - //Timeout - return view('webpay.timeout', ["request" => $request]); + return view($view, $data); } public function refund(Request $request) From 024a7ec46a16d0f84addcd8264a804a6058fee00 Mon Sep 17 00:00:00 2001 From: victor mendoza Date: Sun, 28 Jul 2024 18:53:58 -0300 Subject: [PATCH 028/103] feat: create webpay mall controller --- .../Controllers/WebpayPlusMallController.php | 95 ++++++++++--------- 1 file changed, 50 insertions(+), 45 deletions(-) diff --git a/app/Http/Controllers/WebpayPlusMallController.php b/app/Http/Controllers/WebpayPlusMallController.php index 2dba3d7..ed6ec00 100644 --- a/app/Http/Controllers/WebpayPlusMallController.php +++ b/app/Http/Controllers/WebpayPlusMallController.php @@ -10,80 +10,85 @@ class WebpayPlusMallController extends Controller { const COMMERCE_CODE = "597055555535"; const API_KEY = "579B532A7440BB0C9079DED94D31EA1615BACEB56610332264630D42D0A36B1C"; - private MallTransaction $MallTransaction; + private MallTransaction $mallTransaction; public function __construct() { $option = new Options(self::API_KEY, self::COMMERCE_CODE, Options::ENVIRONMENT_INTEGRATION); - $this->MallTransaction = new MallTransaction($option); + $this->mallTransaction = new mallTransaction($option); } public function create() { $createTx = [ - 'buyOrder' => "O-" . rand(1, 10000), - "sessionId" => "S-" . (string)(rand(1, 10000)), - 'returnUrl' => url('/') . '/webpay-mall/commit', + 'buy_order' => "O-" . rand(1, 10000), + "session_id" => "S-" . (string)(rand(1, 10000)), + 'return_url' => url('/') . '/webpay-mall/commit', + ]; + $details = [ + [ + "amount" => 10000, + "commerce_code" => 597055555536, + "buy_order" => "ordenCompraDetalle1234" + ], + [ + "amount" => 12000, + "commerce_code" => 597055555537, + "buy_order" => "ordenCompraDetalle4321" + ], ]; - $detail=[ - - ] - $resp = $this->MallTransaction->create($req["buy_order"], $req["session_id"], $req["return_url"], $req["detail"]); + $resp = $this->mallTransaction->create($createTx["buy_order"], $createTx["session_id"], $createTx["return_url"], $details); - return view('webpay-mall.create', compact('commerceCodeList')); + return view('webpay-mall.create', ["request" => $createTx, "resp" => $resp]); } - public function createdMallTransaction(Request $request) - { - - $req = $request->except('_token'); - $resp = (new WebpayPlus\MallTransaction)->create($req["buy_order"], $req["session_id"], $req["return_url"], $req["detail"]); - - return view('webpayplus/transaction_created', ["params" => $req, "response" => $resp]); - } - public function commitmallTransaction(Request $request) + public function commit(Request $request) { - //Flujo normal - if ($request->exists("token_ws")) { - $req = $request->except('_token'); - $token = $req["token_ws"]; - $resp = (new WebpayPlus\MallTransaction)->commit($token); + //Timeout + $view = 'webpay-mall.timeout'; + $data = ["request" => $request]; - return view('webpayplus/mall_transaction_committed', ["params" => $req, "response" => $resp]); + //flujo error + if ($request->exists("TBK_TOKEN") && $request->exists("token_ws")) { + $view = 'webpay-mall.error'; } - - //Pago abortado - if ($request->exists("TBK_TOKEN")) { - return view('webpayplus/mall_transaction_aborted', ["resp" => $request->all()]); + //Pago abortadoas + elseif ($request->exists("TBK_TOKEN")) { + $view = 'webpay-mall.error'; + } + //Flujo normal + elseif ($request->exists("token_ws")) { + $resp = $this->mallTransaction->commit($request["token_ws"]); + $view = 'webpay-mall.commit'; + $data = ["resp" => $resp, "token" => $request["token_ws"]]; } - //Timeout - return view('webpayplus/mall_transaction_timeout', ["resp" => $request->all()]); + return view($view, $data); } - public function getMallTransactionStatus(Request $request) + + public function status(Request $request) { $req = $request->except('_token'); - $token = $req["token"]; - $resp = (new WebpayPlus\MallTransaction)->status($token); - - return view('webpayplus/mall_transaction_status', ["resp" => $resp, "req" => $req]); + $resp = $this->mallTransaction->status($req["token"]); + return view('webpay-mall.status', ["resp" => $resp, "req" => $req]); } - public function refundMallTransaction(Request $request) + public function refund(Request $request) { - $req = $request->except('_token'); - $token = $req["token"]; try { - $resp = (new WebpayPlus\MallTransaction)->refund($token, $req["buy_order"], $req["commerce_code"], $req["amount"]); - } catch (WebpayPlus\Exceptions\TransactionRefundException $e) { - dd($e); + $req = $request->except('_token'); + $resp = $this->mallTransaction->refund($req["token"], $req["buyOrder"], $req["childComerceCode"], $req["amount"]); + } catch (\Exception $e) { + $resp = array( + 'msg' => $e->getMessage(), + 'code' => $e->getCode() + ); + return view('webpay-mall.refund', ["resp" => $resp, "req" => $req]); } - - - return view('webpayplus/mall_refund_success', ["req" => $req, "resp" => $resp]); + return view('webpay-mall.refund', ["resp" => $resp, "req" => $req]); } } From 3605f3f2be36f110bff19dea210a72a3ef91b771 Mon Sep 17 00:00:00 2001 From: victor mendoza Date: Sun, 28 Jul 2024 18:54:48 -0300 Subject: [PATCH 029/103] feat: add routes for webpay mall --- routes/web.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/routes/web.php b/routes/web.php index 8bf7eb2..4d038d9 100644 --- a/routes/web.php +++ b/routes/web.php @@ -1,6 +1,7 @@ name('patpass'); Route::prefix('webpay-plus')->name("webpay.")->group(function () { - Route::get('/create', [WebpayController::class, 'index'])->name("create"); + Route::get('/create', [WebpayController::class, 'create'])->name("create"); Route::get('/commit', [WebpayController::class, 'commit'])->name("commit"); Route::post('/refund', [WebpayController::class, 'refund'])->name("refund"); Route::get('/status', [WebpayController::class, 'status'])->name("status"); }); -Route::prefix('webpay-plus-mall')->name("webpay-mall.")->group(function () { - Route::get('/create', [WebpayController::class, 'index'])->name("create"); - Route::get('/commit', [WebpayController::class, 'commit'])->name("commit"); - Route::post('/refund', [WebpayController::class, 'refund'])->name("refund"); - Route::get('/status', [WebpayController::class, 'status'])->name("status"); +Route::prefix('webpay-mall')->name("webpay-mall.")->group(function () { + Route::get('/create', [WebpayPlusMallController::class, 'create'])->name("create"); + Route::get('/commit', [WebpayPlusMallController::class, 'commit'])->name("commit"); + Route::post('/refund', [WebpayPlusMallController::class, 'refund'])->name("refund"); + Route::get('/status', [WebpayPlusMallController::class, 'status'])->name("status"); }); From a484d05e7a52321b6c168505e24f26bbd93e9bb1 Mon Sep 17 00:00:00 2001 From: victor mendoza Date: Sun, 28 Jul 2024 18:55:29 -0300 Subject: [PATCH 030/103] fix: use correct route for webpay mall --- resources/views/components/menu.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/components/menu.blade.php b/resources/views/components/menu.blade.php index ccc31d0..de0170f 100644 --- a/resources/views/components/menu.blade.php +++ b/resources/views/components/menu.blade.php @@ -4,7 +4,7 @@ @foreach ([ 'Wepbay Plus' => route('webpay.create'), 'Wepbay Plus Diferido' => route('webpay.create'), - 'Wepbay Mall' => route('webpay.create'), + 'Wepbay Mall' => route('webpay-mall.create'), 'Wepbay Mall Diferido' => route('webpay.create'), ] as $menuItemName => $url) From 5086fdf426b3a2a778f95022a920a78cd3b07d63 Mon Sep 17 00:00:00 2001 From: victor mendoza Date: Sun, 28 Jul 2024 18:55:41 -0300 Subject: [PATCH 031/103] feat: add css for links --- resources/css/app.css | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/resources/css/app.css b/resources/css/app.css index 9cc2eff..6f0b0fb 100644 --- a/resources/css/app.css +++ b/resources/css/app.css @@ -204,6 +204,11 @@ code { margin-bottom: 32px; } +.tbk-link { + color: var(--tbk-red); + text-decoration: underline; +} + /* layout */ .main-container { From 29e2d391fb31b5bec5c25bf490af43f0b9a8f1c3 Mon Sep 17 00:00:00 2001 From: victor mendoza Date: Sun, 28 Jul 2024 18:56:10 -0300 Subject: [PATCH 032/103] feat: add create page --- resources/views/webpay-mall/create.blade.php | 75 ++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 resources/views/webpay-mall/create.blade.php diff --git a/resources/views/webpay-mall/create.blade.php b/resources/views/webpay-mall/create.blade.php new file mode 100644 index 0000000..7a1c97b --- /dev/null +++ b/resources/views/webpay-mall/create.blade.php @@ -0,0 +1,75 @@ +@php + $navigation = ['create' => 'Crear transacción', 'example' => 'Ejemplo']; +@endphp + + +

    Webpay Mall - Creación de transacción Mall +

    +

    + En esta etapa, se procederá a la creación de una transacción con el fin de obtener un identificador + único. Esto nos permitirá redirigir al Tarjetahabiente hacia el formulario de pago en el siguiente paso. + +

    + +

    Paso 1: Petición

    +
      +
    • Comienza por importar la librería WebpayPlus en tu proyecto.
    • +
    • Luego, crea una transacción utilizando las funciones proporcionadas mediante el SDK.
    • +
    + + use Transbank\Webpay\Options; + use Transbank\Webpay\WebpayPlus\MallTransaction; + //configuración de la transacción + $option = new Options(API_KEY, COMMERCE_CODE, Options::ENVIRONMENT_INTEGRATION); + $this->mallTransaction = new mallTransaction($option); + $resp = $this->mallTransaction->create($buy_order, $session_id, $return_url, + $details); + + + +

    Paso 2: Respuesta

    +

    Una vez que hayas creado la transacción, aquí encontrarás los datos de respuesta generados por el + proceso. +

    + + + +

    Paso 3: Creación del formulario

    +

    Utiliza estos datos de respuesta para generar y presentar un formulario de pago al Tarjetahabiente. + Este formulario será la interfaz a través de la cual el usuario realizará su transacción. +

    + + + form action="https://webpay3gint.transbank.cl/webpayserver/initTransaction" method="POST"> + input type="hidden" name="token_ws" value="{{ $resp->token }}" /> + input type="submit" value="Pagar" /> + form> + + +

    Ejemplo

    +

    Para llevar a cabo una transacción de compra en nuestro sistema, primero debemos crear la + transacción. Utilizaremos los siguientes datos para configurar la transacción: +

    + +
    + +
    + +

    Por último, con la respuesta del servicio que confirma la creación de la transacción, procedemos + a crear el formulario de pago. Para fines de este ejemplo, haremos visible el campo "token_ws", el cual es + esencial para completar el proceso de pago de manera exitosa. +

    + + url }} action="POST"> +
    + Formulario de redirección +
    + + token }} required> +
    + +
    + +
    From 87e08e30dbb7cd880ffb23c4e9e32dcc29d35e2e Mon Sep 17 00:00:00 2001 From: victor mendoza Date: Sun, 28 Jul 2024 18:56:16 -0300 Subject: [PATCH 033/103] feat: add commit page --- resources/views/webpay-mall/commit.blade.php | 79 ++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 resources/views/webpay-mall/commit.blade.php diff --git a/resources/views/webpay-mall/commit.blade.php b/resources/views/webpay-mall/commit.blade.php new file mode 100644 index 0000000..466e1b3 --- /dev/null +++ b/resources/views/webpay-mall/commit.blade.php @@ -0,0 +1,79 @@ +@php + $navigation = ['confirm' => 'Confirmar transacción', 'other' => 'Otras operaciones']; +@endphp + + + +

    Webpay Mall - Confirmar transacción

    +

    En este paso es importante confirmar la transacción para notificar a Transbank que hemos recibido + exitosamente los detalles de la transacción. Es importante destacar que si la confirmación no se realiza, la + transacción será reversada. +

    + +

    Paso 1 - Datos recibidos:

    +
      +

      + Después de completar el flujo en el formulario de pago, recibirás un GET con la siguiente + información: +

      +
    + (returnUrl)?token_ws={{ $token }} + +

    Paso 2 - Petición:

    +

    + Utilizarás el token recibido para confirmar la transacción mediante el SDK. +

    + + + $resp = $transaction->commit($token); + + +

    Paso 3 - Respuesta:

    +

    + Transbank responderá con la siguiente información. Es crucial guardar esta respuesta, y la única + validación necesaria es que el campo "response_code" sea igual a cero. +

    + + + + +

    ¡Listo!

    +

    + Con la confirmación exitosa, ya puedes mostrar al usuario una página de éxito de la transacción, + proporcionándole la tranquilidad de que el proceso ha sido completado con éxito. +

    +

    + Después de confirmar la transacción, podrás realizar otras operaciones útiles: +

    +
      +
    • + Reembolsar: Puedes reversar o anular el pago según ciertas condiciones + comerciales. +
    • +
    • + Consultar Estado: Hasta 7 días después de la transacción, podrás consultar el + estado de la + transacción. +
    • +
    + + @foreach ($resp->details as $detail) +
    + @csrf +
    +
    + + amount }}> + commerceCode }}> + buyOrder }}> + +
    + +
    +
    + @endforeach +
    $token]) }} class="tbk-button primary mb-32">CONSULTAR ESTADO + From fe3c6328a1a9b765b0903534905e9d42613b2c3d Mon Sep 17 00:00:00 2001 From: victor mendoza Date: Sun, 28 Jul 2024 18:56:27 -0300 Subject: [PATCH 034/103] feat: add refund page --- resources/views/webpay-mall/refund.blade.php | 46 ++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 resources/views/webpay-mall/refund.blade.php diff --git a/resources/views/webpay-mall/refund.blade.php b/resources/views/webpay-mall/refund.blade.php new file mode 100644 index 0000000..619f357 --- /dev/null +++ b/resources/views/webpay-mall/refund.blade.php @@ -0,0 +1,46 @@ +@php + $navigation = ['refund' => 'Reembolsar']; +@endphp + + +

    Webpay Plus - Reembolsar

    +

    En esta etapa, tienes la opción de solicitar el reembolso del monto al titular de la tarjeta. + Dependiendo del monto y el tiempo transcurrido desde la transacción, este proceso podría resultar en una + Reversa, Anulación o Anulación Parcial. + +

    + +

    Paso 1 - Petición:

    +

    + Para llevar a cabo el reembolso, necesitas proporcionar el token de la transacción, el monto que + quieres reversar, el código de comercio de la tienda hijo y el orden de compra del detalle de la transacción. Si + anulas el monto total, podría ser una Reversa o Anulación, dependiendo de ciertas condiciones, o una Anulación + Parcial si el monto es menor al total. +

    + +

    Algunas consideraciones a tener en cuenta

    +
      +
    • + No es posible realizar Anulaciones ni Anulaciones Parciales en tarjetas que no sean de crédito. +
    • +
    • + No es posible realizar Anulaciones Parciales en pagos con cuotas. +
    • +
    • No se admiten reembolsos de compras en cuotas.
    • +
    + +

    En este link + podrás ver + mayor información sobre las condiciones y casos para anular o reversar transacciones.

    + + $resp = $mallTransaction->refund($token, $buyOrder, $childComerceCode, + $amount); + + +

    Paso 2: Respuesta

    +

    Transbank responderá con el resultado del proceso de reembolso, indicando si se ha realizado una + Reversa, Anulación o Anulación Parcial. +

    + + +
    From c1bd88aef0a8027e1becf6db0a4284ddcb1128bd Mon Sep 17 00:00:00 2001 From: victor mendoza Date: Sun, 28 Jul 2024 18:56:37 -0300 Subject: [PATCH 035/103] feat: add status page --- resources/views/webpay-mall/status.blade.php | 30 ++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 resources/views/webpay-mall/status.blade.php diff --git a/resources/views/webpay-mall/status.blade.php b/resources/views/webpay-mall/status.blade.php new file mode 100644 index 0000000..8aa5847 --- /dev/null +++ b/resources/views/webpay-mall/status.blade.php @@ -0,0 +1,30 @@ +@php + $navigation = ['state' => 'Consultar estado']; +@endphp + + + +

    Webpay Plus - Consultar estado de transacción

    +

    Puedes solicitar el estado de una transacción hasta 7 días después de su realización. No hay límite + de solicitudes de este tipo durante ese período. Sin embargo, una vez pasados los 7 días, ya no podrás revisar + su estado. +

    + +

    Paso 1 - Petición:

    +

    + Para realizar la consulta, necesitas el token de la transacción de la cual deseas obtener el estado. Utiliza + este token para realizar una llamada a WebpayPlus.Transaction. +

    + + $resp = $mallTransaction->status($token); + + +

    Paso 2: Respuesta

    +

    + Transbank responderá con la siguiente información. Asegúrate de guardar esta respuesta, y la única validación + necesaria es que el campo "response_code" sea igual a cero. +

    + + + +
    From 3f87b32e780e6432b6f574c44600ae1a6d1cf576 Mon Sep 17 00:00:00 2001 From: victor mendoza Date: Mon, 29 Jul 2024 12:24:42 -0300 Subject: [PATCH 036/103] refactor: use pre and code tag --- resources/views/webpay-mall/create.blade.php | 30 ++++++++++++++------ 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/resources/views/webpay-mall/create.blade.php b/resources/views/webpay-mall/create.blade.php index 7a1c97b..df06faa 100644 --- a/resources/views/webpay-mall/create.blade.php +++ b/resources/views/webpay-mall/create.blade.php @@ -16,16 +16,28 @@
  • Comienza por importar la librería WebpayPlus en tu proyecto.
  • Luego, crea una transacción utilizando las funciones proporcionadas mediante el SDK.
  • - - use Transbank\Webpay\Options; - use Transbank\Webpay\WebpayPlus\MallTransaction; - //configuración de la transacción - $option = new Options(API_KEY, COMMERCE_CODE, Options::ENVIRONMENT_INTEGRATION); - $this->mallTransaction = new mallTransaction($option); - $resp = $this->mallTransaction->create($buy_order, $session_id, $return_url, - $details); +
    
    +use Transbank\Webpay\Options;
    +use Transbank\Webpay\WebpayPlus\MallTransaction;
    +//configuración de la transacción
    +$details = [
    +    [
    +        "amount" => 10000,
    +        "commerce_code" => 597055555536,
    +        "buy_order" => "ordenCompraDetalle1234"
    +    ],
    +    [
    +        "amount" => 12000,
    +        "commerce_code" => 597055555537,
    +        "buy_order" => "ordenCompraDetalle4321"
    +    ],
    +];
    +$option = new Options(API_KEY, COMMERCE_CODE, Options::ENVIRONMENT_INTEGRATION);
    +$mallTransaction = new mallTransaction($option);
    +$resp = $mallTransaction->create($buy_order, $session_id, $return_url,
    +$details);
    +    
    -

    Paso 2: Respuesta

    Una vez que hayas creado la transacción, aquí encontrarás los datos de respuesta generados por el From 96a40d097ff48140688b34d53b5ba83e81560958 Mon Sep 17 00:00:00 2001 From: victor mendoza Date: Tue, 30 Jul 2024 14:07:01 -0300 Subject: [PATCH 037/103] feat: create controller for webpay deferred --- .../WebpayPlusDeferredController.php | 95 +++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 app/Http/Controllers/WebpayPlusDeferredController.php diff --git a/app/Http/Controllers/WebpayPlusDeferredController.php b/app/Http/Controllers/WebpayPlusDeferredController.php new file mode 100644 index 0000000..13af669 --- /dev/null +++ b/app/Http/Controllers/WebpayPlusDeferredController.php @@ -0,0 +1,95 @@ +transaction = new Transaction($option); + } + + public function create() + { + + $createTx = [ + 'buyOrder' => "O-" . rand(1, 10000), + "sessionId" => "S-" . (string)(rand(1, 10000)), + 'returnUrl' => url('/') . '/webpay-plus-diferido/commit', + 'amount' => rand(1000, 2000) + ]; + + + $resp = $this->transaction->create($createTx['buyOrder'], $createTx['sessionId'], $createTx['amount'], $createTx['returnUrl']); + return view('webpay-deferred.create', ["request" => $createTx, "respond" => $resp]); + } + public function commit(Request $request) + { + //Timeout + $view = 'webpay-deferred.timeout'; + $data = ["request" => $request]; + + //flujo error + if ($request->exists("TBK_TOKEN") && $request->exists("token_ws")) { + $view = 'webpay-deferred.error'; + } + //Pago abortadoas + elseif ($request->exists("TBK_TOKEN")) { + $view = 'webpay-deferred.error'; + } + //Flujo normal + elseif ($request->exists("token_ws")) { + $resp = $this->transaction->commit($request["token_ws"]); + $view = 'webpay-deferred.commit'; + $data = ["resp" => $resp, "token" => $request["token_ws"]]; + } + + return view($view, $data); + } + + public function capture(Request $request) + { + try { + $req = $request->except('_token'); + $resp = $this->transaction->capture($req["token"], $req["buyOrder"], $req["authorizationCode"], $req["amount"]); + } catch (\Exception $e) { + $resp = array( + 'msg' => $e->getMessage(), + 'code' => $e->getCode() + ); + return view('webpay-deferred.capture', ["resp" => $resp, "token" => $req["token"]]); + } + return view('webpay-deferred.capture', ["resp" => $resp, "token" => $req["token"]]); + } + + public function refund(Request $request) + { + try { + $req = $request->except('_token'); + $resp = $this->transaction->refund($req["token"], $req["amount"]); + } catch (\Exception $e) { + $resp = array( + 'msg' => $e->getMessage(), + 'code' => $e->getCode() + ); + return view('webpay-deferred.refund', ["resp" => $resp]); + } + return view('webpay-deferred.refund', ["resp" => $resp]); + } + + public function status(Request $request) + { + $token = $request["token"]; + $resp = $this->transaction->status($token); + return view('webpay-deferred.status', ["resp" => $resp, "req" => $request]); + } +} From 7ef71361b5970f14e314ae51025a9db2a6765b1d Mon Sep 17 00:00:00 2001 From: victor mendoza Date: Tue, 30 Jul 2024 14:07:19 -0300 Subject: [PATCH 038/103] feat: add routes for webpay deferred --- routes/web.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/routes/web.php b/routes/web.php index 4d038d9..72c3c10 100644 --- a/routes/web.php +++ b/routes/web.php @@ -2,6 +2,7 @@ use App\Http\Controllers\WebpayController; use App\Http\Controllers\WebpayPlusMallController; +use App\Http\Controllers\WebpayPlusDeferredController; use Illuminate\Support\Facades\Route; @@ -23,3 +24,11 @@ Route::post('/refund', [WebpayPlusMallController::class, 'refund'])->name("refund"); Route::get('/status', [WebpayPlusMallController::class, 'status'])->name("status"); }); + +Route::prefix('webpay-plus-diferido')->name("webpay-deferred.")->group(function () { + Route::get('/create', [WebpayPlusDeferredController::class, 'create'])->name("create"); + Route::get('/commit', [WebpayPlusDeferredController::class, 'commit'])->name("commit"); + Route::post('/capture', [WebpayPlusDeferredController::class, 'capture'])->name("capture"); + Route::post('/refund', [WebpayPlusDeferredController::class, 'refund'])->name("refund"); + Route::get('/status', [WebpayPlusDeferredController::class, 'status'])->name("status"); +}); From 0c20242166c995d07984fad7d6e66da48925359d Mon Sep 17 00:00:00 2001 From: victor mendoza Date: Tue, 30 Jul 2024 14:08:10 -0300 Subject: [PATCH 039/103] fix: use cerrect link for webpay deferred --- resources/views/components/menu.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/components/menu.blade.php b/resources/views/components/menu.blade.php index de0170f..2389501 100644 --- a/resources/views/components/menu.blade.php +++ b/resources/views/components/menu.blade.php @@ -3,7 +3,7 @@ Webpay Plus @foreach ([ 'Wepbay Plus' => route('webpay.create'), - 'Wepbay Plus Diferido' => route('webpay.create'), + 'Wepbay Plus Diferido' => route('webpay-deferred.create'), 'Wepbay Mall' => route('webpay-mall.create'), 'Wepbay Mall Diferido' => route('webpay.create'), ] as $menuItemName => $url) From 46920b4cd33351dbb12e82f939974ee85ffb7158 Mon Sep 17 00:00:00 2001 From: victor mendoza Date: Tue, 30 Jul 2024 14:08:44 -0300 Subject: [PATCH 040/103] feat: add create view for webpay deferred --- .../views/webpay-deferred/create.blade.php | 72 +++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 resources/views/webpay-deferred/create.blade.php diff --git a/resources/views/webpay-deferred/create.blade.php b/resources/views/webpay-deferred/create.blade.php new file mode 100644 index 0000000..b95b400 --- /dev/null +++ b/resources/views/webpay-deferred/create.blade.php @@ -0,0 +1,72 @@ +@php + $navigation = ['create' => 'Crear transacción', 'example' => 'Ejemplo']; +@endphp + + +

    Webpay Plus Diferido - Creación de transacción

    +

    + En esta etapa, se procederá a la creación de una transacción con el fin de obtener un identificador + único. Esto + nos permitirá redirigir al Tarjetahabiente hacia el formulario de pago en el siguiente paso. +

    + +

    Paso 1: Petición

    +
      +
    • Comienza por importar la librería WebpayPlus en tu proyecto.
    • +
    • Luego, crea una transacción utilizando las funciones proporcionadas por WebpayPlus.
    • +
    + + use Transbank\Webpay\WebpayPlus\Transaction; + use Transbank\Webpay\Options; + //configuración de la transacción + $option = new Options(API_KEY, COMMERCE_CODE, Options::ENVIRONMENT_INTEGRATION); + $transaction = new Transaction($option); + $transaction->create($buyOrder, $sessionId, $amount, $returnUrl); + + +

    Paso 2: Respuesta

    +

    Una vez que hayas creado la transacción, aquí encontrarás los datos de respuesta generados por el + proceso. +

    + + + +

    Paso 3: Creación del formulario

    +

    Utiliza estos datos de respuesta para generar y presentar un formulario de pago al Tarjetahabiente. + Este formulario será la interfaz a través de la cual el usuario realizará su transacción. +

    + + + form action="https://webpay3gint.transbank.cl/webpayserver/initTransaction" method="POST"> + input type="hidden" name="token_ws" value="{{ $respond->token }}" /> + input type="submit" value="Pagar" /> + form> + + +

    Ejemplo

    +

    Para llevar a cabo una transacción de compra en nuestro sistema, primero debemos crear la + transacción. Utilizaremos los siguientes datos para configurar la transacción: +

    + +
    + +
    + +

    Por último, con la respuesta del servicio que confirma la creación de la transacción, procedemos + a crear el formulario de pago. Para fines de este ejemplo, haremos visible el campo "token_ws", el cual es + esencial para completar el proceso de pago de manera exitosa. +

    + +
    url }} action="POST"> +
    + Formulario de redirección +
    + + token }} required> +
    + +
    +
    + From bf13b2632a046e33c3ef86fdc763f5cf562e99b7 Mon Sep 17 00:00:00 2001 From: victor mendoza Date: Tue, 30 Jul 2024 14:08:51 -0300 Subject: [PATCH 041/103] feat: add commit view for webpay deferred --- .../views/webpay-deferred/commit.blade.php | 78 +++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 resources/views/webpay-deferred/commit.blade.php diff --git a/resources/views/webpay-deferred/commit.blade.php b/resources/views/webpay-deferred/commit.blade.php new file mode 100644 index 0000000..b2c24c9 --- /dev/null +++ b/resources/views/webpay-deferred/commit.blade.php @@ -0,0 +1,78 @@ +@php + $navigation = ['confirm' => 'Confirmar transacción', 'other' => 'Ejemplo']; +@endphp + + + +

    Webpay Plus Diferido - Confirmar transacción

    +

    En este paso es importante confirmar la transacción para notificar a Transbank que hemos recibido + exitosamente los detalles de la transacción. Si la confirmación no se realiza, la transacción será reversada. +

    + +

    Paso 1 - Datos recibidos:

    +
      +

      + Después de completar el flujo en el formulario de pago, recibirás un GET con la siguiente + información: +

      +
    + (returnUrl)?token_ws={{ $token }} + +

    Paso 2 - Petición:

    +

    + Utilizarás el token recibido para confirmar la transacción mediante una nueva llamada a WebpayPlus. +

    + + + $resp = $transaction->commit($token); + + +

    Paso 3 - Respuesta:

    +

    + Transbank responderá con la siguiente información. Es crucial guardar esta respuesta, y la única + validación necesaria es que el campo "response_code" sea igual a cero. +

    + + + + +

    ¡Listo!

    +

    + Es importante tener en cuenta que la transacción aún no ha sido capturada, por lo que hay que dejarle saber al + tarjetahabiente que necesita un paso más; solo se ha retenido el saldo en su tarjeta. Después de confirmar la + transacción, puedes: +

    + +
      +
    • + Capturar la transacción. +
    • +
    • + Revertir la transacción si es necesario. +
    • +
    • + Consultar el estado de la transacción hasta 7 días después de realizada. +
    • +
    + +
    + @csrf +
    +

    Capturar la transacción para realmente capturar el dinero que habia sido previamente + reservado.

    +
    + + amount }}> + buyOrder }}> + authorizationCode }}> + +
    + +
    +
    + $token]) }} class="tbk-button primary mb-32">CONSULTAR + ESTADO +
    From f6bb57a03866544e2e3c195f8ea39531e052be08 Mon Sep 17 00:00:00 2001 From: victor mendoza Date: Tue, 30 Jul 2024 14:08:58 -0300 Subject: [PATCH 042/103] feat: add capture view for webpay deferred --- .../views/webpay-deferred/capture.blade.php | 59 +++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 resources/views/webpay-deferred/capture.blade.php diff --git a/resources/views/webpay-deferred/capture.blade.php b/resources/views/webpay-deferred/capture.blade.php new file mode 100644 index 0000000..dd5afc9 --- /dev/null +++ b/resources/views/webpay-deferred/capture.blade.php @@ -0,0 +1,59 @@ +@php + $navigation = ['create' => 'Crear transacción', 'example' => 'Ejemplo']; +@endphp + + +

    Webpay Plus Diferido - Creación de transacción

    +

    + En este paso debemos capturar la transacción para realmente capturar el dinero que habia sido previamente + reservado al hacer la transacción +

    + +

    Paso 1: Petición

    +

    + Para capturar una transacción necesitaremos el Token, Orden de compra, Código de autorización y monto a + capturar. Se hace de la siguiente manera. +

    + + $resp = $transaction->capture($token, $buyOrder, $authorizationCode, $amount); + + +

    Paso 2: Respuesta

    +

    + Transbank contestará con lo siguiente. Debes guardar esta información, lo único que debes validar + es que response_code sea igual a cero. +

    + + + +

    + Otras utilidades +

    +

    + Luego de capturada la transacción puedes Reembolsar (reversar o anular) el pago dependiendo de + ciertas condiciones comerciales. También puedes consultar el estado de la transacción hasta 7 días después de + realizada. +

    + +

    + Por último, con la respuesta del servicio que confirma la creación de la transacción, procedemos + a crear el formulario de pago. Para fines de este ejemplo, haremos visible el campo "token_ws", el cual es + esencial para completar el proceso de pago de manera exitosa. +

    + +
    + @csrf +
    +
    + + capturedAmount }}> + +
    + +
    +
    + $token]) }} class="tbk-button primary mb-32">CONSULTAR + ESTADO +
    From 0937f43b333c375d9cce3c571b1f43c2fcd0845c Mon Sep 17 00:00:00 2001 From: victor mendoza Date: Tue, 30 Jul 2024 14:09:05 -0300 Subject: [PATCH 043/103] feat: add refund view for webpay deferred --- .../views/webpay-deferred/refund.blade.php | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 resources/views/webpay-deferred/refund.blade.php diff --git a/resources/views/webpay-deferred/refund.blade.php b/resources/views/webpay-deferred/refund.blade.php new file mode 100644 index 0000000..52a443c --- /dev/null +++ b/resources/views/webpay-deferred/refund.blade.php @@ -0,0 +1,36 @@ +@php + $navigation = ['refund' => 'Reembolsar']; +@endphp + + + +

    Webpay Plus - Reembolsar

    +

    En esta etapa, tienes la opción de solicitar el reembolso del monto al titular de la tarjeta. + Dependiendo del monto y el tiempo transcurrido desde la transacción, este proceso podría resultar en una + Reversa, Anulación o Anulación Parcial. +

    + +

    Paso 1 - Petición:

    +

    Para llevar a cabo el reembolso, necesitas proporcionar el token de la transacción y el monto que + deseas + reversar. Si anulas el monto total, podría ser una Reversa o Anulación, dependiendo de ciertas condiciones, o + una Anulación Parcial si el monto es menor al total. +

    + +

    Condiciones Importantes:

    +
      +
    • + No es posible realizar Anulaciones ni Anulaciones Parciales en tarjetas que no sean de crédito. +
    • +
    • No se admiten reembolsos de compras en cuotas.
    • +
    + + $resp = $transaction->refund($token, $amount); + +

    Paso 2: Respuesta

    +

    Transbank responderá con el resultado del proceso de reembolso, indicando si se ha realizado una + Reversa, Anulación o Anulación Parcial. +

    + + +
    From e0082ffca8a4e96744f483b396a3165f13cb1991 Mon Sep 17 00:00:00 2001 From: victor mendoza Date: Tue, 30 Jul 2024 14:09:13 -0300 Subject: [PATCH 044/103] feat: add status view for webpay deferred --- .../views/webpay-deferred/status.blade.php | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 resources/views/webpay-deferred/status.blade.php diff --git a/resources/views/webpay-deferred/status.blade.php b/resources/views/webpay-deferred/status.blade.php new file mode 100644 index 0000000..ea75439 --- /dev/null +++ b/resources/views/webpay-deferred/status.blade.php @@ -0,0 +1,30 @@ +@php + $navigation = ['state' => 'Consultar estado']; +@endphp + + + +

    Webpay Plus - Consultar estado de transacción

    +

    Puedes solicitar el estado de una transacción hasta 7 días después de su realización. No hay límite + de solicitudes de este tipo durante ese período. Sin embargo, una vez pasados los 7 días, ya no podrás revisar + su estado. +

    + +

    Paso 1 - Petición:

    +

    + Para realizar la consulta, necesitas el token de la transacción de la cual deseas obtener el estado. Utiliza + este token para realizar una llamada a WebpayPlus.Transaction. +

    + + $resp = $transaction->status($token); + + +

    Paso 2: Respuesta

    +

    + Transbank responderá con la siguiente información. Asegúrate de guardar esta respuesta, y la única validación + necesaria es que el campo "response_code" sea igual a cero. +

    + + + +
    From 8b798c0473378e2f86cfd2fe35175179e11968c2 Mon Sep 17 00:00:00 2001 From: victor mendoza Date: Tue, 30 Jul 2024 18:16:05 -0300 Subject: [PATCH 045/103] fix: typo --- app/Http/Controllers/WebpayPlusDeferredController.php | 2 +- resources/views/components/menu.blade.php | 8 ++++---- resources/views/webpay-deferred/capture.blade.php | 4 ++-- resources/views/webpay-deferred/commit.blade.php | 2 +- resources/views/webpay-deferred/create.blade.php | 2 +- resources/views/webpay-deferred/refund.blade.php | 2 +- resources/views/webpay-deferred/status.blade.php | 2 +- resources/views/webpay-mall/commit.blade.php | 2 +- resources/views/webpay-mall/create.blade.php | 2 +- resources/views/webpay-mall/refund.blade.php | 2 +- resources/views/webpay-mall/status.blade.php | 2 +- resources/views/webpay/commit.blade.php | 2 +- resources/views/webpay/create.blade.php | 2 +- resources/views/webpay/refund.blade.php | 2 +- resources/views/webpay/status.blade.php | 2 +- 15 files changed, 19 insertions(+), 19 deletions(-) diff --git a/app/Http/Controllers/WebpayPlusDeferredController.php b/app/Http/Controllers/WebpayPlusDeferredController.php index 13af669..62ca70d 100644 --- a/app/Http/Controllers/WebpayPlusDeferredController.php +++ b/app/Http/Controllers/WebpayPlusDeferredController.php @@ -42,7 +42,7 @@ public function commit(Request $request) if ($request->exists("TBK_TOKEN") && $request->exists("token_ws")) { $view = 'webpay-deferred.error'; } - //Pago abortadoas + //Pago abortado elseif ($request->exists("TBK_TOKEN")) { $view = 'webpay-deferred.error'; } diff --git a/resources/views/components/menu.blade.php b/resources/views/components/menu.blade.php index 2389501..aab4155 100644 --- a/resources/views/components/menu.blade.php +++ b/resources/views/components/menu.blade.php @@ -2,10 +2,10 @@
    Webpay Plus @foreach ([ - 'Wepbay Plus' => route('webpay.create'), - 'Wepbay Plus Diferido' => route('webpay-deferred.create'), - 'Wepbay Mall' => route('webpay-mall.create'), - 'Wepbay Mall Diferido' => route('webpay.create'), + 'Webpay Plus' => route('webpay.create'), + 'Webpay Plus Diferido' => route('webpay-deferred.create'), + 'Webpay Mall' => route('webpay-mall.create'), + 'Webpay Mall Diferido' => route('webpay.create'), ] as $menuItemName => $url) {{ $menuItemName }} diff --git a/resources/views/webpay-deferred/capture.blade.php b/resources/views/webpay-deferred/capture.blade.php index dd5afc9..c38057f 100644 --- a/resources/views/webpay-deferred/capture.blade.php +++ b/resources/views/webpay-deferred/capture.blade.php @@ -2,7 +2,7 @@ $navigation = ['create' => 'Crear transacción', 'example' => 'Ejemplo']; @endphp - +

    Webpay Plus Diferido - Creación de transacción

    En este paso debemos capturar la transacción para realmente capturar el dinero que habia sido previamente @@ -50,7 +50,7 @@

    diff --git a/resources/views/webpay-deferred/commit.blade.php b/resources/views/webpay-deferred/commit.blade.php index b2c24c9..dec1889 100644 --- a/resources/views/webpay-deferred/commit.blade.php +++ b/resources/views/webpay-deferred/commit.blade.php @@ -2,7 +2,7 @@ $navigation = ['confirm' => 'Confirmar transacción', 'other' => 'Ejemplo']; @endphp - +

    Webpay Plus Diferido - Confirmar transacción

    En este paso es importante confirmar la transacción para notificar a Transbank que hemos recibido diff --git a/resources/views/webpay-deferred/create.blade.php b/resources/views/webpay-deferred/create.blade.php index b95b400..f38f8c4 100644 --- a/resources/views/webpay-deferred/create.blade.php +++ b/resources/views/webpay-deferred/create.blade.php @@ -2,7 +2,7 @@ $navigation = ['create' => 'Crear transacción', 'example' => 'Ejemplo']; @endphp - +

    Webpay Plus Diferido - Creación de transacción

    En esta etapa, se procederá a la creación de una transacción con el fin de obtener un identificador diff --git a/resources/views/webpay-deferred/refund.blade.php b/resources/views/webpay-deferred/refund.blade.php index 52a443c..8f1ab07 100644 --- a/resources/views/webpay-deferred/refund.blade.php +++ b/resources/views/webpay-deferred/refund.blade.php @@ -2,7 +2,7 @@ $navigation = ['refund' => 'Reembolsar']; @endphp - +

    Webpay Plus - Reembolsar

    En esta etapa, tienes la opción de solicitar el reembolso del monto al titular de la tarjeta. diff --git a/resources/views/webpay-deferred/status.blade.php b/resources/views/webpay-deferred/status.blade.php index ea75439..b554b55 100644 --- a/resources/views/webpay-deferred/status.blade.php +++ b/resources/views/webpay-deferred/status.blade.php @@ -2,7 +2,7 @@ $navigation = ['state' => 'Consultar estado']; @endphp - +

    Webpay Plus - Consultar estado de transacción

    Puedes solicitar el estado de una transacción hasta 7 días después de su realización. No hay límite diff --git a/resources/views/webpay-mall/commit.blade.php b/resources/views/webpay-mall/commit.blade.php index 466e1b3..83163b1 100644 --- a/resources/views/webpay-mall/commit.blade.php +++ b/resources/views/webpay-mall/commit.blade.php @@ -2,7 +2,7 @@ $navigation = ['confirm' => 'Confirmar transacción', 'other' => 'Otras operaciones']; @endphp - +

    Webpay Mall - Confirmar transacción

    En este paso es importante confirmar la transacción para notificar a Transbank que hemos recibido diff --git a/resources/views/webpay-mall/create.blade.php b/resources/views/webpay-mall/create.blade.php index df06faa..ea7e511 100644 --- a/resources/views/webpay-mall/create.blade.php +++ b/resources/views/webpay-mall/create.blade.php @@ -2,7 +2,7 @@ $navigation = ['create' => 'Crear transacción', 'example' => 'Ejemplo']; @endphp - +

    Webpay Mall - Creación de transacción Mall

    diff --git a/resources/views/webpay-mall/refund.blade.php b/resources/views/webpay-mall/refund.blade.php index 619f357..ce8afc9 100644 --- a/resources/views/webpay-mall/refund.blade.php +++ b/resources/views/webpay-mall/refund.blade.php @@ -2,7 +2,7 @@ $navigation = ['refund' => 'Reembolsar']; @endphp - +

    Webpay Plus - Reembolsar

    En esta etapa, tienes la opción de solicitar el reembolso del monto al titular de la tarjeta. Dependiendo del monto y el tiempo transcurrido desde la transacción, este proceso podría resultar en una diff --git a/resources/views/webpay-mall/status.blade.php b/resources/views/webpay-mall/status.blade.php index 8aa5847..1e68cbd 100644 --- a/resources/views/webpay-mall/status.blade.php +++ b/resources/views/webpay-mall/status.blade.php @@ -2,7 +2,7 @@ $navigation = ['state' => 'Consultar estado']; @endphp - +

    Webpay Plus - Consultar estado de transacción

    Puedes solicitar el estado de una transacción hasta 7 días después de su realización. No hay límite diff --git a/resources/views/webpay/commit.blade.php b/resources/views/webpay/commit.blade.php index 53e9ac9..78c6e19 100644 --- a/resources/views/webpay/commit.blade.php +++ b/resources/views/webpay/commit.blade.php @@ -2,7 +2,7 @@ $navigation = ['confirm' => 'Confirmar transacción', 'other' => 'Ejemplo']; @endphp - +

    Webpay Plus - Confirmar transacción

    En este paso es importante confirmar la transacción para notificar a Transbank que hemos recibido diff --git a/resources/views/webpay/create.blade.php b/resources/views/webpay/create.blade.php index dcbd001..a0b00ac 100644 --- a/resources/views/webpay/create.blade.php +++ b/resources/views/webpay/create.blade.php @@ -2,7 +2,7 @@ $navigation = ['create' => 'Crear transacción', 'example' => 'Ejemplo']; @endphp - +

    Webpay Plus - Creación de transacción

    En esta etapa, se procederá a la creación de una transacción con el fin de obtener un identificador único. Esto diff --git a/resources/views/webpay/refund.blade.php b/resources/views/webpay/refund.blade.php index 52a443c..8f1ab07 100644 --- a/resources/views/webpay/refund.blade.php +++ b/resources/views/webpay/refund.blade.php @@ -2,7 +2,7 @@ $navigation = ['refund' => 'Reembolsar']; @endphp - +

    Webpay Plus - Reembolsar

    En esta etapa, tienes la opción de solicitar el reembolso del monto al titular de la tarjeta. diff --git a/resources/views/webpay/status.blade.php b/resources/views/webpay/status.blade.php index ea75439..b554b55 100644 --- a/resources/views/webpay/status.blade.php +++ b/resources/views/webpay/status.blade.php @@ -2,7 +2,7 @@ $navigation = ['state' => 'Consultar estado']; @endphp - +

    Webpay Plus - Consultar estado de transacción

    Puedes solicitar el estado de una transacción hasta 7 días después de su realización. No hay límite From 4beef3eeee27c6bf342fae792e342384ed87da46 Mon Sep 17 00:00:00 2001 From: Mauricio Astudillo Toledo Date: Tue, 30 Jul 2024 17:42:20 -0400 Subject: [PATCH 046/103] chore: add sonar cloud --- .github/workflows/build.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..1652040 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,21 @@ +name: Sonar Scan +on: + push: + branches: + - main + pull_request: + branches: + - ** +jobs: + sonarcloud: + name: SonarCloud + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: SonarCloud Scan + uses: SonarSource/sonarcloud-github-action@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} From 4e19cb17741b460cffa478d7bdff2c611b9d27d1 Mon Sep 17 00:00:00 2001 From: victor mendoza Date: Thu, 1 Aug 2024 11:32:58 -0300 Subject: [PATCH 047/103] refactor: use only one var --- .../Controllers/WebpayPlusMallController.php | 31 ++++++++++--------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/app/Http/Controllers/WebpayPlusMallController.php b/app/Http/Controllers/WebpayPlusMallController.php index ed6ec00..bf77075 100644 --- a/app/Http/Controllers/WebpayPlusMallController.php +++ b/app/Http/Controllers/WebpayPlusMallController.php @@ -21,24 +21,25 @@ public function create() { $createTx = [ - 'buy_order' => "O-" . rand(1, 10000), + "buy_order" => "O-" . rand(1, 10000), "session_id" => "S-" . (string)(rand(1, 10000)), - 'return_url' => url('/') . '/webpay-mall/commit', - ]; - $details = [ - [ - "amount" => 10000, - "commerce_code" => 597055555536, - "buy_order" => "ordenCompraDetalle1234" - ], - [ - "amount" => 12000, - "commerce_code" => 597055555537, - "buy_order" => "ordenCompraDetalle4321" - ], + "return_url" => url("/") . "/webpay-mall/commit", + "details" => [ + [ + "amount" => 10000, + "commerce_code" => 597055555536, + "buy_order" => "ordenCompraDetalle1234" + ], + [ + "amount" => 12000, + "commerce_code" => 597055555537, + "buy_order" => "ordenCompraDetalle4321" + ], + ] ]; - $resp = $this->mallTransaction->create($createTx["buy_order"], $createTx["session_id"], $createTx["return_url"], $details); + + $resp = $this->mallTransaction->create($createTx["buy_order"], $createTx["session_id"], $createTx["return_url"], $createTx["details"]); return view('webpay-mall.create', ["request" => $createTx, "resp" => $resp]); } From cb8ead81898bd513aafb9ac05bcf15ba9aee7c83 Mon Sep 17 00:00:00 2001 From: victor mendoza Date: Thu, 1 Aug 2024 11:33:25 -0300 Subject: [PATCH 048/103] feat: create controller for webpay mall deferred --- .../WebpayPlusMallDeferredController.php | 111 ++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 app/Http/Controllers/WebpayPlusMallDeferredController.php diff --git a/app/Http/Controllers/WebpayPlusMallDeferredController.php b/app/Http/Controllers/WebpayPlusMallDeferredController.php new file mode 100644 index 0000000..c004a5a --- /dev/null +++ b/app/Http/Controllers/WebpayPlusMallDeferredController.php @@ -0,0 +1,111 @@ +mallTransaction = new mallTransaction($option); + } + + public function create() + { + + $createTx = [ + 'buy_order' => "O-" . rand(1, 10000), + "session_id" => "S-" . (string)(rand(1, 10000)), + 'return_url' => url('/') . '/webpay-mall-diferido/commit', + 'details' => [ + [ + "amount" => 10000, + "commerce_code" => 597055555582, + "buy_order" => "ordenCompraDetalle" . rand(1, 10000) + ], + [ + "amount" => 12000, + "commerce_code" => 597055555583, + "buy_order" => "ordenCompraDetalle" . rand(1, 10000) + ], + ] + ]; + + + $resp = $this->mallTransaction->create($createTx["buy_order"], $createTx["session_id"], $createTx["return_url"], $createTx["details"]); + + + return view('webpay-mall-deferred.create', ["request" => $createTx, "resp" => $resp]); + } + + + + public function commit(Request $request) + { + //Timeout + $view = 'webpay-mall-deferred.timeout'; + $data = ["request" => $request]; + + //flujo error + if ($request->exists("TBK_TOKEN") && $request->exists("token_ws")) { + $view = 'webpay-mall-deferred.error'; + } + //Pago abortadoas + elseif ($request->exists("TBK_TOKEN")) { + $view = 'webpay-mall-deferred.error'; + } + //Flujo normal + elseif ($request->exists("token_ws")) { + $resp = $this->mallTransaction->commit($request["token_ws"]); + $view = 'webpay-mall-deferred.commit'; + $data = ["resp" => $resp, "token" => $request["token_ws"]]; + } + + return view($view, $data); + } + + + public function status(Request $request) + { + $req = $request->except('_token'); + $resp = $this->mallTransaction->status($req["token"]); + return view('webpay-mall-deferred.status', ["resp" => $resp, "req" => $req]); + } + + public function refund(Request $request) + { + try { + $req = $request->except('_token'); + $resp = $this->mallTransaction->refund($req["token"], $req["buyOrder"], $req["childComerceCode"], $req["amount"]); + } catch (\Exception $e) { + $resp = array( + 'msg' => $e->getMessage(), + 'code' => $e->getCode() + ); + return view('webpay-mall-deferred.refund', ["resp" => $resp, "req" => $req]); + } + return view('webpay-mall-deferred.refund', ["resp" => $resp, "req" => $req]); + } + + public function capture(Request $request) + { + try { + $req = $request->except('_token'); + $resp = $this->mallTransaction->capture($req["childComerceCode"], $req["token"], $req["buyOrder"], $req["authorizationCode"], $req["amount"]); + } catch (\Exception $e) { + $resp = array( + 'msg' => $e->getMessage(), + 'code' => $e->getCode() + ); + return view('webpay-mall-deferred.capture', ["resp" => $resp, "request" => $req]); + } + return view('webpay-mall-deferred.capture', ["resp" => $resp, "request" => $req]); + } +} From 6aae6624c6be4f819e7d7f130d0ec38854a7b6ba Mon Sep 17 00:00:00 2001 From: victor mendoza Date: Thu, 1 Aug 2024 11:33:51 -0300 Subject: [PATCH 049/103] feat: create routes for webpay mall deferred --- routes/web.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/routes/web.php b/routes/web.php index 72c3c10..54bfa44 100644 --- a/routes/web.php +++ b/routes/web.php @@ -3,6 +3,7 @@ use App\Http\Controllers\WebpayController; use App\Http\Controllers\WebpayPlusMallController; use App\Http\Controllers\WebpayPlusDeferredController; +use App\Http\Controllers\WebpayPlusMallDeferredController; use Illuminate\Support\Facades\Route; @@ -32,3 +33,10 @@ Route::post('/refund', [WebpayPlusDeferredController::class, 'refund'])->name("refund"); Route::get('/status', [WebpayPlusDeferredController::class, 'status'])->name("status"); }); +Route::prefix('webpay-mall-diferido')->name("webpay-mall-deferred.")->group(function () { + Route::get('/create', [WebpayPlusMallDeferredController::class, 'create'])->name("create"); + Route::get('/commit', [WebpayPlusMallDeferredController::class, 'commit'])->name("commit"); + Route::post('/capture', [WebpayPlusMallDeferredController::class, 'capture'])->name("capture"); + Route::post('/refund', [WebpayPlusMallDeferredController::class, 'refund'])->name("refund"); + Route::get('/status', [WebpayPlusMallDeferredController::class, 'status'])->name("status"); +}); From e92e7361b3f882f6e727f4313e0817d0249236ce Mon Sep 17 00:00:00 2001 From: victor mendoza Date: Thu, 1 Aug 2024 11:34:12 -0300 Subject: [PATCH 050/103] fix: use correct links for webpay mall deferred --- resources/views/components/menu.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/components/menu.blade.php b/resources/views/components/menu.blade.php index aab4155..23cd535 100644 --- a/resources/views/components/menu.blade.php +++ b/resources/views/components/menu.blade.php @@ -5,7 +5,7 @@ 'Webpay Plus' => route('webpay.create'), 'Webpay Plus Diferido' => route('webpay-deferred.create'), 'Webpay Mall' => route('webpay-mall.create'), - 'Webpay Mall Diferido' => route('webpay.create'), + 'Webpay Mall Diferido' => route('webpay-mall-deferred.create'), ] as $menuItemName => $url) {{ $menuItemName }} From 8f43dc9a8a4732b73bb04d0b20370458d0bc5293 Mon Sep 17 00:00:00 2001 From: victor mendoza Date: Thu, 1 Aug 2024 11:35:09 -0300 Subject: [PATCH 051/103] feat: support for array whit arrays --- resources/views/components/table.blade.php | 40 ++++++++++++++++++---- 1 file changed, 34 insertions(+), 6 deletions(-) diff --git a/resources/views/components/table.blade.php b/resources/views/components/table.blade.php index a7ff801..99aebf9 100644 --- a/resources/views/components/table.blade.php +++ b/resources/views/components/table.blade.php @@ -8,17 +8,45 @@ @foreach ($request as $property => $value) -

    -
    {{ $value }}
    + @if (is_array($value)) + @foreach ($value as $detail) +
    + {{ $property }}[{{ $loop->index }}] +
    +
    + @foreach ($detail as $propertyKey => $valueKey) + {{ $propertyKey }}: {{ $valueKey }} + @endforeach +
    + @endforeach + @else +
    {{ $property }}
    +
    {{ $value }}
    + @endif @endforeach
    @foreach ($request as $property => $value) -
    -

    Campo: {{ $property }}

    -

    Valor: {{ $value }}

    -
    + @if (is_array($value)) + @foreach ($value as $detail) +
    +

    + Campo: {{ $property }}[{{ $loop->index }}] +

    +

    + @foreach ($detail as $propertyKey => $valueKey) + {{ $propertyKey }}: {{ $valueKey }} + @endforeach +

    +
    + @endforeach + @else +
    +

    Campo: {{ $property }}

    +

    Valor: {{ $value }}

    +
    + @endif @endforeach
    From 5eaf98194e3f4f72cbf9308822ac11046ec1e7c8 Mon Sep 17 00:00:00 2001 From: victor mendoza Date: Thu, 1 Aug 2024 11:35:57 -0300 Subject: [PATCH 052/103] fix: use correct titles --- resources/views/webpay-deferred/capture.blade.php | 6 ------ resources/views/webpay-deferred/refund.blade.php | 4 ++-- resources/views/webpay-deferred/status.blade.php | 4 ++-- resources/views/webpay-mall/refund.blade.php | 2 +- resources/views/webpay-mall/status.blade.php | 4 ++-- 5 files changed, 7 insertions(+), 13 deletions(-) diff --git a/resources/views/webpay-deferred/capture.blade.php b/resources/views/webpay-deferred/capture.blade.php index c38057f..25d5880 100644 --- a/resources/views/webpay-deferred/capture.blade.php +++ b/resources/views/webpay-deferred/capture.blade.php @@ -35,12 +35,6 @@ realizada.

    -

    - Por último, con la respuesta del servicio que confirma la creación de la transacción, procedemos - a crear el formulario de pago. Para fines de este ejemplo, haremos visible el campo "token_ws", el cual es - esencial para completar el proceso de pago de manera exitosa. -

    -
    @csrf
    diff --git a/resources/views/webpay-deferred/refund.blade.php b/resources/views/webpay-deferred/refund.blade.php index 8f1ab07..4ca88c2 100644 --- a/resources/views/webpay-deferred/refund.blade.php +++ b/resources/views/webpay-deferred/refund.blade.php @@ -2,9 +2,9 @@ $navigation = ['refund' => 'Reembolsar']; @endphp - + -

    Webpay Plus - Reembolsar

    +

    Webpay Plus Diferido - Reembolsar

    En esta etapa, tienes la opción de solicitar el reembolso del monto al titular de la tarjeta. Dependiendo del monto y el tiempo transcurrido desde la transacción, este proceso podría resultar en una Reversa, Anulación o Anulación Parcial. diff --git a/resources/views/webpay-deferred/status.blade.php b/resources/views/webpay-deferred/status.blade.php index b554b55..ffb2513 100644 --- a/resources/views/webpay-deferred/status.blade.php +++ b/resources/views/webpay-deferred/status.blade.php @@ -2,9 +2,9 @@ $navigation = ['state' => 'Consultar estado']; @endphp - + -

    Webpay Plus - Consultar estado de transacción

    +

    Webpay Plus Diferido- Consultar estado de transacción

    Puedes solicitar el estado de una transacción hasta 7 días después de su realización. No hay límite de solicitudes de este tipo durante ese período. Sin embargo, una vez pasados los 7 días, ya no podrás revisar su estado. diff --git a/resources/views/webpay-mall/refund.blade.php b/resources/views/webpay-mall/refund.blade.php index ce8afc9..3248b6a 100644 --- a/resources/views/webpay-mall/refund.blade.php +++ b/resources/views/webpay-mall/refund.blade.php @@ -3,7 +3,7 @@ @endphp -

    Webpay Plus - Reembolsar

    +

    Webpay Mall - Reembolsar

    En esta etapa, tienes la opción de solicitar el reembolso del monto al titular de la tarjeta. Dependiendo del monto y el tiempo transcurrido desde la transacción, este proceso podría resultar en una Reversa, Anulación o Anulación Parcial. diff --git a/resources/views/webpay-mall/status.blade.php b/resources/views/webpay-mall/status.blade.php index 1e68cbd..88745ec 100644 --- a/resources/views/webpay-mall/status.blade.php +++ b/resources/views/webpay-mall/status.blade.php @@ -2,9 +2,9 @@ $navigation = ['state' => 'Consultar estado']; @endphp - + -

    Webpay Plus - Consultar estado de transacción

    +

    Webpay Mall - Consultar estado de transacción

    Puedes solicitar el estado de una transacción hasta 7 días después de su realización. No hay límite de solicitudes de este tipo durante ese período. Sin embargo, una vez pasados los 7 días, ya no podrás revisar su estado. From 3f4db3e4de3bb3707e3f342b1d52a451c885687f Mon Sep 17 00:00:00 2001 From: victor mendoza Date: Thu, 1 Aug 2024 11:37:10 -0300 Subject: [PATCH 053/103] feat: add create view for webpay mall deferred --- .../webpay-mall-deferred/create.blade.php | 92 +++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 resources/views/webpay-mall-deferred/create.blade.php diff --git a/resources/views/webpay-mall-deferred/create.blade.php b/resources/views/webpay-mall-deferred/create.blade.php new file mode 100644 index 0000000..82be633 --- /dev/null +++ b/resources/views/webpay-mall-deferred/create.blade.php @@ -0,0 +1,92 @@ +@php + $navigation = ['create' => 'Crear transacción', 'example' => 'Ejemplo']; +@endphp + + +

    Webpay Mall Diferido - Creación de transacción Mall + +

    +

    + En esta etapa, se procederá a la creación de una transacción con el fin de obtener un identificador + único. Esto nos permitirá redirigir al Tarjetahabiente hacia el formulario de pago en el siguiente paso. + +

    + +

    Paso 1: Petición

    +
      +
    • Comienza por importar la librería WebpayPlus en tu proyecto.
    • +
    • Luego, crea una transacción utilizando las funciones proporcionadas mediante el SDK.
    • +
    +
    
    +use Transbank\Webpay\Options;
    +use Transbank\Webpay\WebpayPlus\MallTransaction;
    +//configuración de la transacción
    +$details = [
    +    [
    +        "amount" => 10000,
    +        "commerce_code" => 597055555536,
    +        "buy_order" => "ordenCompraDetalle1234"
    +    ],
    +    [
    +        "amount" => 12000,
    +        "commerce_code" => 597055555537,
    +        "buy_order" => "ordenCompraDetalle4321"
    +    ],
    +];
    +$option = new Options(API_KEY, COMMERCE_CODE, Options::ENVIRONMENT_INTEGRATION);
    +$mallTransaction = new mallTransaction($option);
    +$resp = $mallTransaction->create($buy_order, $session_id, $return_url,
    +$details);
    +    
    + + +

    Paso 2: Respuesta

    +

    + Una vez que hayas creado la transacción, aquí encontrarás los datos de respuesta generados por el + proceso. +

    + + + +

    Paso 3: Creación del formulario

    +

    + Utiliza estos datos de respuesta para generar y presentar un formulario de pago al Tarjetahabiente. + Este formulario será la interfaz a través de la cual el usuario realizará su transacción. +

    + + + form action="https://webpay3gint.transbank.cl/webpayserver/initTransaction" method="POST"> + input type="hidden" name="token_ws" value="{{ $resp->token }}" /> + input type="submit" value="Pagar" /> + form> + + +

    Ejemplo

    +

    + Para llevar a cabo una transacción de compra en nuestro sistema, primero debemos crear la + transacción. Utilizaremos los siguientes datos para configurar la transacción: +

    + +
    + +
    + +

    + Por último, con la respuesta del servicio que confirma la creación de la transacción, procedemos + a crear el formulario de pago. Para fines de este ejemplo, haremos visible el campo "token_ws", el cual es + esencial para completar el proceso de pago de manera exitosa. +

    + + url }} action="POST"> +
    + Formulario de redirección +
    + + token }} required> +
    + +
    + +
    From 71255b5270658960c9e813240427f7d9f93242a0 Mon Sep 17 00:00:00 2001 From: victor mendoza Date: Thu, 1 Aug 2024 11:37:24 -0300 Subject: [PATCH 054/103] feat: add commit view for webpay mall deferred --- .../webpay-mall-deferred/commit.blade.php | 88 +++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 resources/views/webpay-mall-deferred/commit.blade.php diff --git a/resources/views/webpay-mall-deferred/commit.blade.php b/resources/views/webpay-mall-deferred/commit.blade.php new file mode 100644 index 0000000..4540283 --- /dev/null +++ b/resources/views/webpay-mall-deferred/commit.blade.php @@ -0,0 +1,88 @@ +@php + $navigation = ['confirm' => 'Confirmar transacción', 'other' => 'Otras operaciones']; +@endphp + + + +

    Webpay Mall diferido - Confirmar transacción

    +

    En este paso es importante confirmar la transacción para notificar a Transbank que hemos recibido + exitosamente los detalles de la transacción. Es importante destacar que si la confirmación no se realiza, la + transacción será reversada. +

    + +

    Paso 1 - Datos recibidos:

    +
      +

      + Después de completar el flujo en el formulario de pago, recibirás un GET con la siguiente + información: +

      +
    + (returnUrl)?token_ws={{ $token }} + +

    Paso 2 - Petición:

    +

    + Utilizarás el token recibido para confirmar la transacción mediante el SDK. +

    + + + $resp = $mallTransaction->commit($token); + + +

    Paso 3 - Respuesta:

    +

    + Transbank responderá con la siguiente información. Es crucial guardar esta respuesta, y la única + validación necesaria es que el campo "response_code" sea igual a cero. +

    + + + + +

    ¡Listo!

    +

    + Es importante tener en cuenta que la transacción aún no ha sido capturada, por lo que hay que dejarle saber al + tarjetahabiente que necesita un paso más; solo se ha retenido el saldo en su tarjeta. Después de confirmar la + transacción, puedes: +

    + +
      +
    • + Capturar la transacción. +
    • +
    • + Revertir la transacción si es necesario. +
    • +
    • + Consultar el estado de la transacción hasta 7 días después de realizada. +
    • +
    + +

    + Capturar la transacción para realmente capturar el dinero que habia sido previamente + reservado. +

    + + @foreach ($resp->details as $detail) +
    + @csrf +
    +
    + + amount }}> + commerceCode }}> + authorizationCode }}> + + buyOrder }}> + +
    + +
    +
    + @endforeach +
    $token]) }} class="tbk-button primary mb-32"> + CONSULTAR ESTADO + + From 36ef7b87075d59520ded3cf73aff59ffaef0aaa9 Mon Sep 17 00:00:00 2001 From: victor mendoza Date: Thu, 1 Aug 2024 11:37:34 -0300 Subject: [PATCH 055/103] feat: add capture view for webpay mall deferred --- .../webpay-mall-deferred/capture.blade.php | 58 +++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 resources/views/webpay-mall-deferred/capture.blade.php diff --git a/resources/views/webpay-mall-deferred/capture.blade.php b/resources/views/webpay-mall-deferred/capture.blade.php new file mode 100644 index 0000000..8efc864 --- /dev/null +++ b/resources/views/webpay-mall-deferred/capture.blade.php @@ -0,0 +1,58 @@ +@php + $navigation = ['confirm' => 'Confirmar transacción', 'other' => 'Otras operaciones']; +@endphp + + + +

    Webpay Mall diferido - capturar transacción

    +

    En este paso debemos capturar la transacción para realmente capturar el dinero que habia sido + previamente + reservado al hacer la transacción +

    + +

    Paso 1: Petición

    +

    + Para capturar una transacción necesitaremos el Token, Orden de compra, Código de autorización y monto a + capturar. Se hace de la siguiente manera. +

    + + $resp = $mallTransaction->capture($childCommerceCode $token, $buyOrder, $authorizationCode, $amount); + + +

    Paso 2: Respuesta

    +

    + Transbank contestará con lo siguiente. Debes guardar esta información, lo único que debes validar + es que response_code sea igual a cero. +

    + + + +

    Otras utilidades

    + +

    + Luego de capturada la transacción puedes Reembolsar (reversar o anular) el pago dependiendo de + ciertas condiciones comerciales. También puedes consultar el estado de la transacción hasta 7 días después de + realizada. +

    + +
    + @csrf +
    +
    + + capturedAmount }}> + + + +
    + +
    +
    + + $request['token']]) }} + class="tbk-button primary mb-32">CONSULTAR + ESTADO +
    From 9877517da86657d470d0b156663390a684d14e28 Mon Sep 17 00:00:00 2001 From: victor mendoza Date: Thu, 1 Aug 2024 11:37:41 -0300 Subject: [PATCH 056/103] feat: add refund view for webpay mall deferred --- .../webpay-mall-deferred/refund.blade.php | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 resources/views/webpay-mall-deferred/refund.blade.php diff --git a/resources/views/webpay-mall-deferred/refund.blade.php b/resources/views/webpay-mall-deferred/refund.blade.php new file mode 100644 index 0000000..801caad --- /dev/null +++ b/resources/views/webpay-mall-deferred/refund.blade.php @@ -0,0 +1,46 @@ +@php + $navigation = ['refund' => 'Reembolsar']; +@endphp + + +

    Webpay Mall Diferido - Reembolsar

    +

    En esta etapa, tienes la opción de solicitar el reembolso del monto al titular de la tarjeta. + Dependiendo del monto y el tiempo transcurrido desde la transacción, este proceso podría resultar en una + Reversa, Anulación o Anulación Parcial. + +

    + +

    Paso 1 - Petición:

    +

    + Para llevar a cabo el reembolso, necesitas proporcionar el token de la transacción, el monto que + quieres reversar, el código de comercio de la tienda hijo y el orden de compra del detalle de la transacción. Si + anulas el monto total, podría ser una Reversa o Anulación, dependiendo de ciertas condiciones, o una Anulación + Parcial si el monto es menor al total. +

    + +

    Algunas consideraciones a tener en cuenta

    +
      +
    • + No es posible realizar Anulaciones ni Anulaciones Parciales en tarjetas que no sean de crédito. +
    • +
    • + No es posible realizar Anulaciones Parciales en pagos con cuotas. +
    • +
    • No se admiten reembolsos de compras en cuotas.
    • +
    + +

    En este link + podrás ver + mayor información sobre las condiciones y casos para anular o reversar transacciones.

    + + $resp = $mallTransaction->refund($token, $buyOrder, $childComerceCode, + $amount); + + +

    Paso 2: Respuesta

    +

    Transbank responderá con el resultado del proceso de reembolso, indicando si se ha realizado una + Reversa, Anulación o Anulación Parcial. +

    + + +
    From 0f507dd153c316187a37e100239343a16107d21a Mon Sep 17 00:00:00 2001 From: victor mendoza Date: Thu, 1 Aug 2024 11:37:51 -0300 Subject: [PATCH 057/103] feat: add status view for webpay mall deferred --- .../webpay-mall-deferred/status.blade.php | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 resources/views/webpay-mall-deferred/status.blade.php diff --git a/resources/views/webpay-mall-deferred/status.blade.php b/resources/views/webpay-mall-deferred/status.blade.php new file mode 100644 index 0000000..06d55c4 --- /dev/null +++ b/resources/views/webpay-mall-deferred/status.blade.php @@ -0,0 +1,30 @@ +@php + $navigation = ['state' => 'Consultar estado']; +@endphp + + + +

    Webpay Mall Diferido- Consultar estado de transacción

    +

    Puedes solicitar el estado de una transacción hasta 7 días después de su realización. No hay límite + de solicitudes de este tipo durante ese período. Sin embargo, una vez pasados los 7 días, ya no podrás revisar + su estado. +

    + +

    Paso 1 - Petición:

    +

    + Para realizar la consulta, necesitas el token de la transacción de la cual deseas obtener el estado. Utiliza + este token para realizar una llamada a WebpayPlus.Transaction. +

    + + $resp = $mallTransaction->status($token); + + +

    Paso 2: Respuesta

    +

    + Transbank responderá con la siguiente información. Asegúrate de guardar esta respuesta, y la única validación + necesaria es que el campo "response_code" sea igual a cero. +

    + + + +
    From 6082d66281c1562e9c31300fdf4d5821a31b447e Mon Sep 17 00:00:00 2001 From: victor mendoza Date: Thu, 1 Aug 2024 13:06:00 -0300 Subject: [PATCH 058/103] fix: typo --- app/Http/Controllers/WebpayPlusMallController.php | 2 +- app/Http/Controllers/WebpayPlusMallDeferredController.php | 6 +++--- resources/views/webpay-mall-deferred/capture.blade.php | 4 ++-- resources/views/webpay-mall-deferred/commit.blade.php | 2 +- resources/views/webpay-mall-deferred/refund.blade.php | 2 +- resources/views/webpay-mall-deferred/status.blade.php | 2 +- resources/views/webpay-mall/commit.blade.php | 2 +- resources/views/webpay-mall/refund.blade.php | 2 +- resources/views/webpay-mall/status.blade.php | 2 +- 9 files changed, 12 insertions(+), 12 deletions(-) diff --git a/app/Http/Controllers/WebpayPlusMallController.php b/app/Http/Controllers/WebpayPlusMallController.php index bf77075..9256f34 100644 --- a/app/Http/Controllers/WebpayPlusMallController.php +++ b/app/Http/Controllers/WebpayPlusMallController.php @@ -82,7 +82,7 @@ public function refund(Request $request) { try { $req = $request->except('_token'); - $resp = $this->mallTransaction->refund($req["token"], $req["buyOrder"], $req["childComerceCode"], $req["amount"]); + $resp = $this->mallTransaction->refund($req["token"], $req["buyOrder"], $req["childCommerceCode"], $req["amount"]); } catch (\Exception $e) { $resp = array( 'msg' => $e->getMessage(), diff --git a/app/Http/Controllers/WebpayPlusMallDeferredController.php b/app/Http/Controllers/WebpayPlusMallDeferredController.php index c004a5a..ce5f71a 100644 --- a/app/Http/Controllers/WebpayPlusMallDeferredController.php +++ b/app/Http/Controllers/WebpayPlusMallDeferredController.php @@ -57,7 +57,7 @@ public function commit(Request $request) if ($request->exists("TBK_TOKEN") && $request->exists("token_ws")) { $view = 'webpay-mall-deferred.error'; } - //Pago abortadoas + //Pago abortados elseif ($request->exists("TBK_TOKEN")) { $view = 'webpay-mall-deferred.error'; } @@ -83,7 +83,7 @@ public function refund(Request $request) { try { $req = $request->except('_token'); - $resp = $this->mallTransaction->refund($req["token"], $req["buyOrder"], $req["childComerceCode"], $req["amount"]); + $resp = $this->mallTransaction->refund($req["token"], $req["buyOrder"], $req["childCommerceCode"], $req["amount"]); } catch (\Exception $e) { $resp = array( 'msg' => $e->getMessage(), @@ -98,7 +98,7 @@ public function capture(Request $request) { try { $req = $request->except('_token'); - $resp = $this->mallTransaction->capture($req["childComerceCode"], $req["token"], $req["buyOrder"], $req["authorizationCode"], $req["amount"]); + $resp = $this->mallTransaction->capture($req["childCommerceCode"], $req["token"], $req["buyOrder"], $req["authorizationCode"], $req["amount"]); } catch (\Exception $e) { $resp = array( 'msg' => $e->getMessage(), diff --git a/resources/views/webpay-mall-deferred/capture.blade.php b/resources/views/webpay-mall-deferred/capture.blade.php index 8efc864..2fca9a6 100644 --- a/resources/views/webpay-mall-deferred/capture.blade.php +++ b/resources/views/webpay-mall-deferred/capture.blade.php @@ -41,8 +41,8 @@
    capturedAmount }}> - +
    diff --git a/resources/views/webpay-mall-deferred/commit.blade.php b/resources/views/webpay-mall-deferred/commit.blade.php index 4540283..5517842 100644 --- a/resources/views/webpay-mall-deferred/commit.blade.php +++ b/resources/views/webpay-mall-deferred/commit.blade.php @@ -68,7 +68,7 @@
    amount }}> - commerceCode }}> authorizationCode }}> diff --git a/resources/views/webpay-mall-deferred/refund.blade.php b/resources/views/webpay-mall-deferred/refund.blade.php index 801caad..748aa2c 100644 --- a/resources/views/webpay-mall-deferred/refund.blade.php +++ b/resources/views/webpay-mall-deferred/refund.blade.php @@ -33,7 +33,7 @@ podrás ver mayor información sobre las condiciones y casos para anular o reversar transacciones.

    - $resp = $mallTransaction->refund($token, $buyOrder, $childComerceCode, + $resp = $mallTransaction->refund($token, $buyOrder, $childCommerceCode, $amount); diff --git a/resources/views/webpay-mall-deferred/status.blade.php b/resources/views/webpay-mall-deferred/status.blade.php index 06d55c4..9b00646 100644 --- a/resources/views/webpay-mall-deferred/status.blade.php +++ b/resources/views/webpay-mall-deferred/status.blade.php @@ -13,7 +13,7 @@

    Paso 1 - Petición:

    Para realizar la consulta, necesitas el token de la transacción de la cual deseas obtener el estado. Utiliza - este token para realizar una llamada a WebpayPlus.Transaction. + este token para realizar una llamada a WebpayPlus.MallTransaction.

    $resp = $mallTransaction->status($token); diff --git a/resources/views/webpay-mall/commit.blade.php b/resources/views/webpay-mall/commit.blade.php index 83163b1..1d9a486 100644 --- a/resources/views/webpay-mall/commit.blade.php +++ b/resources/views/webpay-mall/commit.blade.php @@ -64,7 +64,7 @@
    amount }}> - commerceCode }}> buyOrder }}> diff --git a/resources/views/webpay-mall/refund.blade.php b/resources/views/webpay-mall/refund.blade.php index 3248b6a..beb0e33 100644 --- a/resources/views/webpay-mall/refund.blade.php +++ b/resources/views/webpay-mall/refund.blade.php @@ -33,7 +33,7 @@ podrás ver mayor información sobre las condiciones y casos para anular o reversar transacciones.

    - $resp = $mallTransaction->refund($token, $buyOrder, $childComerceCode, + $resp = $mallTransaction->refund($token, $buyOrder, $childCommerceCode, $amount); diff --git a/resources/views/webpay-mall/status.blade.php b/resources/views/webpay-mall/status.blade.php index 88745ec..7c4d536 100644 --- a/resources/views/webpay-mall/status.blade.php +++ b/resources/views/webpay-mall/status.blade.php @@ -13,7 +13,7 @@

    Paso 1 - Petición:

    Para realizar la consulta, necesitas el token de la transacción de la cual deseas obtener el estado. Utiliza - este token para realizar una llamada a WebpayPlus.Transaction. + este token para realizar una llamada a WebpayPlus.MallTransaction.

    $resp = $mallTransaction->status($token); From e355c9ab4c493cdce0f2575d54350053bfad825f Mon Sep 17 00:00:00 2001 From: victor mendoza Date: Thu, 1 Aug 2024 18:58:31 -0300 Subject: [PATCH 059/103] fix: remove casting --- app/Http/Controllers/WebpayController.php | 2 +- app/Http/Controllers/WebpayPlusDeferredController.php | 2 +- app/Http/Controllers/WebpayPlusMallController.php | 2 +- app/Http/Controllers/WebpayPlusMallDeferredController.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/Http/Controllers/WebpayController.php b/app/Http/Controllers/WebpayController.php index a968736..cd1a79d 100644 --- a/app/Http/Controllers/WebpayController.php +++ b/app/Http/Controllers/WebpayController.php @@ -25,7 +25,7 @@ public function create() $createTx = [ 'buyOrder' => "O-" . rand(1, 10000), - "sessionId" => "S-" . (string)(rand(1, 10000)), + "sessionId" => "S-" . rand(1, 10000), 'returnUrl' => url('/') . '/webpay-plus/commit', 'amount' => rand(1000, 2000) ]; diff --git a/app/Http/Controllers/WebpayPlusDeferredController.php b/app/Http/Controllers/WebpayPlusDeferredController.php index 62ca70d..8586d60 100644 --- a/app/Http/Controllers/WebpayPlusDeferredController.php +++ b/app/Http/Controllers/WebpayPlusDeferredController.php @@ -23,7 +23,7 @@ public function create() $createTx = [ 'buyOrder' => "O-" . rand(1, 10000), - "sessionId" => "S-" . (string)(rand(1, 10000)), + "sessionId" => "S-" . rand(1, 10000), 'returnUrl' => url('/') . '/webpay-plus-diferido/commit', 'amount' => rand(1000, 2000) ]; diff --git a/app/Http/Controllers/WebpayPlusMallController.php b/app/Http/Controllers/WebpayPlusMallController.php index 9256f34..4234d20 100644 --- a/app/Http/Controllers/WebpayPlusMallController.php +++ b/app/Http/Controllers/WebpayPlusMallController.php @@ -22,7 +22,7 @@ public function create() $createTx = [ "buy_order" => "O-" . rand(1, 10000), - "session_id" => "S-" . (string)(rand(1, 10000)), + "session_id" => "S-" . rand(1, 10000), "return_url" => url("/") . "/webpay-mall/commit", "details" => [ [ diff --git a/app/Http/Controllers/WebpayPlusMallDeferredController.php b/app/Http/Controllers/WebpayPlusMallDeferredController.php index ce5f71a..931d160 100644 --- a/app/Http/Controllers/WebpayPlusMallDeferredController.php +++ b/app/Http/Controllers/WebpayPlusMallDeferredController.php @@ -22,7 +22,7 @@ public function create() $createTx = [ 'buy_order' => "O-" . rand(1, 10000), - "session_id" => "S-" . (string)(rand(1, 10000)), + "session_id" => "S-" . rand(1, 10000), 'return_url' => url('/') . '/webpay-mall-diferido/commit', 'details' => [ [ From 784d28b763ed1b9ef4cf87404129fc13f019e906 Mon Sep 17 00:00:00 2001 From: victor mendoza Date: Thu, 22 Aug 2024 14:20:48 -0300 Subject: [PATCH 060/103] feat: create error page --- resources/views/error-page.blade.php | 44 ++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 resources/views/error-page.blade.php diff --git a/resources/views/error-page.blade.php b/resources/views/error-page.blade.php new file mode 100644 index 0000000..dc3f7f3 --- /dev/null +++ b/resources/views/error-page.blade.php @@ -0,0 +1,44 @@ + + + + + + + Transbank Developers + @vite(['resources/css/app.css', 'resources/js/app.js']) + + + +
    + @include('partials.header') + +
    + + +

    ¡Ha ocurrido un error!

    + +

    Lo sentimos, pero se ha producido un error durante la integración con el SDK. El SDK + devuelve errores + de + tipo + "TransbankError". Si estás viendo otro tipo de error, es posible que el proyecto de ejemplo tenga + algún + problema. + +

    +

    Si este error persiste y crees que es necesario reportarlo, por favor, hazlo en nuestro + repositorio + de + GitHub. +

    + + + + Volver +
    + @include('partials.footer') +
    + @stack('scripts') + + + From 7d048031e222f13cbb2fbe67bfd58342290e6772 Mon Sep 17 00:00:00 2001 From: victor mendoza Date: Thu, 22 Aug 2024 14:21:18 -0300 Subject: [PATCH 061/103] feat: create delete page for oneclick --- .../views/oneclick-mall/delete.blade.php | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 resources/views/oneclick-mall/delete.blade.php diff --git a/resources/views/oneclick-mall/delete.blade.php b/resources/views/oneclick-mall/delete.blade.php new file mode 100644 index 0000000..0a1cb25 --- /dev/null +++ b/resources/views/oneclick-mall/delete.blade.php @@ -0,0 +1,39 @@ +@php + $navigation = ['delete' => 'Borrar usuario']; +@endphp + + +

    Oneclick Mall - Borrar usuario

    +

    + En este paso fundamental, procederemos a eliminar la inscripción del usuario y su medio de pago. +

    + +

    Paso 1: Petición

    +

    + Para llevar a cabo la eliminación, necesitas el "userName" (Nombre de Usuario) y el "tbkUser". Realiza la + llamada a Oneclick.MallInscription utilizando el siguiente código: +

    + + $resp = $mallInscription->delete($tbkUser, $userName); + + +

    Paso 2: Respuesta

    +

    + En caso de éxito, Transbank responderá con un status code 204 (No Content), y el SDK no retornará ninguna + respuesta adicional. La eliminación de la inscripción se ha realizado de manera exitosa. +

    + +

    + En el caso de que no se encuentre el "userName" o el "tbkUser", Transbank responderá con un status code 404 (Not + Found), y el SDK retornará una excepción para informar sobre la situación. +

    + +

    + Este proceso garantiza una eliminación segura y eficiente de la inscripción del usuario y su medio de pago + asociado. ¡Gracias por confiar en Transbank para tus operaciones seguras! Si tienes alguna pregunta, estamos + aquí para ayudarte +

    + + + +
    From 17aa158ed67eddbc17969f45845b4768dc8e7b8e Mon Sep 17 00:00:00 2001 From: victor mendoza Date: Thu, 22 Aug 2024 16:58:28 -0300 Subject: [PATCH 062/103] feat: create oneclikmallcontroller --- .../Controllers/OneclickMallController.php | 132 ++++++++++++++++++ 1 file changed, 132 insertions(+) create mode 100644 app/Http/Controllers/OneclickMallController.php diff --git a/app/Http/Controllers/OneclickMallController.php b/app/Http/Controllers/OneclickMallController.php new file mode 100644 index 0000000..0511271 --- /dev/null +++ b/app/Http/Controllers/OneclickMallController.php @@ -0,0 +1,132 @@ +mallInscription = new MallInscription($option); + $this->mallTransaction = new MallTransaction($option); + } + + public function startInscription() + { + $startTx = [ + "username" => "User-" . random_int(1, 10000), + "email" => "user." . random_int(1, 10000) . "@example.cl", + "response_url" => url("/") . "/oneclick-mall/finish" + ]; + + session(['username' => $startTx["username"]]); + $resp = $this->mallInscription->start($startTx["username"], $startTx["email"], $startTx["response_url"]); + return view('oneclick-mall.start', ["request" => $startTx, "resp" => $resp]); + } + + public function finishInscription(Request $request) + { + try { + //flujo error + if ($request->exists("TBK_ORDEN_COMPRA")) { + return view('error-page'); + } + + $token = $request["TBK_TOKEN"]; + $userName = session('username', ''); + $resp = $this->mallInscription->finish($token); + + + if ($resp->responseCode == -1) { + return view('oneclick-mall.rejected', ["resp" => $resp, "token" => $token]); + } + + if ($resp->responseCode == -96) { + return view('oneclick-mall.timeout', ["resp" => $resp]); + } + + $table = [ + "username" => $userName, + "tbk_user" => $resp->tbkUser, + ]; + return view('oneclick-mall.finish', ["resp" => $resp, "token" => $token, "table" => $table]); + } catch (\Exception $e) { + $error = ["msg" => $e->getMessage(), "code" => $e->getCode()]; + return view('error-page', ["error" => $error]); + } + } + public function deleteInscription(Request $request) + { + try { + $tbkUser = $request["tbkUser"]; + $userName = $request["userName"]; + $resp = $this->mallInscription->delete($tbkUser, $userName); + return view('oneclick-mall.delete', ["resp" => $resp]); + } catch (\Exception $e) { + $error = ["msg" => $e->getMessage(), "code" => $e->getCode()]; + return view('error-page', ["error" => $error]); + } + } + + public function authorizeMall(Request $request) + { + try { + $tbkUser = $request["tbkUser"]; + $userName = $request["userName"]; + $buyOrder = "O-" . random_int(1000, 9999); + $details = [ + [ + "commerce_code" => "597055555542", + "buy_order" => "O1-" . random_int(1000, 9999), + "amount" => 1693, + "installments_number" => 1 + ], + [ + "commerce_code" => "597055555543", + "buy_order" => "O2-" . random_int(1000, 9999), + "amount" => 1960, + "installments_number" => 1 + ] + ]; + + $resp = $this->mallTransaction->authorize($userName, $tbkUser, $buyOrder, $details); + return view('oneclick-mall.authorize', ["resp" => $resp]); + } catch (\Exception $e) { + $error = ["msg" => $e->getMessage(), "code" => $e->getCode()]; + return view('error-page', ["error" => $error]); + } + } + + public function status(Request $request) + { + $buyOrder = $request["buyOrder"]; + + $resp = $this->mallTransaction->status($buyOrder); + + return view('oneclick-mall.status', ["resp" => $resp]); + } + + public function refund(Request $request) + { + $req = $request->except('_token'); + $buyOrder = $req["buyOrder"]; + $childCommerceCode = $req["childCommerceCode"]; + $childBuyOrder = $req["childBuyOrder"]; + $amount = $req["amount"]; + + $resp = $this->mallTransaction->refund($buyOrder, $childCommerceCode, $childBuyOrder, $amount); + + return view('oneclick-mall.refund', ["resp" => $resp]); + } +} From 3d72d41bd73bfe6c57384efc5fa8d8f07860d8c9 Mon Sep 17 00:00:00 2001 From: victor mendoza Date: Thu, 22 Aug 2024 16:59:03 -0300 Subject: [PATCH 063/103] feat: add css for multile line fields in card --- resources/css/app.css | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/resources/css/app.css b/resources/css/app.css index 6f0b0fb..7779d99 100644 --- a/resources/css/app.css +++ b/resources/css/app.css @@ -203,6 +203,9 @@ code { .mb-32 { margin-bottom: 32px; } +.mb-16 { + margin-bottom: 16px; +} .tbk-link { color: var(--tbk-red); @@ -658,12 +661,17 @@ code { line-height: 24px; letter-spacing: 0.25px; } +/* Error page */ +.layout-error { + margin: 80px 156px; +} /* homepage */ .layout-home { display: grid; grid-template-rows: auto 1fr auto; + height: 100vh; } .tbk-home-container { @@ -757,6 +765,24 @@ code { background-color: var(--tbk-grey-4); } } +.card-multi-field { + display: grid; + grid-template-columns: 1fr 1fr; + gap: 32px; +} + +.divided-card { + display: grid; + grid-template-columns: 1fr 1fr; + gap: 24px; +} + +.card-right-container { + display: flex; + flex-direction: column; + align-items: end; + gap: 16px; +} @media (max-width: 1439.98px) { .body-container { @@ -767,6 +793,12 @@ code { } } +@media (max-width: 1023.98px) { + .card-multi-field { + grid-template-columns: 1fr; + } +} + @media (max-width: 576px) { .tbk-table { display: none; From f6b550a44e7261d30af7f525ed34a90d5d2e1890 Mon Sep 17 00:00:00 2001 From: victor mendoza Date: Thu, 22 Aug 2024 16:59:31 -0300 Subject: [PATCH 064/103] refactor: use correct url dor oneclick mall --- resources/views/home.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/home.blade.php b/resources/views/home.blade.php index 2d9e624..46d80ff 100644 --- a/resources/views/home.blade.php +++ b/resources/views/home.blade.php @@ -52,7 +52,7 @@ class="card-info-image" /> para el tarjetahabiente, una vez que este haya registrado su tarjeta en el comercio.

    - + Ver ejemplos y modalidades
    From 4c56233e7d044eb67d07bbe7e984ff2fbd05af22 Mon Sep 17 00:00:00 2001 From: victor mendoza Date: Thu, 22 Aug 2024 17:00:40 -0300 Subject: [PATCH 065/103] refactor: use correct url for oneclick in menu --- resources/views/components/menu.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/components/menu.blade.php b/resources/views/components/menu.blade.php index 23cd535..0f6256f 100644 --- a/resources/views/components/menu.blade.php +++ b/resources/views/components/menu.blade.php @@ -16,7 +16,7 @@
    Webpay Oneclick @foreach ([ - 'Oneclick Mall' => route('webpay.create'), + 'Oneclick Mall' => route('oneclick-mall.start'), 'Oneclick Mall Diferido' => route('webpay.create'), ] as $menuItemName => $url) From caea63fbe45bf972ec985f3631b86b2510137b1a Mon Sep 17 00:00:00 2001 From: victor mendoza Date: Thu, 22 Aug 2024 17:00:55 -0300 Subject: [PATCH 066/103] feat: create authorize page for oneclick mall --- .../views/oneclick-mall/authorize.blade.php | 98 +++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 resources/views/oneclick-mall/authorize.blade.php diff --git a/resources/views/oneclick-mall/authorize.blade.php b/resources/views/oneclick-mall/authorize.blade.php new file mode 100644 index 0000000..149b37d --- /dev/null +++ b/resources/views/oneclick-mall/authorize.blade.php @@ -0,0 +1,98 @@ +@php + $navigation = ['auth' => 'Autorizar pago', 'other' => 'Consultas']; +@endphp + + +

    Oneclick Mall - Autorizar pago

    +

    + En este primer paso, procederemos a autorizar una transacción en la tarjeta que ha sido previamente inscrita. +

    + +

    Paso 1: Peticion

    +

    + Ahora que contamos con el "username" y el "tbk_user" obtenidos durante la inscripción, estamos listos para + autorizar transacciones en la tarjeta inscrita. +

    + + $details = [ + -[ + ---"child_commerce_code", + ---"child_buy_order", + ---"amount", + ---"installments_number" + -], + -[ + ---"child_commerce_code2", + ---"child_buy_order2", + ---"amount", + ---"installments_number", + -] + ]; + + $resp = $mallTransaction->authorize($userName, $tbkUser, $buyOrder, $details); + + +

    Paso 2: Respuesta

    +

    + Una vez que la transacción ha sido autorizada, recibirás los siguientes datos de respuesta: +

    + + + +

    ¡Listo!

    +

    + Con la autorización exitosa, puedes mostrar al usuario una página de éxito de la transacción, proporcionándole + la confirmación de que el proceso se ha completado con éxito. +

    + +

    Otras utilidades

    +

    Con la inscripción exitosa se pueden autorizar transacciones.

    + +

    Autorizar una transacción

    +

    + Después de autorizar la transacción, considera las siguientes utilidades adicionales: +

    +
      +
    • + Reembolsar: Puedes reversar o anular el pago según ciertas condiciones + comerciales. +
    • +
    • + Consultar Estado: Hasta 7 días después de la transacción, podrás consultar el + estado de la transacción. +
    • +
    + + @foreach ($resp->details as $detail) +
    + @csrf +
    +
    +
    + + buyOrder }}> +
    +
    + + commerceCode }}> +
    +
    + + buyOrder }}> +
    +
    + + amount }}> +
    +
    + +
    +
    + @endforeach +
    $resp->buyOrder]) }} + class="tbk-button primary mb-32">CONSULTAR ESTADO + + From 49a3c464eaf6e10c04ccc1728a1e87681495d7ba Mon Sep 17 00:00:00 2001 From: victor mendoza Date: Thu, 22 Aug 2024 17:01:02 -0300 Subject: [PATCH 067/103] feat: create finish page for oneclick mall --- .../views/oneclick-mall/finish.blade.php | 62 +++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 resources/views/oneclick-mall/finish.blade.php diff --git a/resources/views/oneclick-mall/finish.blade.php b/resources/views/oneclick-mall/finish.blade.php new file mode 100644 index 0000000..c0ae6e8 --- /dev/null +++ b/resources/views/oneclick-mall/finish.blade.php @@ -0,0 +1,62 @@ +@php + $navigation = ['finish' => 'Finalizar inscripción', 'authorize' => 'Autorizar una transacción']; +@endphp + + +

    Oneclick Mall - Finalizar inscripción

    +

    + En esta fase, completaremos el proceso de inscripción, permitiéndonos posteriormente realizar cargos a la + tarjeta que el tarjetahabiente haya inscrito. +

    + +

    Paso 1: Datos recibidos

    +

    + Después de finalizar el flujo en el formulario de inscripción, recibirás un GET con la siguiente información: +

    + + +

    Paso 2: Petición de autorización

    +

    + Utiliza el token recibido para finalizar la Inscripción mediante una nueva llamada a Oneclick. +

    + + + $resp = $mallInscription->finish($token); + + +

    Paso 3: Respuesta

    +

    + Transbank responderá con información crucial. Guarda estos detalles, ya que serán necesarios para autorizar + transacciones futuras. +

    + + + +

    ¡La tarjeta ya está inscrita!

    +

    Con la inscripción exitosa se pueden autorizar transacciones.

    + +

    Autorizar una transacción

    +

    + Asegúrate de guardar los datos de la respuesta obtenidos durante la inscripción. Estos serán esenciales para + llevar a cabo transacciones de manera efectiva. +

    + + + +
    + + +
    + +
    From d1c2c567d996c9580b88e3005a21bf39a7d2e152 Mon Sep 17 00:00:00 2001 From: victor mendoza Date: Thu, 22 Aug 2024 17:01:08 -0300 Subject: [PATCH 068/103] feat: create refund page for oneclick mall --- .../views/oneclick-mall/refund.blade.php | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 resources/views/oneclick-mall/refund.blade.php diff --git a/resources/views/oneclick-mall/refund.blade.php b/resources/views/oneclick-mall/refund.blade.php new file mode 100644 index 0000000..9362801 --- /dev/null +++ b/resources/views/oneclick-mall/refund.blade.php @@ -0,0 +1,44 @@ +@php + $navigation = ['refund' => 'Reembolsar']; +@endphp + + + +

    Oneclick Mall - Reembolsar

    +

    En esta etapa, tienes la opción de solicitar el reembolso del monto al titular de la tarjeta. + Dependiendo del monto y el tiempo transcurrido desde la transacción, este proceso podría resultar en una + Reversa, Anulación o Anulación Parcial. +

    + +

    Paso 1 - Petición:

    +

    + Para realizar el reembolso, necesitarás la siguiente información: +

    + +
      +
    • Orden de compra de la transacción.
    • +
    • Monto que deseas reversar.
    • +
    • Código de comercio de la tienda hijo.
    • +
    • Orden de compra del detalle de la transacción.
    • +
    + +

    + Ten en cuenta que si anulas el monto total, puede ser una Reversa o Anulación, dependiendo de ciertas + condiciones, o una Anulación parcial si el monto es menor al total. No es posible realizar Anulaciones ni + Anulaciones parciales en tarjetas que no sean de crédito. Tampoco es posible realizar reembolsos de compras en + cuotas. +

    + + + $resp = $mallTransaction->refund($buyOrder, $childCommerceCode, $childBuyOrder, $amount); + + +

    Paso 2 - Respuesta:

    +

    + Transbank responderá con el resultado de la reversa o anulación. Analiza esta respuesta para confirmar que el + reembolso se ha procesado correctamente. +

    + + + +
    From c10737630cc6a87f2da44845ca9c25dfd8f034d7 Mon Sep 17 00:00:00 2001 From: victor mendoza Date: Thu, 22 Aug 2024 17:01:36 -0300 Subject: [PATCH 069/103] feat: create error rejected page for oneclick mall --- .../views/oneclick-mall/rejected.blade.php | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 resources/views/oneclick-mall/rejected.blade.php diff --git a/resources/views/oneclick-mall/rejected.blade.php b/resources/views/oneclick-mall/rejected.blade.php new file mode 100644 index 0000000..0ab4c43 --- /dev/null +++ b/resources/views/oneclick-mall/rejected.blade.php @@ -0,0 +1,37 @@ +@php + $navigation = ['rejected' => 'Rechazo Bancario', 'example' => 'Ejemplo']; +@endphp + + +

    Oneclick Mall - Rechazo Bancario

    +

    + En esta fase, pueden surgir inconvenientes, ya sea con el titular de la tarjeta o a nivel bancario, lo que + resulta en el estado final de la transacción siendo marcado como "FAILED". +

    + +

    Paso 1: Datos recibidos

    +

    + Después de finalizar el flujo en el formulario de inscripción, recibirás un GET con la siguiente información: +

    + + +

    Paso 2: Petición de autorización

    +

    + Utiliza el token recibido para finalizar la Inscripción mediante una nueva llamada a Oneclick. +

    + + + $resp = $mallInscription->finish($token); + + +

    Paso 3: Respuesta

    +

    + Transbank responderá con la siguiente información. +

    + + + + +

    En este caso la inscripción fue rechaza, tendras que repetir el proceso

    + +
    From 491dc33203cb4484c66ddf8f6b07e590cc1331da Mon Sep 17 00:00:00 2001 From: victor mendoza Date: Thu, 22 Aug 2024 17:01:48 -0300 Subject: [PATCH 070/103] feat: create start inscription page for oneclick mall --- resources/views/oneclick-mall/start.blade.php | 77 +++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 resources/views/oneclick-mall/start.blade.php diff --git a/resources/views/oneclick-mall/start.blade.php b/resources/views/oneclick-mall/start.blade.php new file mode 100644 index 0000000..c2a26f5 --- /dev/null +++ b/resources/views/oneclick-mall/start.blade.php @@ -0,0 +1,77 @@ +@php + $navigation = ['create' => 'Crear transacción', 'example' => 'Ejemplo']; +@endphp + + +

    Oneclick Mall - Creación de transacción

    +

    + En esta etapa comienza el proceso de inscripción del medio de pago. Este paso inicial es fundamental, para + dirigir al tarjetahabiente al formulario de inscripción. +

    + +

    Paso 1: Petición

    +
      +
    • Comienza por importar la librería Oneclick en tu proyecto.
    • +
    • Después podrás iniciar una inscripción.
    • +
    + + use Illuminate\Http\Request; + use Transbank\Webpay\Options; + use Transbank\Webpay\Oneclick\MallInscription; + use Transbank\Webpay\Oneclick\MallTransaction; + //configuración de la transacción + $option = new Options(self::API_KEY, self::COMMERCE_CODE, Options::ENVIRONMENT_INTEGRATION); + $mallInscription = new MallInscription($option); + $mallTransaction = new MallTransaction($option); + $resp = $mallInscription->start($startTx["userName"], $startTx["email"], $startTx["responseUrl"]); + + +

    Paso 2: Respuesta

    +

    + Una vez que hayas iniciado la inscripción, aquí encontrarás los datos de respuesta generados por el proceso. +

    + + + +

    Paso 3: Creación del formulario

    +

    + Utiliza estos datos de respuesta para generar y presentar un formulario de pago al Tarjetahabiente. + Este formulario será la interfaz a través de la cual el usuario realizará su transacción. +

    + + + form action="https://webpay3gint.transbank.cl/webpayserver/initTransaction" method="POST"> + input type="hidden" name="token_ws" value="{{ $resp->token }}" /> + input type="submit" value="Pagar" /> + form> + + +

    Ejemplo

    +

    + Para llevar a cabo una transacción de compra en nuestro sistema, primero debemos crear la + transacción. Utilizaremos los siguientes datos para configurar la transacción: +

    + +
    + +
    + +

    + Por último, con la respuesta del servicio que confirma la creación de la transacción, procedemos + a crear el formulario de pago. Para fines de este ejemplo, haremos visible el campo "token_ws", el cual es + esencial para completar el proceso de pago de manera exitosa. +

    + +
    urlWebpay }} method="POST"> +
    + Formulario de redirección +
    + + token }} required> +
    + +
    +
    +
    From 9965507c04d057c3a1b981001bfe0365c09aef51 Mon Sep 17 00:00:00 2001 From: victor mendoza Date: Thu, 22 Aug 2024 17:01:54 -0300 Subject: [PATCH 071/103] feat: create status page for oneclick mall --- .../views/oneclick-mall/status.blade.php | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 resources/views/oneclick-mall/status.blade.php diff --git a/resources/views/oneclick-mall/status.blade.php b/resources/views/oneclick-mall/status.blade.php new file mode 100644 index 0000000..74bc90d --- /dev/null +++ b/resources/views/oneclick-mall/status.blade.php @@ -0,0 +1,30 @@ +@php + $navigation = ['state' => 'Consultar estado']; +@endphp + + + +

    Oneclick Mall - Consultar estado de transacción

    +

    Puedes solicitar el estado de una transacción hasta 7 días después de su realización. No hay límite + de solicitudes de este tipo durante ese período. Sin embargo, una vez pasados los 7 días, ya no podrás revisar + su estado. +

    + +

    Paso 1 - Petición:

    +

    + Para realizar la consulta, necesitarás el "buyOrder" de la transacción de interés. Utiliza este identificador + para efectuar una llamada a Oneclick.MallTransaction. +

    + + $resp = $mallTransaction->status($buyOrder); + + +

    Paso 2: Respuesta

    +

    + Transbank responderá con la siguiente información. Asegúrate de guardar esta respuesta, y la única validación + necesaria es que el campo "response_code" sea igual a cero. +

    + + + +
    From 9979f99829c6b6995c92e7410f9ebfc2afc4588a Mon Sep 17 00:00:00 2001 From: victor mendoza Date: Thu, 22 Aug 2024 17:02:03 -0300 Subject: [PATCH 072/103] feat: create timeout page for oneclick mall --- .../views/oneclick-mall/timeout.blade.php | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 resources/views/oneclick-mall/timeout.blade.php diff --git a/resources/views/oneclick-mall/timeout.blade.php b/resources/views/oneclick-mall/timeout.blade.php new file mode 100644 index 0000000..fcdc02f --- /dev/null +++ b/resources/views/oneclick-mall/timeout.blade.php @@ -0,0 +1,21 @@ +@php + $navigation = ['timeout' => 'Time Out']; +@endphp + + +

    Oneclick Mall - Time out

    +

    + Paso 1: Petición + Cuando una transacción expira debido a un timeout, es crucial gestionar este escenario de manera adecuada para + garantizar la transparencia y la experiencia del usuario, para la prueba en producción es de 10 minutos. +

    + +

    Datos Recibidos:

    +

    + Después de 10 minutos en el que no se haya recibido ninguna acción o interacción del usuario, recibirás un POST + con la siguiente información:

    + + + + +
    From 08910ab995b97a6d3deaf0057f25aaf5ae2a7ef3 Mon Sep 17 00:00:00 2001 From: victor mendoza Date: Thu, 22 Aug 2024 17:03:04 -0300 Subject: [PATCH 073/103] feat: add protection for window.opener --- resources/views/partials/channels.blade.php | 4 ++-- resources/views/partials/header.blade.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/resources/views/partials/channels.blade.php b/resources/views/partials/channels.blade.php index 3561131..91f8b35 100644 --- a/resources/views/partials/channels.blade.php +++ b/resources/views/partials/channels.blade.php @@ -5,7 +5,7 @@
    Escríbenos por slack
    - + slack Únete a nuestra comunidad de integradores. Nuestro equipo está ahí para @@ -16,7 +16,7 @@
    Envíanos un mensaje
    - + outlook Necesitas resolver algún tipo de incidencia, contáctanos a través de correo diff --git a/resources/views/partials/header.blade.php b/resources/views/partials/header.blade.php index df06925..3eeb8d2 100644 --- a/resources/views/partials/header.blade.php +++ b/resources/views/partials/header.blade.php @@ -3,8 +3,8 @@
    From 22ee5d4d9ee520de266ed81f807b2f8fb413fab9 Mon Sep 17 00:00:00 2001 From: victor mendoza Date: Thu, 22 Aug 2024 17:03:26 -0300 Subject: [PATCH 074/103] fix: use correct tag --- resources/views/webpay-deferred/create.blade.php | 2 +- resources/views/webpay-mall-deferred/create.blade.php | 2 +- resources/views/webpay-mall/create.blade.php | 2 +- resources/views/webpay/create.blade.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/resources/views/webpay-deferred/create.blade.php b/resources/views/webpay-deferred/create.blade.php index f38f8c4..5a48640 100644 --- a/resources/views/webpay-deferred/create.blade.php +++ b/resources/views/webpay-deferred/create.blade.php @@ -57,7 +57,7 @@ esencial para completar el proceso de pago de manera exitosa.

    -
    url }} action="POST"> + url }} method="POST">
    Formulario de redirección
    diff --git a/resources/views/webpay-mall-deferred/create.blade.php b/resources/views/webpay-mall-deferred/create.blade.php index 82be633..5a59a24 100644 --- a/resources/views/webpay-mall-deferred/create.blade.php +++ b/resources/views/webpay-mall-deferred/create.blade.php @@ -77,7 +77,7 @@ esencial para completar el proceso de pago de manera exitosa.

    - url }} action="POST"> + url }} method="POST">
    Formulario de redirección
    diff --git a/resources/views/webpay-mall/create.blade.php b/resources/views/webpay-mall/create.blade.php index ea7e511..f77c5a7 100644 --- a/resources/views/webpay-mall/create.blade.php +++ b/resources/views/webpay-mall/create.blade.php @@ -72,7 +72,7 @@ esencial para completar el proceso de pago de manera exitosa.

    - url }} action="POST"> + url }} method="POST">
    Formulario de redirección
    diff --git a/resources/views/webpay/create.blade.php b/resources/views/webpay/create.blade.php index a0b00ac..7883cd9 100644 --- a/resources/views/webpay/create.blade.php +++ b/resources/views/webpay/create.blade.php @@ -56,7 +56,7 @@ esencial para completar el proceso de pago de manera exitosa.

    - url }} action="POST"> + url }} method="POST">
    Formulario de redirección
    From 15b372b08b9e3d5abdecbd1de58c2378652a1a40 Mon Sep 17 00:00:00 2001 From: victor mendoza Date: Thu, 22 Aug 2024 17:03:40 -0300 Subject: [PATCH 075/103] feat: create routes for oneclick mall --- routes/web.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/routes/web.php b/routes/web.php index 54bfa44..b05a553 100644 --- a/routes/web.php +++ b/routes/web.php @@ -4,6 +4,7 @@ use App\Http\Controllers\WebpayPlusMallController; use App\Http\Controllers\WebpayPlusDeferredController; use App\Http\Controllers\WebpayPlusMallDeferredController; +use App\Http\Controllers\OneclickMallController; use Illuminate\Support\Facades\Route; @@ -33,6 +34,7 @@ Route::post('/refund', [WebpayPlusDeferredController::class, 'refund'])->name("refund"); Route::get('/status', [WebpayPlusDeferredController::class, 'status'])->name("status"); }); + Route::prefix('webpay-mall-diferido')->name("webpay-mall-deferred.")->group(function () { Route::get('/create', [WebpayPlusMallDeferredController::class, 'create'])->name("create"); Route::get('/commit', [WebpayPlusMallDeferredController::class, 'commit'])->name("commit"); @@ -40,3 +42,12 @@ Route::post('/refund', [WebpayPlusMallDeferredController::class, 'refund'])->name("refund"); Route::get('/status', [WebpayPlusMallDeferredController::class, 'status'])->name("status"); }); + +Route::prefix('oneclick-mall')->name("oneclick-mall.")->group(function () { + Route::get('/start', [OneclickMallController::class, 'startInscription'])->name("start"); + Route::get('/finish', [OneclickMallController::class, 'finishInscription'])->name("finish"); + Route::get('/authorize', [OneclickMallController::class, 'authorizeMall'])->name("authorize"); + Route::get('/delete', [OneclickMallController::class, 'deleteInscription'])->name("delete"); + Route::post('/refund', [OneclickMallController::class, 'refund'])->name("refund"); + Route::get('/status', [OneclickMallController::class, 'status'])->name("status"); +}); From 8b573ce6c21738bea22ffbe2ed0c77571cd3bc30 Mon Sep 17 00:00:00 2001 From: victor mendoza Date: Mon, 26 Aug 2024 11:51:33 -0300 Subject: [PATCH 076/103] fix: typo --- resources/views/oneclick-mall/rejected.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/oneclick-mall/rejected.blade.php b/resources/views/oneclick-mall/rejected.blade.php index 0ab4c43..060fd34 100644 --- a/resources/views/oneclick-mall/rejected.blade.php +++ b/resources/views/oneclick-mall/rejected.blade.php @@ -32,6 +32,6 @@ -

    En este caso la inscripción fue rechaza, tendras que repetir el proceso

    +

    En este caso la inscripción fue rechazada, tendrás que repetir el proceso

    From 83cf6d1ddfd078d9365e18a2fd291c1e8e3d31e8 Mon Sep 17 00:00:00 2001 From: victor mendoza Date: Mon, 26 Aug 2024 11:52:42 -0300 Subject: [PATCH 077/103] feat: add more info about refund --- .../views/oneclick-mall/refund.blade.php | 31 +++++++++++++--- .../views/webpay-deferred/refund.blade.php | 34 +++++++++++++---- .../webpay-mall-deferred/refund.blade.php | 37 +++++++++++++------ resources/views/webpay-mall/refund.blade.php | 36 ++++++++++++------ resources/views/webpay/refund.blade.php | 35 ++++++++++++++---- 5 files changed, 129 insertions(+), 44 deletions(-) diff --git a/resources/views/oneclick-mall/refund.blade.php b/resources/views/oneclick-mall/refund.blade.php index 9362801..3441fcd 100644 --- a/resources/views/oneclick-mall/refund.blade.php +++ b/resources/views/oneclick-mall/refund.blade.php @@ -5,7 +5,8 @@

    Oneclick Mall - Reembolsar

    -

    En esta etapa, tienes la opción de solicitar el reembolso del monto al titular de la tarjeta. +

    + En esta etapa, tienes la opción de solicitar el reembolso del monto al titular de la tarjeta. Dependiendo del monto y el tiempo transcurrido desde la transacción, este proceso podría resultar en una Reversa, Anulación o Anulación Parcial.

    @@ -23,10 +24,30 @@

    - Ten en cuenta que si anulas el monto total, puede ser una Reversa o Anulación, dependiendo de ciertas - condiciones, o una Anulación parcial si el monto es menor al total. No es posible realizar Anulaciones ni - Anulaciones parciales en tarjetas que no sean de crédito. Tampoco es posible realizar reembolsos de compras en - cuotas. + Las transacciones de Webpay se pueden anular o reversar dadas algunas condiciones. Para cualquiera de éstas + operaciones se utiliza el mismo servicio web que discernirá si se realizará una reversa o una anulación. + + Para poder ejecutar una reversa ésta debe ser realizada antes de las 3 horas de efectuada la confirmación por el + monto total y en compras con tarjeta de crédito, débito o prepago. + + Una vez pasadas las tres horas, siempre se ejecutará una anulación. +

    +
      +
    • + En transacciones con tarjeta de débito o prepago solo es posible anular por el monto total. +
    • +
    • + En transacciones con tarjeta de crédito puedes anular por cualquier monto igual o menor al total de la + compra. +
    • +
    • + No se pueden hacer Anulaciones parciales de compras con cuotas. +
    • +
    + +

    + En este link + podrás ver mayor información sobre las condiciones y casos para anular o reversar transacciones.

    diff --git a/resources/views/webpay-deferred/refund.blade.php b/resources/views/webpay-deferred/refund.blade.php index 4ca88c2..668ac47 100644 --- a/resources/views/webpay-deferred/refund.blade.php +++ b/resources/views/webpay-deferred/refund.blade.php @@ -11,20 +11,40 @@

    Paso 1 - Petición:

    -

    Para llevar a cabo el reembolso, necesitas proporcionar el token de la transacción y el monto que +

    + Para llevar a cabo el reembolso, necesitas proporcionar el token de la transacción y el monto que deseas - reversar. Si anulas el monto total, podría ser una Reversa o Anulación, dependiendo de ciertas condiciones, o - una Anulación Parcial si el monto es menor al total.

    -

    Condiciones Importantes:

    -
      +

      + Las transacciones de Webpay se pueden anular o reversar dadas algunas condiciones. Para cualquiera + de éstas operaciones se utiliza el mismo servicio web que discernirá si se realizará una reversa o una + anulación. + + Para poder ejecutar una reversa ésta debe ser realizada antes de las 3 horas de efectuada la confirmación por el + monto total y en compras con tarjeta de crédito, débito o prepago. + + Una vez pasadas las tres horas, siempre se ejecutará una anulación. +

      + +
        +
      • + En transacciones con tarjeta de débito o prepago solo es posible anular por el monto total. +
      • +
      • + En transacciones con tarjeta de crédito puedes anular por cualquier monto igual o menor al total de la + compra. +
      • - No es posible realizar Anulaciones ni Anulaciones Parciales en tarjetas que no sean de crédito. + No se pueden hacer Anulaciones parciales de compras con cuotas.
      • -
      • No se admiten reembolsos de compras en cuotas.
      +

      + En este link + podrás ver mayor información sobre las condiciones y casos para anular o reversar transacciones. +

      + $resp = $transaction->refund($token, $amount);

      Paso 2: Respuesta

      diff --git a/resources/views/webpay-mall-deferred/refund.blade.php b/resources/views/webpay-mall-deferred/refund.blade.php index 748aa2c..0f07a1d 100644 --- a/resources/views/webpay-mall-deferred/refund.blade.php +++ b/resources/views/webpay-mall-deferred/refund.blade.php @@ -4,34 +4,47 @@

      Webpay Mall Diferido - Reembolsar

      -

      En esta etapa, tienes la opción de solicitar el reembolso del monto al titular de la tarjeta. +

      + En esta etapa, tienes la opción de solicitar el reembolso del monto al titular de la tarjeta. Dependiendo del monto y el tiempo transcurrido desde la transacción, este proceso podría resultar en una Reversa, Anulación o Anulación Parcial. -

      Paso 1 - Petición:

      Para llevar a cabo el reembolso, necesitas proporcionar el token de la transacción, el monto que - quieres reversar, el código de comercio de la tienda hijo y el orden de compra del detalle de la transacción. Si - anulas el monto total, podría ser una Reversa o Anulación, dependiendo de ciertas condiciones, o una Anulación - Parcial si el monto es menor al total. + quieres reversar, el código de comercio de la tienda hijo y el orden de compra del detalle de la transacción. +

      + +

      + Las transacciones de Webpay se pueden anular o reversar dadas algunas condiciones. Para cualquiera + de éstas operaciones se utiliza el mismo servicio web que discernirá si se realizará una reversa o una + anulación. + + Para poder ejecutar una reversa ésta debe ser realizada antes de las 3 horas de efectuada la confirmación por el + monto total y en compras con tarjeta de crédito, débito o prepago. + + Una vez pasadas las tres horas, siempre se ejecutará una anulación.

      -

      Algunas consideraciones a tener en cuenta

      • - No es posible realizar Anulaciones ni Anulaciones Parciales en tarjetas que no sean de crédito. + En transacciones con tarjeta de débito o prepago solo es posible anular por el monto total. +
      • +
      • + En transacciones con tarjeta de crédito puedes anular por cualquier monto igual o menor al total de la + compra.
      • - No es posible realizar Anulaciones Parciales en pagos con cuotas. + No se pueden hacer Anulaciones parciales de compras con cuotas.
      • -
      • No se admiten reembolsos de compras en cuotas.
      -

      En este link - podrás ver - mayor información sobre las condiciones y casos para anular o reversar transacciones.

      +

      + En este link + podrás ver mayor información sobre las condiciones y casos para anular o reversar transacciones. +

      + $resp = $mallTransaction->refund($token, $buyOrder, $childCommerceCode, $amount); diff --git a/resources/views/webpay-mall/refund.blade.php b/resources/views/webpay-mall/refund.blade.php index beb0e33..502dd9d 100644 --- a/resources/views/webpay-mall/refund.blade.php +++ b/resources/views/webpay-mall/refund.blade.php @@ -4,34 +4,46 @@

      Webpay Mall - Reembolsar

      -

      En esta etapa, tienes la opción de solicitar el reembolso del monto al titular de la tarjeta. +

      + En esta etapa, tienes la opción de solicitar el reembolso del monto al titular de la tarjeta. Dependiendo del monto y el tiempo transcurrido desde la transacción, este proceso podría resultar en una Reversa, Anulación o Anulación Parcial. -

      Paso 1 - Petición:

      Para llevar a cabo el reembolso, necesitas proporcionar el token de la transacción, el monto que - quieres reversar, el código de comercio de la tienda hijo y el orden de compra del detalle de la transacción. Si - anulas el monto total, podría ser una Reversa o Anulación, dependiendo de ciertas condiciones, o una Anulación - Parcial si el monto es menor al total. + quieres reversar, el código de comercio de la tienda hijo y el orden de compra del detalle de la transacción. +

      + +

      + Las transacciones de Webpay se pueden anular o reversar dadas algunas condiciones. Para cualquiera de éstas + operaciones se utiliza el mismo servicio web que discernirá si se realizará una reversa o una anulación. + + Para poder ejecutar una reversa ésta debe ser realizada antes de las 3 horas de efectuada la confirmación por el + monto total y en compras con tarjeta de crédito, débito o prepago. + + Una vez pasadas las tres horas, siempre se ejecutará una anulación.

      -

      Algunas consideraciones a tener en cuenta

      • - No es posible realizar Anulaciones ni Anulaciones Parciales en tarjetas que no sean de crédito. + En transacciones con tarjeta de débito o prepago solo es posible anular por el monto total. +
      • +
      • + En transacciones con tarjeta de crédito puedes anular por cualquier monto igual o menor al total de la + compra.
      • - No es posible realizar Anulaciones Parciales en pagos con cuotas. + No se pueden hacer Anulaciones parciales de compras con cuotas.
      • -
      • No se admiten reembolsos de compras en cuotas.
      -

      En este link - podrás ver - mayor información sobre las condiciones y casos para anular o reversar transacciones.

      +

      + En este link + podrás ver mayor información sobre las condiciones y casos para anular o reversar transacciones. +

      + $resp = $mallTransaction->refund($token, $buyOrder, $childCommerceCode, $amount); diff --git a/resources/views/webpay/refund.blade.php b/resources/views/webpay/refund.blade.php index 8f1ab07..f966d87 100644 --- a/resources/views/webpay/refund.blade.php +++ b/resources/views/webpay/refund.blade.php @@ -11,20 +11,39 @@

      Paso 1 - Petición:

      -

      Para llevar a cabo el reembolso, necesitas proporcionar el token de la transacción y el monto que - deseas - reversar. Si anulas el monto total, podría ser una Reversa o Anulación, dependiendo de ciertas condiciones, o - una Anulación Parcial si el monto es menor al total. +

      + Para llevar a cabo el reembolso, necesitas proporcionar el token de la transacción y el monto que + deseas reversar.

      +

      + Las transacciones de Webpay se pueden anular o reversar dadas algunas condiciones. Para cualquiera + de éstas operaciones se utiliza el mismo servicio web que discernirá si se realizará una reversa o una + anulación. -

      Condiciones Importantes:

      -
    From f04bf5738fa737525f9917d50a050b01a9a43700 Mon Sep 17 00:00:00 2001 From: victor mendoza Date: Wed, 28 Aug 2024 11:38:41 -0300 Subject: [PATCH 098/103] feat: add more info for timeout in integration --- resources/views/oneclick-mall/timeout.blade.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/resources/views/oneclick-mall/timeout.blade.php b/resources/views/oneclick-mall/timeout.blade.php index fcdc02f..cde10eb 100644 --- a/resources/views/oneclick-mall/timeout.blade.php +++ b/resources/views/oneclick-mall/timeout.blade.php @@ -12,8 +12,9 @@

    Datos Recibidos:

    - Después de 10 minutos en el que no se haya recibido ninguna acción o interacción del usuario, recibirás un POST - con la siguiente información:

    + Después de 10 minutos (en el ambiente de integración) en el que no se haya recibido ninguna acción o interacción + del usuario, recibirás un POST con la siguiente información: +

    From 1d788062fd211bdfc9cbd430bde1cd47d8e96821 Mon Sep 17 00:00:00 2001 From: victor mendoza Date: Wed, 28 Aug 2024 11:41:10 -0300 Subject: [PATCH 099/103] feat: add more info for timeout in integration --- resources/views/oneclick-mall-deferred/timeout.blade.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/resources/views/oneclick-mall-deferred/timeout.blade.php b/resources/views/oneclick-mall-deferred/timeout.blade.php index 9dc3f4e..523b8d5 100644 --- a/resources/views/oneclick-mall-deferred/timeout.blade.php +++ b/resources/views/oneclick-mall-deferred/timeout.blade.php @@ -12,7 +12,8 @@

    Datos Recibidos:

    - Después de 10 minutos en el que no se haya recibido ninguna acción o interacción del usuario, recibirás un POST + Después de 10 minutos (en el ambiente de integración) en el que no se haya recibido ninguna acción o interacción + del usuario, recibirás un POST con la siguiente información:

    From b6813f7281d2768577992d253aa6aa1f6daf344e Mon Sep 17 00:00:00 2001 From: victor mendoza Date: Wed, 28 Aug 2024 11:41:35 -0300 Subject: [PATCH 100/103] refactor: use elseif --- app/Http/Controllers/OneclickMallDeferredController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/OneclickMallDeferredController.php b/app/Http/Controllers/OneclickMallDeferredController.php index 02dbedc..8260e27 100644 --- a/app/Http/Controllers/OneclickMallDeferredController.php +++ b/app/Http/Controllers/OneclickMallDeferredController.php @@ -61,7 +61,7 @@ public function finishInscription(Request $request) $view = 'oneclick-mall-deferred.rejected'; $data = ["resp" => $resp, "token" => $token]; return view('oneclick-mall-deferred.rejected', ["resp" => $resp, "token" => $token]); - } else if ($resp->responseCode == self::TIMEOUT) { + } elseif ($resp->responseCode == self::TIMEOUT) { $view = 'oneclick-mall-deferred.timeout'; $data = ["resp" => $resp]; return view('oneclick-mall-deferred.timeout', ["resp" => $resp]); From 978905aeb01409add5b938b3c348a15f90b862e7 Mon Sep 17 00:00:00 2001 From: victor mendoza Date: Wed, 28 Aug 2024 12:23:21 -0300 Subject: [PATCH 101/103] fix: remove route --- app/Http/Controllers/OneclickMallController.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/Http/Controllers/OneclickMallController.php b/app/Http/Controllers/OneclickMallController.php index 7a6e011..e0e8fd3 100644 --- a/app/Http/Controllers/OneclickMallController.php +++ b/app/Http/Controllers/OneclickMallController.php @@ -61,11 +61,9 @@ public function finishInscription(Request $request) if ($resp->responseCode == self::REJECTED) { $view = 'oneclick-mall.rejected'; $data = ["resp" => $resp, "token" => $token]; - return view('oneclick-mall.rejected', ["resp" => $resp, "token" => $token]); } elseif ($resp->responseCode == self::TIMEOUT) { $view = 'oneclick-mall.timeout'; $data = ["resp" => $resp]; - return view('oneclick-mall.timeout', ["resp" => $resp]); } else { $table = [ "username" => $userName, From d59b59fdfde54db8d67d4d84ec4c2873adf87f68 Mon Sep 17 00:00:00 2001 From: victor mendoza Date: Wed, 28 Aug 2024 12:28:28 -0300 Subject: [PATCH 102/103] fix: remove unnecesary route --- app/Http/Controllers/OneclickMallDeferredController.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/Http/Controllers/OneclickMallDeferredController.php b/app/Http/Controllers/OneclickMallDeferredController.php index 8260e27..0815213 100644 --- a/app/Http/Controllers/OneclickMallDeferredController.php +++ b/app/Http/Controllers/OneclickMallDeferredController.php @@ -60,11 +60,9 @@ public function finishInscription(Request $request) if ($resp->responseCode == self::REJECTED) { $view = 'oneclick-mall-deferred.rejected'; $data = ["resp" => $resp, "token" => $token]; - return view('oneclick-mall-deferred.rejected', ["resp" => $resp, "token" => $token]); } elseif ($resp->responseCode == self::TIMEOUT) { $view = 'oneclick-mall-deferred.timeout'; $data = ["resp" => $resp]; - return view('oneclick-mall-deferred.timeout', ["resp" => $resp]); } else { $table = [ "username" => $userName, From 3f4f1ac6e1889aa78770ba57a27fbb2abd333fdc Mon Sep 17 00:00:00 2001 From: victor mendoza Date: Mon, 9 Sep 2024 13:12:50 -0300 Subject: [PATCH 103/103] fix: typo --- .../views/oneclick-mall-deferred/finish.blade.php | 2 +- .../views/oneclick-mall-deferred/refund.blade.php | 2 +- .../views/oneclick-mall-deferred/start.blade.php | 15 ++++++--------- resources/views/oneclick-mall/finish.blade.php | 2 +- resources/views/oneclick-mall/start.blade.php | 15 ++++++--------- .../views/webpay-mall-deferred/capture.blade.php | 6 +++--- 6 files changed, 18 insertions(+), 24 deletions(-) diff --git a/resources/views/oneclick-mall-deferred/finish.blade.php b/resources/views/oneclick-mall-deferred/finish.blade.php index 813b37e..506e56d 100644 --- a/resources/views/oneclick-mall-deferred/finish.blade.php +++ b/resources/views/oneclick-mall-deferred/finish.blade.php @@ -53,7 +53,7 @@ class="tbk-button primary"> BORRAR USUARIO $table['username'], 'tbkUser' => $table['tbk_user']]) }} - class="tbk-button primary">AUTHORIZAR UN PAGO + class="tbk-button primary">AUTORIZAR UN PAGO
    diff --git a/resources/views/oneclick-mall-deferred/refund.blade.php b/resources/views/oneclick-mall-deferred/refund.blade.php index 192c7fa..87a0834 100644 --- a/resources/views/oneclick-mall-deferred/refund.blade.php +++ b/resources/views/oneclick-mall-deferred/refund.blade.php @@ -4,7 +4,7 @@ -

    Oneclick Mall Diferido- Reembolsar

    +

    Oneclick Mall Diferido - Reembolsar

    En esta etapa, tienes la opción de solicitar el reembolso del monto al titular de la tarjeta. Dependiendo del monto y el tiempo transcurrido desde la transacción, este proceso podría resultar en una diff --git a/resources/views/oneclick-mall-deferred/start.blade.php b/resources/views/oneclick-mall-deferred/start.blade.php index 57cfeae..0f26a0a 100644 --- a/resources/views/oneclick-mall-deferred/start.blade.php +++ b/resources/views/oneclick-mall-deferred/start.blade.php @@ -15,14 +15,12 @@

  • Después podrás iniciar una inscripción.
  • - use Illuminate\Http\Request; use Transbank\Webpay\Options; use Transbank\Webpay\Oneclick\MallInscription; use Transbank\Webpay\Oneclick\MallTransaction; //configuración de la transacción $option = new Options(self::API_KEY, self::COMMERCE_CODE, Options::ENVIRONMENT_INTEGRATION); $mallInscription = new MallInscription($option); - $mallTransaction = new MallTransaction($option); $resp = $mallInscription->start($startTx["userName"], $startTx["email"], $startTx["responseUrl"]); @@ -35,21 +33,20 @@

    Paso 3: Creación del formulario

    - Utiliza estos datos de respuesta para generar y presentar un formulario de pago al Tarjetahabiente. - Este formulario será la interfaz a través de la cual el usuario realizará su transacción. + Utiliza estos datos de respuesta para generar y presentar un formulario de Inscripción al Tarjetahabiente.

    form action="https://webpay3gint.transbank.cl/webpayserver/initTransaction" method="POST"> - input type="hidden" name="token_ws" value="{{ $resp->token }}" /> - input type="submit" value="Pagar" /> + input type="hidden" name="TBK_TOKEN" value="{{ $resp->token }}" /> + input type="submit" value="Inscribir" /> form>

    Ejemplo

    - Para llevar a cabo una transacción de compra en nuestro sistema, primero debemos crear la - transacción. Utilizaremos los siguientes datos para configurar la transacción: + Para llevar a cabo una Inscripción en nuestro sistema, primero debemos crearla. Utilizaremos los siguientes + datos para configurar la inscripción:

    @@ -58,7 +55,7 @@

    Por último, con la respuesta del servicio que confirma la creación de la transacción, procedemos - a crear el formulario de pago. Para fines de este ejemplo, haremos visible el campo "token_ws", el cual es + a crear el formulario de pago. Para fines de este ejemplo, haremos visible el campo "TBK_TOKEN", el cual es esencial para completar el proceso de pago de manera exitosa.

    diff --git a/resources/views/oneclick-mall/finish.blade.php b/resources/views/oneclick-mall/finish.blade.php index c0ae6e8..ad3977b 100644 --- a/resources/views/oneclick-mall/finish.blade.php +++ b/resources/views/oneclick-mall/finish.blade.php @@ -53,7 +53,7 @@ class="tbk-button primary"> BORRAR USUARIO $table['username'], 'tbkUser' => $table['tbk_user']]) }} - class="tbk-button primary">AUTHORIZAR UN PAGO + class="tbk-button primary">AUTORIZAR UN PAGO
    diff --git a/resources/views/oneclick-mall/start.blade.php b/resources/views/oneclick-mall/start.blade.php index c2a26f5..a19b2f6 100644 --- a/resources/views/oneclick-mall/start.blade.php +++ b/resources/views/oneclick-mall/start.blade.php @@ -15,14 +15,12 @@
  • Después podrás iniciar una inscripción.
  • - use Illuminate\Http\Request; use Transbank\Webpay\Options; use Transbank\Webpay\Oneclick\MallInscription; use Transbank\Webpay\Oneclick\MallTransaction; //configuración de la transacción $option = new Options(self::API_KEY, self::COMMERCE_CODE, Options::ENVIRONMENT_INTEGRATION); $mallInscription = new MallInscription($option); - $mallTransaction = new MallTransaction($option); $resp = $mallInscription->start($startTx["userName"], $startTx["email"], $startTx["responseUrl"]); @@ -35,21 +33,20 @@

    Paso 3: Creación del formulario

    - Utiliza estos datos de respuesta para generar y presentar un formulario de pago al Tarjetahabiente. - Este formulario será la interfaz a través de la cual el usuario realizará su transacción. + Utiliza estos datos de respuesta para generar y presentar un formulario de Inscripción al Tarjetahabiente.

    form action="https://webpay3gint.transbank.cl/webpayserver/initTransaction" method="POST"> - input type="hidden" name="token_ws" value="{{ $resp->token }}" /> - input type="submit" value="Pagar" /> + input type="hidden" name="TBK_TOKEN" value="{{ $resp->token }}" /> + input type="submit" value="Inscribir" /> form>

    Ejemplo

    - Para llevar a cabo una transacción de compra en nuestro sistema, primero debemos crear la - transacción. Utilizaremos los siguientes datos para configurar la transacción: + Para llevar a cabo una Inscripción en nuestro sistema, primero debemos crearla. Utilizaremos los siguientes + datos para configurar la inscripción:

    @@ -58,7 +55,7 @@

    Por último, con la respuesta del servicio que confirma la creación de la transacción, procedemos - a crear el formulario de pago. Para fines de este ejemplo, haremos visible el campo "token_ws", el cual es + a crear el formulario de pago. Para fines de este ejemplo, haremos visible el campo "TBK_TOKEN", el cual es esencial para completar el proceso de pago de manera exitosa.

    diff --git a/resources/views/webpay-mall-deferred/capture.blade.php b/resources/views/webpay-mall-deferred/capture.blade.php index 2fca9a6..ddf7f43 100644 --- a/resources/views/webpay-mall-deferred/capture.blade.php +++ b/resources/views/webpay-mall-deferred/capture.blade.php @@ -5,9 +5,9 @@

    Webpay Mall diferido - capturar transacción

    -

    En este paso debemos capturar la transacción para realmente capturar el dinero que habia sido - previamente - reservado al hacer la transacción +

    + En este paso debemos capturar la transacción para hacer efectiva la reserva de dinero realizada + previamente en la etapa de autorización.

    Paso 1: Petición