├── docs ├── img │ ├── demo1.png │ ├── demo2.png │ ├── demo3.png │ ├── demo4.png │ ├── demo5.png │ ├── demo6.png │ ├── demo7.png │ ├── demo8.png │ ├── demo9.png │ ├── paso1.png │ ├── paso2.png │ ├── paso3.png │ ├── paso4.png │ ├── paso5.png │ ├── paso6.png │ ├── order1.png │ └── order2.png ├── INSTALLATION.pdf └── INSTALLATION.md ├── plugin ├── images │ ├── oneclick.png │ ├── tbk-logo.png │ ├── webpay.png │ ├── webpay-new.png │ └── oneclick-banner.jpg ├── css │ ├── webfonts │ │ ├── fa-solid-900.eot │ │ ├── fa-solid-900.ttf │ │ ├── fa-brands-400.eot │ │ ├── fa-brands-400.ttf │ │ ├── fa-brands-400.woff │ │ ├── fa-regular-400.eot │ │ ├── fa-regular-400.ttf │ │ ├── fa-solid-900.woff │ │ ├── fa-solid-900.woff2 │ │ ├── fa-brands-400.woff2 │ │ ├── fa-regular-400.woff │ │ └── fa-regular-400.woff2 │ ├── font-awesome │ │ ├── solid.min.css │ │ ├── brands.min.css │ │ ├── regular.min.css │ │ ├── brands.css │ │ ├── solid.css │ │ ├── regular.css │ │ └── svg-with-js.min.css │ └── bootstrap-switch.css ├── shared │ ├── Exceptions │ │ ├── EcommerceException.php │ │ ├── InvalidOrderException.php │ │ ├── TableNotExistOnDatabaseException.php │ │ ├── TokenNotFoundOnDatabaseException.php │ │ ├── Webpay │ │ │ ├── CreateWebpayException.php │ │ │ ├── CreateTransactionWebpayException.php │ │ │ ├── StatusWebpayException.php │ │ │ ├── GetTransactionWebpayException.php │ │ │ ├── NotFoundTransactionWebpayException.php │ │ │ ├── RefundWebpayException.php │ │ │ ├── CommitWebpayException.php │ │ │ ├── InvalidStatusWebpayException.php │ │ │ ├── UserCancelWebpayException.php │ │ │ ├── AlreadyProcessedException.php │ │ │ ├── TimeoutWebpayException.php │ │ │ ├── DoubleTokenWebpayException.php │ │ │ ├── RejectedRefundWebpayException.php │ │ │ └── RejectedCommitWebpayException.php │ │ ├── Oneclick │ │ │ ├── StartOneclickException.php │ │ │ ├── AuthorizeOneclickException.php │ │ │ ├── GetInscriptionOneclickException.php │ │ │ ├── StartInscriptionOneclickException.php │ │ │ ├── CreateTransactionOneclickException.php │ │ │ ├── WithoutTokenInscriptionOneclickException.php │ │ │ ├── StatusOneclickException.php │ │ │ ├── GetTransactionOneclickException.php │ │ │ ├── NotFoundTransactionOneclickException.php │ │ │ ├── RejectedAuthorizeOneclickException.php │ │ │ ├── ConstraintsViolatedAuthorizeOneclickException.php │ │ │ ├── FinishInscriptionOneclickException.php │ │ │ ├── TimeoutInscriptionOneclickException.php │ │ │ ├── UserCancelInscriptionOneclickException.php │ │ │ ├── InvalidStatusInscriptionOneclickException.php │ │ │ ├── RefundOneclickException.php │ │ │ ├── RejectedInscriptionOneclickException.php │ │ │ └── RejectedRefundOneclickException.php │ │ └── BaseException.php │ ├── Helpers │ │ ├── ExceptionConstants.php │ │ ├── DateUtils.php │ │ ├── ArrayUtils.php │ │ ├── ILogger.php │ │ ├── ObjectUtil.php │ │ ├── TbkDatabaseConstants.php │ │ ├── StringUtils.php │ │ ├── GitHubUtil.php │ │ ├── WoocommerceInfoUtil.php │ │ ├── TbkValidationUtil.php │ │ ├── InfoUtil.php │ │ ├── TbkConstants.php │ │ └── PluginLogger.php │ └── Model │ │ ├── OneclickConfig.php │ │ ├── WebpayplusConfig.php │ │ ├── LogConfig.php │ │ └── ProductConfig.php ├── src │ ├── Utils │ │ ├── Template.php │ │ ├── ConnectionCheck.php │ │ └── TableCheck.php │ ├── Helpers │ │ ├── WordpressPluginVersion.php │ │ ├── RedirectorHelper.php │ │ ├── HposHelper.php │ │ ├── BlocksHelper.php │ │ ├── ErrorHelper.php │ │ ├── SessionMessageHelper.php │ │ ├── PluginInfoHelper.php │ │ ├── NoticeHelper.php │ │ ├── ErrorUtil.php │ │ ├── TbkFactory.php │ │ ├── BuyOrderHelper.php │ │ └── WebpayTransactionsTable.php │ ├── Blocks │ │ ├── WC_Gateway_Transbank_Webpay_Blocks.php │ │ ├── WC_Gateway_Transbank_Oneclick_Blocks.php │ │ ├── js │ │ │ ├── webpay_checkout.js │ │ │ ├── oneclick_checkout.js │ │ │ └── notice_handler.js │ │ └── WCGatewayTransbankBlocks.php │ ├── Models │ │ ├── TransbankExecutionErrorLog.php │ │ ├── TransbankApiServiceLog.php │ │ ├── BaseModel.php │ │ ├── Inscription.php │ │ └── Transaction.php │ ├── Controllers │ │ ├── LogController.php │ │ ├── ThankYouPageController.php │ │ ├── TransactionStatusController.php │ │ └── OneclickInscriptionResponseController.php │ ├── PaymentGateways │ │ └── TransbankRESTPaymentGateway.php │ ├── TransbankSdk.php │ └── Tokenization │ │ └── WC_Payment_Token_Oneclick.php ├── views │ └── admin │ │ ├── transactions.php │ │ ├── components │ │ ├── notice-missing-woocommerce.php │ │ ├── credenciales-box.php │ │ ├── info-validacion-webpay-plus-box.php │ │ └── info-validacion-webpay-oneclick-box.php │ │ ├── options-tabs.php │ │ ├── admin-options.php │ │ └── oneclick-admin-options.php ├── composer.json ├── package.json ├── templates │ ├── public │ │ ├── notices │ │ │ └── review-notice.php │ │ └── order │ │ │ └── order-summary.php │ └── admin │ │ ├── order │ │ └── transaction-status.php │ │ └── log.php └── webpack.config.js ├── sonar-project.properties ├── .editorconfig ├── .github ├── workflows │ ├── build.yml │ └── release.yml └── ISSUE_TEMPLATE │ └── reporte-de-error.md ├── .gitignore ├── LICENSE ├── docker-woocommerce-php8.2-wp6.7.1-wc2.11.0-woo9.4.2 ├── README.md └── docker-compose.yml ├── package.sh ├── scripts └── deploy.sh └── README.md /docs/img/demo1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TransbankDevelopers/transbank-plugin-woocommerce-webpay-rest/HEAD/docs/img/demo1.png -------------------------------------------------------------------------------- /docs/img/demo2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TransbankDevelopers/transbank-plugin-woocommerce-webpay-rest/HEAD/docs/img/demo2.png -------------------------------------------------------------------------------- /docs/img/demo3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TransbankDevelopers/transbank-plugin-woocommerce-webpay-rest/HEAD/docs/img/demo3.png -------------------------------------------------------------------------------- /docs/img/demo4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TransbankDevelopers/transbank-plugin-woocommerce-webpay-rest/HEAD/docs/img/demo4.png -------------------------------------------------------------------------------- /docs/img/demo5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TransbankDevelopers/transbank-plugin-woocommerce-webpay-rest/HEAD/docs/img/demo5.png -------------------------------------------------------------------------------- /docs/img/demo6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TransbankDevelopers/transbank-plugin-woocommerce-webpay-rest/HEAD/docs/img/demo6.png -------------------------------------------------------------------------------- /docs/img/demo7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TransbankDevelopers/transbank-plugin-woocommerce-webpay-rest/HEAD/docs/img/demo7.png -------------------------------------------------------------------------------- /docs/img/demo8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TransbankDevelopers/transbank-plugin-woocommerce-webpay-rest/HEAD/docs/img/demo8.png -------------------------------------------------------------------------------- /docs/img/demo9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TransbankDevelopers/transbank-plugin-woocommerce-webpay-rest/HEAD/docs/img/demo9.png -------------------------------------------------------------------------------- /docs/img/paso1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TransbankDevelopers/transbank-plugin-woocommerce-webpay-rest/HEAD/docs/img/paso1.png -------------------------------------------------------------------------------- /docs/img/paso2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TransbankDevelopers/transbank-plugin-woocommerce-webpay-rest/HEAD/docs/img/paso2.png -------------------------------------------------------------------------------- /docs/img/paso3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TransbankDevelopers/transbank-plugin-woocommerce-webpay-rest/HEAD/docs/img/paso3.png -------------------------------------------------------------------------------- /docs/img/paso4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TransbankDevelopers/transbank-plugin-woocommerce-webpay-rest/HEAD/docs/img/paso4.png -------------------------------------------------------------------------------- /docs/img/paso5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TransbankDevelopers/transbank-plugin-woocommerce-webpay-rest/HEAD/docs/img/paso5.png -------------------------------------------------------------------------------- /docs/img/paso6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TransbankDevelopers/transbank-plugin-woocommerce-webpay-rest/HEAD/docs/img/paso6.png -------------------------------------------------------------------------------- /docs/INSTALLATION.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TransbankDevelopers/transbank-plugin-woocommerce-webpay-rest/HEAD/docs/INSTALLATION.pdf -------------------------------------------------------------------------------- /docs/img/order1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TransbankDevelopers/transbank-plugin-woocommerce-webpay-rest/HEAD/docs/img/order1.png -------------------------------------------------------------------------------- /docs/img/order2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TransbankDevelopers/transbank-plugin-woocommerce-webpay-rest/HEAD/docs/img/order2.png -------------------------------------------------------------------------------- /plugin/images/oneclick.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TransbankDevelopers/transbank-plugin-woocommerce-webpay-rest/HEAD/plugin/images/oneclick.png -------------------------------------------------------------------------------- /plugin/images/tbk-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TransbankDevelopers/transbank-plugin-woocommerce-webpay-rest/HEAD/plugin/images/tbk-logo.png -------------------------------------------------------------------------------- /plugin/images/webpay.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TransbankDevelopers/transbank-plugin-woocommerce-webpay-rest/HEAD/plugin/images/webpay.png -------------------------------------------------------------------------------- /plugin/images/webpay-new.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TransbankDevelopers/transbank-plugin-woocommerce-webpay-rest/HEAD/plugin/images/webpay-new.png -------------------------------------------------------------------------------- /plugin/images/oneclick-banner.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TransbankDevelopers/transbank-plugin-woocommerce-webpay-rest/HEAD/plugin/images/oneclick-banner.jpg -------------------------------------------------------------------------------- /plugin/css/webfonts/fa-solid-900.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TransbankDevelopers/transbank-plugin-woocommerce-webpay-rest/HEAD/plugin/css/webfonts/fa-solid-900.eot -------------------------------------------------------------------------------- /plugin/css/webfonts/fa-solid-900.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TransbankDevelopers/transbank-plugin-woocommerce-webpay-rest/HEAD/plugin/css/webfonts/fa-solid-900.ttf -------------------------------------------------------------------------------- /plugin/css/webfonts/fa-brands-400.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TransbankDevelopers/transbank-plugin-woocommerce-webpay-rest/HEAD/plugin/css/webfonts/fa-brands-400.eot -------------------------------------------------------------------------------- /plugin/css/webfonts/fa-brands-400.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TransbankDevelopers/transbank-plugin-woocommerce-webpay-rest/HEAD/plugin/css/webfonts/fa-brands-400.ttf -------------------------------------------------------------------------------- /plugin/css/webfonts/fa-brands-400.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TransbankDevelopers/transbank-plugin-woocommerce-webpay-rest/HEAD/plugin/css/webfonts/fa-brands-400.woff -------------------------------------------------------------------------------- /plugin/css/webfonts/fa-regular-400.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TransbankDevelopers/transbank-plugin-woocommerce-webpay-rest/HEAD/plugin/css/webfonts/fa-regular-400.eot -------------------------------------------------------------------------------- /plugin/css/webfonts/fa-regular-400.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TransbankDevelopers/transbank-plugin-woocommerce-webpay-rest/HEAD/plugin/css/webfonts/fa-regular-400.ttf -------------------------------------------------------------------------------- /plugin/css/webfonts/fa-solid-900.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TransbankDevelopers/transbank-plugin-woocommerce-webpay-rest/HEAD/plugin/css/webfonts/fa-solid-900.woff -------------------------------------------------------------------------------- /plugin/css/webfonts/fa-solid-900.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TransbankDevelopers/transbank-plugin-woocommerce-webpay-rest/HEAD/plugin/css/webfonts/fa-solid-900.woff2 -------------------------------------------------------------------------------- /plugin/css/webfonts/fa-brands-400.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TransbankDevelopers/transbank-plugin-woocommerce-webpay-rest/HEAD/plugin/css/webfonts/fa-brands-400.woff2 -------------------------------------------------------------------------------- /plugin/css/webfonts/fa-regular-400.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TransbankDevelopers/transbank-plugin-woocommerce-webpay-rest/HEAD/plugin/css/webfonts/fa-regular-400.woff -------------------------------------------------------------------------------- /plugin/css/webfonts/fa-regular-400.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TransbankDevelopers/transbank-plugin-woocommerce-webpay-rest/HEAD/plugin/css/webfonts/fa-regular-400.woff2 -------------------------------------------------------------------------------- /plugin/shared/Exceptions/EcommerceException.php: -------------------------------------------------------------------------------- 1 | $value) { 9 | $to->$property = $value; 10 | } 11 | return $to; 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /plugin/src/Utils/Template.php: -------------------------------------------------------------------------------- 1 | logDir = $logDir; 10 | } 11 | 12 | public function getLogDir() 13 | { 14 | return $this->logDir; 15 | } 16 | 17 | public function setLogDir($logDir) 18 | { 19 | $this->logDir = $logDir; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /plugin/shared/Helpers/TbkDatabaseConstants.php: -------------------------------------------------------------------------------- 1 | 2 |

Lista de transacciones Transbank

3 |

En esta lista encontrarás el listado de transacciones que Transbank ha procesado.
4 | Se incluyen transacciones desde el momento en que se inicia el intento de pago tanto en Webpay Plus como Webpay Oneclick.

5 | prepare_items(); 8 | $table->display(); 9 | ?> 10 | 11 | -------------------------------------------------------------------------------- /plugin/shared/Exceptions/Webpay/StatusWebpayException.php: -------------------------------------------------------------------------------- 1 | token = $token; 13 | parent::__construct($message, $previous); 14 | } 15 | 16 | public function getToken() { 17 | return $this->token; 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /plugin/shared/Exceptions/Oneclick/StatusOneclickException.php: -------------------------------------------------------------------------------- 1 | buyOrder = $buyOrder; 13 | parent::__construct($message, $previous); 14 | } 15 | 16 | public function getBuyOrder() { 17 | return $this->buyOrder; 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /plugin/shared/Exceptions/Webpay/GetTransactionWebpayException.php: -------------------------------------------------------------------------------- 1 | orderId = $orderId; 13 | parent::__construct($message, $previous); 14 | } 15 | 16 | public function getOrderId() { 17 | return $this->orderId; 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /plugin/views/admin/components/notice-missing-woocommerce.php: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | Transbank logo 5 |
6 | 7 |
8 |

9 | 10 | 11 | 12 |
13 |
14 |
15 | -------------------------------------------------------------------------------- /plugin/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "require": { 3 | "transbank/transbank-sdk": "4.0", 4 | "ext-json": "*", 5 | "php": ">=7.4", 6 | "monolog/monolog": "^2.10" 7 | }, 8 | "config": { 9 | "platform": { 10 | "php": "7.4" 11 | } 12 | }, 13 | "autoload": { 14 | "psr-4": { 15 | "Transbank\\WooCommerce\\WebpayRest\\": "src/", 16 | "Transbank\\Plugin\\": "shared/" 17 | } 18 | }, 19 | "description": "Transbank WooCommerce Plugin", 20 | "name": "transbank/woocommerce-plugin" 21 | } 22 | -------------------------------------------------------------------------------- /plugin/shared/Exceptions/Oneclick/GetTransactionOneclickException.php: -------------------------------------------------------------------------------- 1 | orderId = $orderId; 13 | parent::__construct($message, $previous); 14 | } 15 | 16 | public function getOrderId() { 17 | return $this->orderId; 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /plugin/shared/Exceptions/Webpay/NotFoundTransactionWebpayException.php: -------------------------------------------------------------------------------- 1 | orderId = $orderId; 13 | parent::__construct($message, $previous); 14 | } 15 | 16 | public function getOrderId() { 17 | return $this->orderId; 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /plugin/shared/Exceptions/Oneclick/NotFoundTransactionOneclickException.php: -------------------------------------------------------------------------------- 1 | orderId = $orderId; 13 | parent::__construct($message, $previous); 14 | } 15 | 16 | public function getOrderId() { 17 | return $this->orderId; 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /plugin/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "transbank-woocommerce-gateway", 3 | "title": "WooCommerce Webpay Rest", 4 | "version": "1.0.0", 5 | "author": "Transbank Developers", 6 | "license": "BSD-3-Clause", 7 | "keywords": [], 8 | "engines": { 9 | "node": "^20", 10 | "npm": ">=1.1.0" 11 | }, 12 | "devDependencies": { 13 | "@woocommerce/dependency-extraction-webpack-plugin": "^3.1.0", 14 | "@wordpress/scripts": "^30.14.0", 15 | "cross-env": "7.0.3" 16 | }, 17 | "scripts": { 18 | "start": "wp-scripts start", 19 | "build": "wp-scripts build", 20 | "check-engines": "wp-scripts check-engines" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /plugin/shared/Exceptions/Oneclick/RejectedAuthorizeOneclickException.php: -------------------------------------------------------------------------------- 1 | authorizeResponse = $authorizeResponse; 13 | parent::__construct($message, $previous); 14 | } 15 | 16 | public function getAuthorizeResponse() { 17 | return $this->authorizeResponse; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /plugin/src/Helpers/WordpressPluginVersion.php: -------------------------------------------------------------------------------- 1 | includeWordpressPluginFunctions(); 18 | $pluginData = get_plugin_data(__DIR__.'/../../webpay-rest.php'); 19 | 20 | return $pluginData['Version']; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /plugin/shared/Exceptions/Oneclick/ConstraintsViolatedAuthorizeOneclickException.php: -------------------------------------------------------------------------------- 1 | authorizeResponse = $authorizeResponse; 13 | parent::__construct($message, $previous); 14 | } 15 | 16 | public function getAuthorizeResponse() { 17 | return $this->authorizeResponse; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /plugin/css/font-awesome/solid.min.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * Font Awesome Free 5.15.3 by @fontawesome - https://fontawesome.com 3 | * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) 4 | */ 5 | @font-face{font-family:"Font Awesome 5 Free";font-style:normal;font-weight:900;font-display:block;src:url(../webfonts/fa-solid-900.eot);src:url(../webfonts/fa-solid-900.eot?#iefix) format("embedded-opentype"),url(../webfonts/fa-solid-900.woff2) format("woff2"),url(../webfonts/fa-solid-900.woff) format("woff"),url(../webfonts/fa-solid-900.ttf) format("truetype"),url(../webfonts/fa-solid-900.svg#fontawesome) format("svg")}.fa,.fas{font-family:"Font Awesome 5 Free";font-weight:900} -------------------------------------------------------------------------------- /plugin/views/admin/components/credenciales-box.php: -------------------------------------------------------------------------------- 1 |
2 |

Credenciales de prueba

3 | En el ambiente de integración debes probar usando tarjetas de crédito y débito de prueba.
4 | Encuentra las tarjeta de prueba acá 5 | 6 |

7 | Después de seleccionar el método de pago (en una compra de prueba), llegarás a una página de un Banco de prueba. Debes ingresar estas credenciales: 8 |
9 | Rut: 11.111.111-1
10 | Clave: 123
11 |

12 |
13 | -------------------------------------------------------------------------------- /plugin/css/font-awesome/brands.min.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * Font Awesome Free 5.15.3 by @fontawesome - https://fontawesome.com 3 | * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) 4 | */ 5 | @font-face{font-family:"Font Awesome 5 Brands";font-style:normal;font-weight:400;font-display:block;src:url(../webfonts/fa-brands-400.eot);src:url(../webfonts/fa-brands-400.eot?#iefix) format("embedded-opentype"),url(../webfonts/fa-brands-400.woff2) format("woff2"),url(../webfonts/fa-brands-400.woff) format("woff"),url(../webfonts/fa-brands-400.ttf) format("truetype"),url(../webfonts/fa-brands-400.svg#fontawesome) format("svg")}.fab{font-family:"Font Awesome 5 Brands";font-weight:400} -------------------------------------------------------------------------------- /plugin/css/font-awesome/regular.min.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * Font Awesome Free 5.15.3 by @fontawesome - https://fontawesome.com 3 | * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) 4 | */ 5 | @font-face{font-family:"Font Awesome 5 Free";font-style:normal;font-weight:400;font-display:block;src:url(../webfonts/fa-regular-400.eot);src:url(../webfonts/fa-regular-400.eot?#iefix) format("embedded-opentype"),url(../webfonts/fa-regular-400.woff2) format("woff2"),url(../webfonts/fa-regular-400.woff) format("woff"),url(../webfonts/fa-regular-400.ttf) format("truetype"),url(../webfonts/fa-regular-400.svg#fontawesome) format("svg")}.far{font-family:"Font Awesome 5 Free";font-weight:400} -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: Build 2 | on: 3 | workflow_dispatch: 4 | pull_request: 5 | types: [opened, synchronize, reopened] 6 | push: 7 | branches: 8 | - 'master' 9 | jobs: 10 | sonarcloud: 11 | name: SonarCloud 12 | runs-on: ubuntu-latest 13 | steps: 14 | - uses: actions/checkout@v3 15 | with: 16 | fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis 17 | - name: SonarCloud Scan 18 | uses: SonarSource/sonarcloud-github-action@master 19 | env: 20 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any 21 | SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} 22 | -------------------------------------------------------------------------------- /plugin/src/Blocks/WC_Gateway_Transbank_Webpay_Blocks.php: -------------------------------------------------------------------------------- 1 | scriptInfo = require_once $scriptPath . 'webpay_blocks.asset.php'; 15 | $this->paymentId = $this->name; 16 | $this->productName = 'webpay'; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /plugin/src/Blocks/WC_Gateway_Transbank_Oneclick_Blocks.php: -------------------------------------------------------------------------------- 1 | scriptInfo = require_once $scriptPath . 'oneclick_blocks.asset.php'; 15 | $this->paymentId = $this->name; 16 | $this->productName = 'oneclick'; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /plugin/shared/Exceptions/Webpay/RefundWebpayException.php: -------------------------------------------------------------------------------- 1 | token = $token; 14 | $this->transaction = $transaction; 15 | parent::__construct($message, $previous); 16 | } 17 | 18 | public function getToken() { 19 | return $this->token; 20 | } 21 | 22 | public function getTransaction() { 23 | return $this->transaction; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .vscode 2 | .idea 3 | builds/ 4 | 5 | ## OSX 6 | # General 7 | .DS_Store 8 | .AppleDouble 9 | .LSOverride 10 | 11 | # Thumbnails 12 | ._* 13 | 14 | ## Linux 15 | *~ 16 | 17 | ## Windows 18 | # Windows thumbnail cache files 19 | Thumbs.db 20 | ehthumbs.db 21 | ehthumbs_vista.db 22 | 23 | # Dump file 24 | *.stackdump 25 | 26 | # Folder config file 27 | [Dd]esktop.ini 28 | 29 | # Dependencies 30 | vendor 31 | node_modules 32 | composer.lock 33 | package-lock.json 34 | 35 | transbank-webpay-plus-rest.zip 36 | transbank-webpay-plus-rest-guzzle7.zip 37 | 38 | docker-woocommerce-*/wp_data 39 | docker-woocommerce-*/db_data 40 | docker-woocommerce-*/transbank-webpay-plus-rest 41 | 42 | # Woocoomerce blocks genereted files 43 | plugin/js/front/ 44 | -------------------------------------------------------------------------------- /plugin/shared/Exceptions/Webpay/CommitWebpayException.php: -------------------------------------------------------------------------------- 1 | tbkToken = $tbkToken; 14 | $this->transaction = $transaction; 15 | parent::__construct($message, $previous); 16 | } 17 | 18 | public function getTbkToken() { 19 | return $this->tbkToken; 20 | } 21 | 22 | public function getTransaction() { 23 | return $this->transaction; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /plugin/shared/Exceptions/Webpay/InvalidStatusWebpayException.php: -------------------------------------------------------------------------------- 1 | tokenWs = $tokenWs; 14 | $this->transaction = $transaction; 15 | parent::__construct($message, $previous); 16 | } 17 | 18 | public function getTokenWs() { 19 | return $this->tokenWs; 20 | } 21 | 22 | public function getTransaction() { 23 | return $this->transaction; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /plugin/shared/Exceptions/Webpay/UserCancelWebpayException.php: -------------------------------------------------------------------------------- 1 | tbkToken = $tbkToken; 15 | $this->transaction = $transaction; 16 | parent::__construct($message, $previous); 17 | } 18 | 19 | public function getTbkToken() { 20 | return $this->tbkToken; 21 | } 22 | 23 | public function getTransaction() { 24 | return $this->transaction; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /plugin/shared/Exceptions/Oneclick/FinishInscriptionOneclickException.php: -------------------------------------------------------------------------------- 1 | tbkToken = $tbkToken; 14 | $this->inscription = $inscription; 15 | parent::__construct($message, $previous); 16 | } 17 | 18 | public function getTbkToken() { 19 | return $this->tbkToken; 20 | } 21 | 22 | public function getInscription() { 23 | return $this->inscription; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /plugin/shared/Exceptions/Oneclick/TimeoutInscriptionOneclickException.php: -------------------------------------------------------------------------------- 1 | tbkToken = $tbkToken; 14 | $this->inscription = $inscription; 15 | parent::__construct($message, $previous); 16 | } 17 | 18 | public function getTbkToken() { 19 | return $this->tbkToken; 20 | } 21 | 22 | public function getInscription() { 23 | return $this->inscription; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /plugin/shared/Exceptions/Oneclick/UserCancelInscriptionOneclickException.php: -------------------------------------------------------------------------------- 1 | tbkToken = $tbkToken; 14 | $this->inscription = $inscription; 15 | parent::__construct($message, $previous); 16 | } 17 | 18 | public function getTbkToken() { 19 | return $this->tbkToken; 20 | } 21 | 22 | public function getInscription() { 23 | return $this->inscription; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /plugin/shared/Exceptions/Oneclick/InvalidStatusInscriptionOneclickException.php: -------------------------------------------------------------------------------- 1 | tbkToken = $tbkToken; 14 | $this->inscription = $inscription; 15 | parent::__construct($message, $previous); 16 | } 17 | 18 | public function getTbkToken() { 19 | return $this->tbkToken; 20 | } 21 | 22 | public function getInscription() { 23 | return $this->inscription; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /plugin/css/font-awesome/brands.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * Font Awesome Free 5.15.3 by @fontawesome - https://fontawesome.com 3 | * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) 4 | */ 5 | @font-face { 6 | font-family: 'Font Awesome 5 Brands'; 7 | font-style: normal; 8 | font-weight: 400; 9 | font-display: block; 10 | src: url("../webfonts/fa-brands-400.eot"); 11 | src: url("../webfonts/fa-brands-400.eot?#iefix") format("embedded-opentype"), url("../webfonts/fa-brands-400.woff2") format("woff2"), url("../webfonts/fa-brands-400.woff") format("woff"), url("../webfonts/fa-brands-400.ttf") format("truetype"), url("../webfonts/fa-brands-400.svg#fontawesome") format("svg"); } 12 | 13 | .fab { 14 | font-family: 'Font Awesome 5 Brands'; 15 | font-weight: 400; } 16 | -------------------------------------------------------------------------------- /plugin/css/font-awesome/solid.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * Font Awesome Free 5.15.3 by @fontawesome - https://fontawesome.com 3 | * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) 4 | */ 5 | @font-face { 6 | font-family: 'Font Awesome 5 Free'; 7 | font-style: normal; 8 | font-weight: 900; 9 | font-display: block; 10 | src: url("../webfonts/fa-solid-900.eot"); 11 | src: url("../webfonts/fa-solid-900.eot?#iefix") format("embedded-opentype"), url("../webfonts/fa-solid-900.woff2") format("woff2"), url("../webfonts/fa-solid-900.woff") format("woff"), url("../webfonts/fa-solid-900.ttf") format("truetype"), url("../webfonts/fa-solid-900.svg#fontawesome") format("svg"); } 12 | 13 | .fa, 14 | .fas { 15 | font-family: 'Font Awesome 5 Free'; 16 | font-weight: 900; } 17 | -------------------------------------------------------------------------------- /plugin/src/Helpers/RedirectorHelper.php: -------------------------------------------------------------------------------- 1 | "; 13 | foreach ($data as $name => $value) { 14 | $msg .= ""; 15 | } 16 | $msg .= ''.''; 17 | 18 | return $msg; 19 | } 20 | 21 | public static function redirect($url, array $data) 22 | { 23 | echo static::getRedirectForm($url, $data); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /plugin/css/font-awesome/regular.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * Font Awesome Free 5.15.3 by @fontawesome - https://fontawesome.com 3 | * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) 4 | */ 5 | @font-face { 6 | font-family: 'Font Awesome 5 Free'; 7 | font-style: normal; 8 | font-weight: 400; 9 | font-display: block; 10 | src: url("../webfonts/fa-regular-400.eot"); 11 | src: url("../webfonts/fa-regular-400.eot?#iefix") format("embedded-opentype"), url("../webfonts/fa-regular-400.woff2") format("woff2"), url("../webfonts/fa-regular-400.woff") format("woff"), url("../webfonts/fa-regular-400.ttf") format("truetype"), url("../webfonts/fa-regular-400.svg#fontawesome") format("svg"); } 12 | 13 | .far { 14 | font-family: 'Font Awesome 5 Free'; 15 | font-weight: 400; } 16 | -------------------------------------------------------------------------------- /plugin/shared/Exceptions/Webpay/AlreadyProcessedException.php: -------------------------------------------------------------------------------- 1 | transaction = $transaction; 19 | $this->flow = $flow; 20 | parent::__construct($message, $previous); 21 | } 22 | 23 | public function getTransaction() 24 | { 25 | return $this->transaction; 26 | } 27 | 28 | public function getFlow() 29 | { 30 | return $this->flow; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /plugin/shared/Helpers/StringUtils.php: -------------------------------------------------------------------------------- 1 | 2 |
3 |
4 | Transbank logo 5 |
6 |
7 |

Tu opinión es importante para nosotros

8 |

¿Podrías tomarte un momento para dejarnos una reseña en el repositorio de WordPress? 9 | Solo te tomará un par de minutos 10 | y nos ayudará a seguir mejorando y llegar a más personas como tú.

11 |
12 | Dejar reseña 16 |
17 | 18 | -------------------------------------------------------------------------------- /plugin/shared/Exceptions/Webpay/TimeoutWebpayException.php: -------------------------------------------------------------------------------- 1 | buyOrder = $buyOrder; 16 | $this->sessionId = $sessionId; 17 | $this->transaction = $transaction; 18 | parent::__construct($message, $previous); 19 | } 20 | 21 | public function getBuyOrder() { 22 | return $this->buyOrder; 23 | } 24 | 25 | public function getSessionId() { 26 | return $this->sessionId; 27 | } 28 | 29 | public function getTransaction() { 30 | return $this->transaction; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /plugin/shared/Exceptions/Webpay/DoubleTokenWebpayException.php: -------------------------------------------------------------------------------- 1 | tbkToken1 = $tbkToken1; 16 | $this->tbkToken2 = $tbkToken2; 17 | $this->transaction = $transaction; 18 | parent::__construct($message, $previous); 19 | } 20 | 21 | public function getTbkToken1() { 22 | return $this->tbkToken1; 23 | } 24 | 25 | public function getTbkToken2() { 26 | return $this->tbkToken2; 27 | } 28 | 29 | public function getTransaction() { 30 | return $this->transaction; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /plugin/templates/admin/order/transaction-status.php: -------------------------------------------------------------------------------- 1 | 12 | 13 |
14 | 15 | 20 | Consultar Estado 21 | 22 | 23 |
24 | 25 |
26 | 27 |

28 |
29 | 30 |
31 |
32 | -------------------------------------------------------------------------------- /plugin/shared/Exceptions/Webpay/RejectedRefundWebpayException.php: -------------------------------------------------------------------------------- 1 | token = $token; 16 | $this->transaction = $transaction; 17 | $this->refundResponse = $refundResponse; 18 | parent::__construct($message, $previous); 19 | } 20 | 21 | public function getToken() { 22 | return $this->token; 23 | } 24 | 25 | public function getTransaction() { 26 | return $this->transaction; 27 | } 28 | 29 | public function getRefundResponse() { 30 | return $this->refundResponse; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /plugin/shared/Exceptions/Oneclick/RefundOneclickException.php: -------------------------------------------------------------------------------- 1 | buyOrder = $buyOrder; 16 | $this->childBuyOrder = $childBuyOrder; 17 | $this->transaction = $transaction; 18 | parent::__construct($message, $previous); 19 | } 20 | 21 | public function getBuyOrder() { 22 | return $this->buyOrder; 23 | } 24 | 25 | public function getChildBuyOrder() { 26 | return $this->childBuyOrder; 27 | } 28 | 29 | public function getTransaction() { 30 | return $this->transaction; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /plugin/shared/Exceptions/Webpay/RejectedCommitWebpayException.php: -------------------------------------------------------------------------------- 1 | tokenWs = $tokenWs; 16 | $this->transaction = $transaction; 17 | $this->commitResponse = $commitResponse; 18 | parent::__construct($message, $previous); 19 | } 20 | 21 | public function getTokenWs() { 22 | return $this->tokenWs; 23 | } 24 | 25 | public function getTransaction() { 26 | return $this->transaction; 27 | } 28 | 29 | public function getCommitResponse() { 30 | return $this->commitResponse; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /plugin/src/Helpers/HposHelper.php: -------------------------------------------------------------------------------- 1 | wooCommerceVersion = get_option('woocommerce_version'); 15 | $this->isHposAvailable = $this->checkIfHposExists(); 16 | } 17 | public function checkIfHposExists() 18 | { 19 | return version_compare( $this->wooCommerceVersion, HposHelper::WC_VERSION_SINCE_HPOS, '>='); 20 | } 21 | 22 | public function updateMeta(WC_Order $wooCommerceOrder, $key, $value) 23 | { 24 | if($this->isHposAvailable) { 25 | $wooCommerceOrder->update_meta_data($key, $value); 26 | } 27 | else { 28 | update_post_meta($wooCommerceOrder->get_id(), $key, $value); 29 | } 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/reporte-de-error.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Reporte de Error 3 | about: Crea un reporte para ayudarnos a mejorar 4 | title: '' 5 | labels: bug 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe el bug** 11 | 12 | Una descripción concisa sobre el bug. 13 | 14 | **Para reproducir** 15 | 16 | 1. Configura '...' 17 | 2. Haz click en '...' 18 | 3. Baja hasta '...' 19 | 4. Se ve el error en '...' 20 | 21 | **Comportamiento observado** 22 | 23 | Describe de forma concisa lo que observaste siguiendo los pasos para reproducir el error. 24 | 25 | **Comportamiento esperado** 26 | 27 | Una explicación concisa y clara de qué es lo que esperas que ocurra. 28 | 29 | **Capturas de pantalla** 30 | 31 | Si aplica, agrega aquí capturas de pantalla que ayuden a explicar tu problema. 32 | 33 | **Versiones (por favor agrega aquí la siguiente información):** 34 | - Plugin: [ej. 2.2.4] 35 | - Woocommerce: [ej. 3.4] 36 | - PHP: [ej. 7.1] 37 | 38 | **Contexto adicional** 39 | 40 | Agrega cualquier otro información sobre el problema aquí. 41 | -------------------------------------------------------------------------------- /plugin/shared/Exceptions/Oneclick/RejectedInscriptionOneclickException.php: -------------------------------------------------------------------------------- 1 | tbkToken = $tbkToken; 16 | $this->inscription = $inscription; 17 | $this->finishInscriptionResponse = $finishInscriptionResponse; 18 | parent::__construct($message, $previous); 19 | } 20 | 21 | public function getTbkToken() { 22 | return $this->tbkToken; 23 | } 24 | 25 | public function getInscription() { 26 | return $this->inscription; 27 | } 28 | 29 | public function getFinishInscriptionResponse() { 30 | return $this->finishInscriptionResponse; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /plugin/src/Models/TransbankExecutionErrorLog.php: -------------------------------------------------------------------------------- 1 | $orderId, 21 | 'service' => $service, 22 | 'product' => $product, 23 | 'enviroment' => $enviroment, 24 | 'commerce_code' => $commerceCode, 25 | 'data' => $data, 26 | 'error' => $error, 27 | 'original_error' => $originalError, 28 | 'custom_error' => $customError 29 | ]); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /plugin/src/Blocks/js/webpay_checkout.js: -------------------------------------------------------------------------------- 1 | import { registerPaymentMethod } from '@woocommerce/blocks-registry'; 2 | import { decodeEntities } from '@wordpress/html-entities'; 3 | import { getSetting } from '@woocommerce/settings'; 4 | import { noticeHandler } from './notice_handler'; 5 | 6 | const settings = getSetting( 'transbank_webpay_plus_rest_data', {} ); 7 | const label = decodeEntities( settings.title ); 8 | 9 | noticeHandler(settings.id); 10 | 11 | const Content = () => { 12 | return decodeEntities( settings.description ); 13 | }; 14 | 15 | const Label = () => { 16 | const title = decodeEntities( settings.title ); 17 | const imagePath = settings.icon; 18 | const paymentImage = ( 19 | webpay plus logo 20 | ); 21 | return ( 22 |
23 | {title} 24 | {paymentImage} 25 |
26 | ); 27 | }; 28 | 29 | const TransbankWebpayBlocks = { 30 | name: settings.id, 31 | label: