From 2cd272c3f81cc52fcc7ab8e266b897ec5af28947 Mon Sep 17 00:00:00 2001 From: Jade Geels Date: Tue, 5 Mar 2024 07:30:52 +0000 Subject: [PATCH] Rapidez v2 support (#12) --- composer.json | 4 ++-- resources/js/mollie.js | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/composer.json b/composer.json index 9d66bcf..4e84ab6 100644 --- a/composer.json +++ b/composer.json @@ -17,10 +17,10 @@ "minimum-stability": "dev", "prefer-stable": true, "require": { - "php": "^8.0|^8.1", + "php": "^8.0|^8.1|^8.2", "guzzlehttp/guzzle": "^7.2", "illuminate/support": "^9.0|^10.0", - "rapidez/core": "~0.77|^1.0" + "rapidez/core": "^2.0" }, "autoload": { "psr-4": { diff --git a/resources/js/mollie.js b/resources/js/mollie.js index e1c496a..a7e76e6 100644 --- a/resources/js/mollie.js +++ b/resources/js/mollie.js @@ -1,7 +1,7 @@ document.addEventListener('turbo:load', () => { window.app.$on('checkout-credentials-saved', () => { window.app.magentoCart('get', 'mollie/payment-token').then(response => { - window.app.checkout.mollie = response.data + window.app.checkout.mollie = response }) }); @@ -10,10 +10,10 @@ document.addEventListener('turbo:load', () => { return; } window.app.checkout.doNotGoToTheNextStep = true - window.magento.post('mollie/transaction/start', { + window.magentoAPI('post', 'mollie/transaction/start', { token: window.app.checkout.mollie }).then(response => { - window.location.replace(response.data) + window.location.replace(response) }) }); })