From 02ce9f090e63cc57694285bd87c99d6800e55cf4 Mon Sep 17 00:00:00 2001 From: Marcus Dahl Date: Mon, 18 Mar 2024 13:21:28 +0100 Subject: [PATCH] feat: redirect page --- DEVELOPMENT.md | 17 ++ README.txt | 1 + assets/build/index.asset.php | 2 +- assets/build/index.css | 58 +++++ assets/build/index.css.map | 1 + assets/build/index.js | 92 +++++++- assets/build/index.js.map | 2 +- includes/pages/payment-redirect-page.php | 17 +- includes/wc-gateway-vipps-recurring.php | 3 +- includes/wc-vipps-recurring-helper.php | 7 + includes/wc-vipps-recurring-rest-api.php | 11 +- ...b_NO-d7822108c0ab896a240d9b700146be01.json | 1 + ...-payments-gateway-for-woocommerce-nb_NO.mo | Bin 17471 -> 16942 bytes ...-payments-gateway-for-woocommerce-nb_NO.po | 218 ++++++++---------- ...rring-payments-gateway-for-woocommerce.pot | 198 ++++++++-------- src/build.map.json | 2 +- src/main.scss | 69 +++++- src/pages/PaymentRedirectPage.jsx | 60 ++++- woo-vipps-recurring.php | 9 +- 19 files changed, 514 insertions(+), 254 deletions(-) create mode 100644 DEVELOPMENT.md create mode 100644 assets/build/index.css.map create mode 100644 languages/vipps-recurring-payments-gateway-for-woocommerce-nb_NO-d7822108c0ab896a240d9b700146be01.json diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md new file mode 100644 index 0000000..2ff1d55 --- /dev/null +++ b/DEVELOPMENT.md @@ -0,0 +1,17 @@ +# Vipps MobilePay Recurring - Development docs + +## Updating language files + +The easiest way to update language files is to first and foremost generate an up-to-date .pot file using wp-cli: + +```bash +wp i18n make-pot . languages/vipps-recurring-payments-gateway-for-woocommerce.pot --exclude=node_modules,assets +``` + +Now you can translate the existing languages, or create new ones, using Loco translate or a similar plugin or tool. + +Remember to make a json file from each language after editing the .po files. The json files are used by the front-end. + +```bash +wp i18n make-json languages --no-purge --use-map=src/build.map.json +``` diff --git a/README.txt b/README.txt index b8c0302..bed30af 100755 --- a/README.txt +++ b/README.txt @@ -168,6 +168,7 @@ Alternatively you could look into using WooCommerce "Early renewals": [https://d * Added: Better handling of our special action pages. * Fixed: Admin notice styling is now a bit better. * Added: A setting to automatically capture MobilePay payments now even when they are physical products in order to prevent the payment reservation from getting cancelled after 7 days. +* Added: A landing page for payments. This allows us to check the status of a payment before we redirect to the order received/receipt page. = 1.19.0 = * Added: Support for paying with MobilePay in Finland, and later Denmark. diff --git a/assets/build/index.asset.php b/assets/build/index.asset.php index 9449b3a..972b146 100644 --- a/assets/build/index.asset.php +++ b/assets/build/index.asset.php @@ -1 +1 @@ - array('react', 'wp-element'), 'version' => '442762189e908845707a'); + array('react', 'wp-api-fetch', 'wp-element', 'wp-i18n'), 'version' => '84c5c9476111a1286299'); diff --git a/assets/build/index.css b/assets/build/index.css index 6142a4c..839e021 100644 --- a/assets/build/index.css +++ b/assets/build/index.css @@ -1,4 +1,62 @@ /*!**************************************************************************************************************************************************************************************************************************************!*\ !*** css ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[4].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[4].use[2]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[4].use[3]!./src/main.scss ***! \**************************************************************************************************************************************************************************************************************************************/ +.vipps-recurring-icon { + width: 70px; +} +.vipps-recurring-payment-redirect-page { + z-index: 100000; + position: absolute; + top: 0; + left: 0; + height: 100%; + width: 100%; + background: #FFF; + color: #161225; +} +.vipps-recurring-payment-redirect-page__container { + height: 100%; + display: flex; + align-items: center; + justify-content: center; + padding: 0 15px; +} +.vipps-recurring-payment-redirect-page__container__content__logo { + display: flex; + justify-content: center; + width: 100%; +} +.vipps-recurring-payment-redirect-page__container__content__logo img { + height: 100%; + width: 150px; +} +.vipps-recurring-payment-redirect-page__container__content__loading { + display: flex; + justify-content: center; +} +.vipps-recurring-payment-redirect-page__container__content__loading__spinner { + display: inline-block; + margin: 20px 0; + width: 32px; + height: 32px; + border: 2px solid rgba(0, 0, 0, 0.3); + border-radius: 50%; + border-top-color: #161225; + animation: spin 1s ease-in-out infinite; +} +@keyframes spin { + to { + transform: rotate(360deg); + } +} +.vipps-recurring-payment-redirect-page__container__content__text { + font-size: 1.2rem; + text-align: center; +} +.vipps-recurring-payment-redirect-page__container__content__text p { + padding: 0; + margin: 0; +} + +/*# sourceMappingURL=index.css.map*/ \ No newline at end of file diff --git a/assets/build/index.css.map b/assets/build/index.css.map new file mode 100644 index 0000000..4ef1d2e --- /dev/null +++ b/assets/build/index.css.map @@ -0,0 +1 @@ +{"version":3,"file":"index.css","mappings":";;;AAAA;EACC;AACD;;AAEA;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;AACD;AACC;EACC;EACA;EACA;EACA;EACA;AACF;AAEG;EACC;EACA;EACA;AAAJ;AAEI;EACC;EACA;AAAL;AAIG;EACC;EACA;AAFJ;AAII;EAYC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;AAbL;AALK;EACC;IACC;EAOL;AACF;AAYG;EACC;EACA;AALJ;AAOI;EACC;EACA;AALL,C","sources":["webpack://vipps-mobilepay-recurring-payments/./src/main.scss"],"sourcesContent":[".vipps-recurring-icon {\n\twidth: 70px;\n}\n\n.vipps-recurring-payment-redirect-page {\n\tz-index: 100000;\n\tposition: absolute;\n\ttop: 0;\n\tleft: 0;\n\theight: 100%;\n\twidth: 100%;\n\tbackground: #FFF;\n\tcolor: #161225;\n\n\t&__container {\n\t\theight: 100%;\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tjustify-content: center;\n\t\tpadding: 0 15px;\n\n\t\t&__content {\n\t\t\t&__logo {\n\t\t\t\tdisplay: flex;\n\t\t\t\tjustify-content: center;\n\t\t\t\twidth: 100%;\n\n\t\t\t\timg {\n\t\t\t\t\theight: 100%;\n\t\t\t\t\twidth: 150px;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t&__loading {\n\t\t\t\tdisplay: flex;\n\t\t\t\tjustify-content: center;\n\n\t\t\t\t&__spinner {\n\t\t\t\t\t@keyframes spin {\n\t\t\t\t\t\tto {\n\t\t\t\t\t\t\ttransform: rotate(360deg);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t@-webkit-keyframes spin {\n\t\t\t\t\t\tto {\n\t\t\t\t\t\t\ttransform: rotate(360deg);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tdisplay: inline-block;\n\t\t\t\t\tmargin: 20px 0;\n\t\t\t\t\twidth: 32px;\n\t\t\t\t\theight: 32px;\n\t\t\t\t\tborder: 2px solid rgba(0, 0, 0, .3);\n\t\t\t\t\tborder-radius: 50%;\n\t\t\t\t\tborder-top-color: #161225;\n\t\t\t\t\tanimation: spin 1s ease-in-out infinite;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t&__text {\n\t\t\t\tfont-size: 1.2rem;\n\t\t\t\ttext-align: center;\n\n\t\t\t\tp {\n\t\t\t\t\tpadding: 0;\n\t\t\t\t\tmargin: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n"],"names":[],"sourceRoot":""} \ No newline at end of file diff --git a/assets/build/index.js b/assets/build/index.js index cba159a..de3ba22 100644 --- a/assets/build/index.js +++ b/assets/build/index.js @@ -26,6 +26,74 @@ function createApp(element, component) { /***/ }), +/***/ "./src/pages/PaymentRedirectPage.jsx": +/*!*******************************************!*\ + !*** ./src/pages/PaymentRedirectPage.jsx ***! + \*******************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ PaymentRedirectPage) +/* harmony export */ }); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); +/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); +/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/api-fetch */ "@wordpress/api-fetch"); +/* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); +/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__); + + + + +function PaymentRedirectPage() { + const { + logo + } = window.VippsMobilePaySettings; + const searchParams = new URLSearchParams(window.location.search); + + // const [response, setResponse] = useState(null) + // + // const intervalHandler = setInterval(() => { + // apiFetch({ + // path: `/vipps-mobilepay-recurring/v1/orders/status/${searchParams.get( + // 'order_id')}?key=${searchParams.get('key')}`, method: 'GET', + // }).then(response => setResponse(response)) + // }, 1000) + // + // useEffect(() => { + // if (!response || response.status === 'PENDING') { + // return + // } + // + // clearInterval(intervalHandler) + // window.location.href = response.redirect_url + // }, [response]) + + return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { + className: 'vipps-recurring-payment-redirect-page' + }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { + className: 'vipps-recurring-payment-redirect-page__container' + }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { + className: 'vipps-recurring-payment-redirect-page__container__content' + }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { + className: 'vipps-recurring-payment-redirect-page__container__content__logo' + }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("img", { + src: logo, + alt: "Logo" + })), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { + className: 'vipps-recurring-payment-redirect-page__container__content__loading' + }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { + className: 'vipps-recurring-payment-redirect-page__container__content__loading__spinner' + })), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { + className: 'vipps-recurring-payment-redirect-page__container__content__text' + }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", null, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Verifying your payment. Please wait.', 'vipps-recurring-payments-gateway-for-woocommerce')), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", null, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('You will be redirected shortly.', 'vipps-recurring-payments-gateway-for-woocommerce')))))); +} + +/***/ }), + /***/ "./src/main.scss": /*!***********************!*\ !*** ./src/main.scss ***! @@ -48,6 +116,16 @@ module.exports = window["React"]; /***/ }), +/***/ "@wordpress/api-fetch": +/*!**********************************!*\ + !*** external ["wp","apiFetch"] ***! + \**********************************/ +/***/ ((module) => { + +module.exports = window["wp"]["apiFetch"]; + +/***/ }), + /***/ "@wordpress/element": /*!*********************************!*\ !*** external ["wp","element"] ***! @@ -56,6 +134,16 @@ module.exports = window["React"]; module.exports = window["wp"]["element"]; +/***/ }), + +/***/ "@wordpress/i18n": +/*!******************************!*\ + !*** external ["wp","i18n"] ***! + \******************************/ +/***/ ((module) => { + +module.exports = window["wp"]["i18n"]; + /***/ }) /******/ }); @@ -137,11 +225,13 @@ __webpack_require__.r(__webpack_exports__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _main_scss__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./main.scss */ "./src/main.scss"); /* harmony import */ var _lib_create_app__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./lib/create-app */ "./src/lib/create-app.js"); +/* harmony import */ var _pages_PaymentRedirectPage__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./pages/PaymentRedirectPage */ "./src/pages/PaymentRedirectPage.jsx"); + if (document.getElementById("vipps-mobilepay-recurring-app")) { - (0,_lib_create_app__WEBPACK_IMPORTED_MODULE_2__["default"])(document.querySelector("#vipps-mobilepay-recurring-app"), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", null)); + (0,_lib_create_app__WEBPACK_IMPORTED_MODULE_2__["default"])(document.querySelector("#vipps-mobilepay-recurring-app"), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_pages_PaymentRedirectPage__WEBPACK_IMPORTED_MODULE_3__["default"], null)); } })(); diff --git a/assets/build/index.js.map b/assets/build/index.js.map index 2a14517..e347af9 100644 --- a/assets/build/index.js.map +++ b/assets/build/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","mappings":";;;;;;;;;;;;;;;;AAAwD;AAEzC,SAASE,SAASA,CAACC,OAAO,EAAEC,SAAS,EAAE;EACpD,IAAIJ,0DAAU,EAAE;IACd,MAAMK,IAAI,GAAGL,8DAAU,CAACG,OAAO,CAAC;IAChCE,IAAI,CAACJ,MAAM,CAACG,SAAS,CAAC;EACxB,CAAC,MAAM;IACLH,0DAAM,CAACG,SAAS,EAAED,OAAO,CAAC;EAC5B;AACF;;;;;;;;;;;ACTA;;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;UCAA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;WCtBA;WACA;WACA;WACA;WACA;WACA,iCAAiC,WAAW;WAC5C;WACA;;;;;WCPA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;;;;;;;;;;;;ACNqB;AACoB;AAEzC,IAAIG,QAAQ,CAACC,cAAc,CAAC,+BAA+B,CAAC,EAAE;EAC5DL,2DAAS,CAACI,QAAQ,CAACE,aAAa,CAAC,gCAAgC,CAAC,EAAEC,oDAAA,YAAM,CAAC,CAAC;AAC9E,C","sources":["webpack://vipps-mobilepay-recurring-payments/./src/lib/create-app.js","webpack://vipps-mobilepay-recurring-payments/./src/main.scss","webpack://vipps-mobilepay-recurring-payments/external window \"React\"","webpack://vipps-mobilepay-recurring-payments/external window [\"wp\",\"element\"]","webpack://vipps-mobilepay-recurring-payments/webpack/bootstrap","webpack://vipps-mobilepay-recurring-payments/webpack/runtime/compat get default export","webpack://vipps-mobilepay-recurring-payments/webpack/runtime/define property getters","webpack://vipps-mobilepay-recurring-payments/webpack/runtime/hasOwnProperty shorthand","webpack://vipps-mobilepay-recurring-payments/webpack/runtime/make namespace object","webpack://vipps-mobilepay-recurring-payments/./src/index.js"],"sourcesContent":["import { createRoot, render } from \"@wordpress/element\";\n\nexport default function createApp(element, component) {\n if (createRoot) {\n const root = createRoot(element);\n root.render(component);\n } else {\n render(component, element);\n }\n}\n","// extracted by mini-css-extract-plugin\nexport {};","module.exports = window[\"React\"];","module.exports = window[\"wp\"][\"element\"];","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import \"./main.scss\";\nimport createApp from \"./lib/create-app\";\n\nif (document.getElementById(\"vipps-mobilepay-recurring-app\")) {\n createApp(document.querySelector(\"#vipps-mobilepay-recurring-app\"),
);\n}\n"],"names":["createRoot","render","createApp","element","component","root","document","getElementById","querySelector","createElement"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"index.js","mappings":";;;;;;;;;;;;;;;;AAAwD;AAEzC,SAASE,SAASA,CAACC,OAAO,EAAEC,SAAS,EAAE;EACpD,IAAIJ,0DAAU,EAAE;IACd,MAAMK,IAAI,GAAGL,8DAAU,CAACG,OAAO,CAAC;IAChCE,IAAI,CAACJ,MAAM,CAACG,SAAS,CAAC;EACxB,CAAC,MAAM;IACLH,0DAAM,CAACG,SAAS,EAAED,OAAO,CAAC;EAC5B;AACF;;;;;;;;;;;;;;;;;;;;;;;ACTwD;AACb;AACP;AAErB,SAASO,mBAAmBA,CAAA,EAAI;EAC9C,MAAM;IAAEC;EAAK,CAAC,GAAGC,MAAM,CAACC,sBAAsB;EAC9C,MAAMC,YAAY,GAAG,IAAIC,eAAe,CAACH,MAAM,CAACI,QAAQ,CAACC,MAAM,CAAC;;EAEhE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;EAEA,OAAQC,oDAAA;IAAKC,SAAS,EAAE;EAAwC,GAC9DD,oDAAA;IAAKC,SAAS,EAAE;EAAmD,GAClED,oDAAA;IACCC,SAAS,EAAE;EAA4D,GACvED,oDAAA;IACCC,SAAS,EAAE;EAAkE,GAC7ED,oDAAA;IAAKE,GAAG,EAAET,IAAK;IAACU,GAAG,EAAC;EAAM,CAAC,CACvB,CAAC,EACNH,oDAAA;IACCC,SAAS,EAAE;EAAqE,GAChFD,oDAAA;IACCC,SAAS,EAAE;EAA8E,CAAC,CACvF,CAAC,EACND,oDAAA;IACCC,SAAS,EAAE;EAAkE,GAC7ED,oDAAA,YACET,mDAAE,CAAC,sCAAsC,EACzC,kDAAkD,CACjD,CAAC,EAEJS,oDAAA,YACET,mDAAE,CAAC,iCAAiC,EACpC,kDAAkD,CACjD,CACC,CACD,CACD,CACD,CAAC;AACR;;;;;;;;;;;ACtDA;;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;UCAA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;WCtBA;WACA;WACA;WACA;WACA;WACA,iCAAiC,WAAW;WAC5C;WACA;;;;;WCPA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;;;;;;;;;;;;;ACNqB;AACoB;AACqB;AAE9D,IAAIa,QAAQ,CAACC,cAAc,CAAC,+BAA+B,CAAC,EAAE;EAC5DrB,2DAAS,CAACoB,QAAQ,CAACE,aAAa,CAAC,gCAAgC,CAAC,EAAEN,oDAAA,CAACR,kEAAmB,MAAC,CAAC,CAAC;AAC7F,C","sources":["webpack://vipps-mobilepay-recurring-payments/./src/lib/create-app.js","webpack://vipps-mobilepay-recurring-payments/./src/pages/PaymentRedirectPage.jsx","webpack://vipps-mobilepay-recurring-payments/./src/main.scss","webpack://vipps-mobilepay-recurring-payments/external window \"React\"","webpack://vipps-mobilepay-recurring-payments/external window [\"wp\",\"apiFetch\"]","webpack://vipps-mobilepay-recurring-payments/external window [\"wp\",\"element\"]","webpack://vipps-mobilepay-recurring-payments/external window [\"wp\",\"i18n\"]","webpack://vipps-mobilepay-recurring-payments/webpack/bootstrap","webpack://vipps-mobilepay-recurring-payments/webpack/runtime/compat get default export","webpack://vipps-mobilepay-recurring-payments/webpack/runtime/define property getters","webpack://vipps-mobilepay-recurring-payments/webpack/runtime/hasOwnProperty shorthand","webpack://vipps-mobilepay-recurring-payments/webpack/runtime/make namespace object","webpack://vipps-mobilepay-recurring-payments/./src/index.js"],"sourcesContent":["import { createRoot, render } from \"@wordpress/element\";\n\nexport default function createApp(element, component) {\n if (createRoot) {\n const root = createRoot(element);\n root.render(component);\n } else {\n render(component, element);\n }\n}\n","import { useEffect, useState } from '@wordpress/element'\nimport apiFetch from '@wordpress/api-fetch'\nimport { __ } from '@wordpress/i18n'\n\nexport default function PaymentRedirectPage () {\n\tconst { logo } = window.VippsMobilePaySettings\n\tconst searchParams = new URLSearchParams(window.location.search)\n\n\t// const [response, setResponse] = useState(null)\n\t//\n\t// const intervalHandler = setInterval(() => {\n\t// \tapiFetch({\n\t// \t\tpath: `/vipps-mobilepay-recurring/v1/orders/status/${searchParams.get(\n\t// \t\t\t'order_id')}?key=${searchParams.get('key')}`, method: 'GET',\n\t// \t}).then(response => setResponse(response))\n\t// }, 1000)\n\t//\n\t// useEffect(() => {\n\t// \tif (!response || response.status === 'PENDING') {\n\t// \t\treturn\n\t// \t}\n\t//\n\t// \tclearInterval(intervalHandler)\n\t// \twindow.location.href = response.redirect_url\n\t// }, [response])\n\n\treturn (
\n\t\t\t
\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\"Logo\"/\n\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\t

\n\t\t\t\t\t\t\t{__('Verifying your payment. Please wait.',\n\t\t\t\t\t\t\t\t'vipps-recurring-payments-gateway-for-woocommerce')}\n\t\t\t\t\t\t

\n\n\t\t\t\t\t\t

\n\t\t\t\t\t\t\t{__('You will be redirected shortly.',\n\t\t\t\t\t\t\t\t'vipps-recurring-payments-gateway-for-woocommerce')}\n\t\t\t\t\t\t

\n\t\t\t\t\t
\n\t\t\t\t\n\t\t\t\n\t\t)\n}\n","// extracted by mini-css-extract-plugin\nexport {};","module.exports = window[\"React\"];","module.exports = window[\"wp\"][\"apiFetch\"];","module.exports = window[\"wp\"][\"element\"];","module.exports = window[\"wp\"][\"i18n\"];","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import \"./main.scss\";\nimport createApp from \"./lib/create-app\";\nimport PaymentRedirectPage from \"./pages/PaymentRedirectPage\";\n\nif (document.getElementById(\"vipps-mobilepay-recurring-app\")) {\n createApp(document.querySelector(\"#vipps-mobilepay-recurring-app\"), );\n}\n"],"names":["createRoot","render","createApp","element","component","root","useEffect","useState","apiFetch","__","PaymentRedirectPage","logo","window","VippsMobilePaySettings","searchParams","URLSearchParams","location","search","createElement","className","src","alt","document","getElementById","querySelector"],"sourceRoot":""} \ No newline at end of file diff --git a/includes/pages/payment-redirect-page.php b/includes/pages/payment-redirect-page.php index 03aeb5f..f80d79e 100644 --- a/includes/pages/payment-redirect-page.php +++ b/includes/pages/payment-redirect-page.php @@ -2,14 +2,19 @@ defined( 'ABSPATH' ) || exit; -get_header(); - ?> -
+ +> + + + - + -get_footer(); + +
-?> + + diff --git a/includes/wc-gateway-vipps-recurring.php b/includes/wc-gateway-vipps-recurring.php index 30a2865..a80786e 100755 --- a/includes/wc-gateway-vipps-recurring.php +++ b/includes/wc-gateway-vipps-recurring.php @@ -1451,8 +1451,7 @@ public function process_payment( $order_id, bool $retry = true, bool $previous_e $agreement_url = get_home_url(); } - // todo: point to our new page for payment redirection - $redirect_url = $this->get_return_url( $order ); + $redirect_url = WC_Vipps_Recurring_Helper::get_payment_redirect_url($order); // total no longer returns the order amount when gateway is being changed $agreement_total = $is_gateway_change ? $subscription->get_subtotal() : $subscription->get_total(); diff --git a/includes/wc-vipps-recurring-helper.php b/includes/wc-vipps-recurring-helper.php index ad4b7d4..be6f0f3 100755 --- a/includes/wc-vipps-recurring-helper.php +++ b/includes/wc-vipps-recurring-helper.php @@ -458,4 +458,11 @@ public static function reduce_stock_for_order( $order ): void { ? $order->reduce_order_stock() : wc_reduce_stock_levels( self::get_id( $order ) ); } + + public static function get_payment_redirect_url( WC_Order $order ): string { + $order_id = self::get_id( $order ); + $order_key = $order->get_order_key(); + + return home_url() . "/vipps-mobilepay-recurring-payment?order_id=$order_id&key=$order_key"; + } } diff --git a/includes/wc-vipps-recurring-rest-api.php b/includes/wc-vipps-recurring-rest-api.php index c6a72d0..de9a003 100644 --- a/includes/wc-vipps-recurring-rest-api.php +++ b/includes/wc-vipps-recurring-rest-api.php @@ -32,9 +32,7 @@ public function init() { register_rest_route( $this->api_namespace, '/orders/status/(?P[0-9]+)', [ 'methods' => 'GET', 'callback' => [ $this, 'order_status' ], - 'permission_callback' => function () { - return current_user_can( '__return_true' ); - } + 'permission_callback' => '__return_true' ] ); } @@ -48,6 +46,7 @@ public function order_status( WP_REST_Request $request ) { $order_key = $request->get_param( 'key' ); $order = wc_get_order( $order_id ); + if ( ! $order || $order_key !== $order->get_order_key() ) { return new WP_Error( 'not_found', @@ -57,10 +56,12 @@ public function order_status( WP_REST_Request $request ) { } $this->gateway->check_charge_status( $order_id ); - $order = wc_get_order( $order_id ); + + $agreement_id = WC_Vipps_Recurring_Helper::get_agreement_id_from_order( $order ); + $agreement = WC_Gateway_Vipps_Recurring::get_instance()->api->get_agreement( $agreement_id ); return [ - 'status' => $order->get_status(), + 'status' => $agreement->status, 'redirect_url' => $order->get_checkout_order_received_url() ]; } diff --git a/languages/vipps-recurring-payments-gateway-for-woocommerce-nb_NO-d7822108c0ab896a240d9b700146be01.json b/languages/vipps-recurring-payments-gateway-for-woocommerce-nb_NO-d7822108c0ab896a240d9b700146be01.json new file mode 100644 index 0000000..509bd96 --- /dev/null +++ b/languages/vipps-recurring-payments-gateway-for-woocommerce-nb_NO-d7822108c0ab896a240d9b700146be01.json @@ -0,0 +1 @@ +{"translation-revision-date":"2024-03-18 09:26+0000","generator":"WP-CLI\/2.8.1","source":"assets\/build\/index.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"nb_NO","plural-forms":"nplurals=2; plural=n != 1;"},"Verifying your payment. Please wait.":["Vennligst vent mens vi sjekker betalingen din."],"You will be redirected shortly.":["Du blir straks videresendt."]}}} \ No newline at end of file diff --git a/languages/vipps-recurring-payments-gateway-for-woocommerce-nb_NO.mo b/languages/vipps-recurring-payments-gateway-for-woocommerce-nb_NO.mo index 9273cdafd63d8e24aee9e43faf51b112b6a66cd1..416a71e1dd1247e962c58e9e691c7c188dc686ef 100644 GIT binary patch delta 2732 zcmaLYd2AGA9LDi?+d@kzR}W}8%2Yr(Yzwr|Qd=mr6&JxSP#`FzZrPzsyWOobvxQZ( zp&$^VLbHH)P*6Y=l^6zsf?NVh&=8ME2#KH^QU4I|0waiie{78=CN^n5@4P$j^}O%9 zJ+#ubbD698Tyoqx#ZNQ8efdp|lP9H;68^D*Vi%s@#OWv>{mGxXn9zxLaXz}y!eMv- zC*k)v67v(4>VUOKm1@AjGVDSM-Kf}%8Tbxv!jmWi)pd?Guy72|PojosYa36NZOUSG0SDb`#R7$^~nt(FlDvZb4_U9nVI4#&L4K`6&if^Dqnw_dt3>INJ zmY{|+QI5w#l&xBf58`^1b{9|vx{9*G8z>WrO^a?(8WMth;GZN#q=!%O_R_4XS_!7>+Ia#EI?_mobKp&RU zne?*_C*yH6FnK^UspiELIPhvY%HFO;j)8gs&$*O(8ztIj1}XIl9zfaSYVx0rwJ3Xk z1S|0r%0e>liGCkULb(lVQO?>yl~UxE6VlTkKOSU&c*X6{g&i#!x&$=DaZ@Uko43# z9Ea~?BHqG$jL(fuuoxxkCvYczjA!w2_DSBK!K`GWkD?@MVmv;JU2q+8PSqB?bN>%h zu&6lM{=!&JTrAI%k?mFr}{|e2DY$Qyh;4EL#k>yB}qsKQIeBv(fC5%0@1dnvK%WB9#9LEw}>@ z;sG>96T6GW6hyy4^+NKetacP~_3#23_yl+CDZGrF8|5qFpy6tij&GpciaZ`P^dY;X zo<>P%H_BPq*Z%oexRK}E*n}?^^B)jXnoFYJa7!?oisL9>BtIiJPo;ArWuRh|t!O}r zGJ=QjG`ev;2POu;#*KIp!?>hWsXllUP3%RS7Op}`s`qUQ5@`ax%AWVc6!~C+Q%Rz1`0@l3Ct zR#7%%+BEk=6RWE#rdL%@sVuLEoa;AhfNmP|!_q7q44GP^H{75H>>SPG*S(gmE%X|8 zj+2+k;;;3;8JihhRgKP4e1@sdvvr?lEeM*nKb)gxM?UM38p-UI66rqhOk!U4h(c}n zn4*!Rou3AdjB^Ty>~=Y~hJNmH3bTu2`rKJ8DTXXHz1|FIjYqfT-YIySBA((jcWvF# zcTLS}OL)3AKWOS!BQ=&^H?d|B2BuZ2MnXF3ueo>%`}kyPRG5wK0*= z1r4352=dO@kyi`8bG|HmF0QCt4+M0L=zIprF^I%y*L7 z)5wr*F*K`AudkO0>$cZV$n@+p0y)m^l17)~8FwbOZ+WPFHMZ%kmo`3~mCDj`ROHCe OtjN_-36ZH~SN;O84bOW3 delta 3136 zcmYk+du$xV9l-H9+rf_WwoR}@Y$k6zaU5d%V#l$`%O%oo}jU`f3sl#8&*B))of9qiE0lpJaWkGq zjsHQ}z!Lu3f@^RgCNPdZw&Bxw1V6?OwC2%=_0^*k_R>%`KibH3$lB@vUW9q9z+15u zkK%fK9a&qQMTy>jQTpA%DP+F;P$K#X?!p+mT7|vXfLWZ+`sx=HWTGdr6Q7e0_%+G| z5*|rGElPU=yU@ie@weEG-{HO3$u3^Qw^1T?Z>3TWK7@2p`AegmpTaw6{{jn`AzTunPf>Df)he|Qk75gc zh?ikiU3B|fQ6k)d%kjq}6pmB48SlbsdauJ1_y>FoF%P%)mvQB*5npq#&tY8N|21su7!7w~ zAJ#T1WnvoTByXb(tY=rVu^naN9mus&d+`cPBhgh);2iuT`uG==OWxlUo%{yeDE+X9 z_0{_nWZ-2Rq92AGxRAPyGSO`)zgTxqx4({(>-TUgp2KqNBpJ&a?JYMkq*#PNLj_Q_~+N z@i_JW;V>R2p|a5`5XC$(DKuIl^5!{_s43pc{{0{tgjQUY51njx;kY!N$saiy*yYndxiFLX2LRT zZ#h#9nrdg%&(Mx}aH=JIZr-M%vJKsqXAIb8xM$(Nikx0w+u3Z!)3%i{bs?MA31enM z)LfQHny$7S_R*w!Q!HnB`k>)yLl0S=Z=4^ceYc>EL4&>n1)WHniHzk8>TKShZtZ9Y zw^we7t=W_H%?|w|(=**+!?&`IC-YyO9k6V3pHbl0wyg)u;QET{wR9UYhX&Y!pVeO4 z%4vf$r}B16I-TF4*A(7TwXdi$3V}8f(Yz9f;LPHmh2|x(Si96@p1f!36!Du5*i>-5 z#wY~F1p&zA-9*~(%<#tQi%NpWmR=jy)gFzNP7e!=+EwAN>%K1zS{79V`)VtKua>`G z-n_nfquzLVM{8^Nrxnd5mHmd}Nq$|QBl(6+NS>`f8C!5=*7ZHp_w^8|U*!ciZ`R?v z4PmUl-!@#*Yh{S+#AA|U$JA3Z=xi?MGK8uVrM&KZ$~`M-s=ZMM?G&`s!z1guNcjGY zo7cv0*x9tQIMr?Xn!sza;$?@l;p?P)v8G7bQ&1jX t5{_=lmjo?a_J=38II&=4bw#;MWJtbM@ZfqKwsgHw9AsB73);7T`+wXvQXT*R diff --git a/languages/vipps-recurring-payments-gateway-for-woocommerce-nb_NO.po b/languages/vipps-recurring-payments-gateway-for-woocommerce-nb_NO.po index 3b4c60f..b27aeb6 100644 --- a/languages/vipps-recurring-payments-gateway-for-woocommerce-nb_NO.po +++ b/languages/vipps-recurring-payments-gateway-for-woocommerce-nb_NO.po @@ -2,7 +2,7 @@ # This file is distributed under the same license as the Plugins - Vipps/MobilePay recurring payments for WooCommerce - Development (trunk) package. msgid "" msgstr "" -"PO-Revision-Date: 2024-02-21 10:44+0000\n" +"PO-Revision-Date: 2024-03-18 09:26+0000\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" @@ -22,7 +22,7 @@ msgstr "" msgid "A list of possible failure reasons and what they mean can be found %s" msgstr "En liste med feilkoder og hva de betyr finnes %s" -#: includes/wc-gateway-vipps-recurring.php:975 +#: includes/wc-gateway-vipps-recurring.php:902 msgid "" "A temporary error occurred when refunding a payment through Vipps MobilePay. " "Please ensure the order is refunded manually or reset the order to " @@ -45,7 +45,7 @@ msgstr "" "Klarna Checkout" #. translators: Vipps/MobilePay Agreement ID -#: includes/wc-gateway-vipps-recurring.php:1684 +#: includes/wc-gateway-vipps-recurring.php:1612 msgid "" "Agreement created: %s. Customer sent to Vipps/MobilePay for confirmation." msgstr "" @@ -57,11 +57,11 @@ msgstr "" msgid "Agreement ID" msgstr "Agreement ID" -#: includes/admin/vipps-recurring-settings.php:100 +#: includes/admin/vipps-recurring-settings.php:94 msgid "Amount of charges to check per status check" msgstr "Mengde trekk å sjekke status på per sjekk" -#: includes/wc-gateway-vipps-recurring.php:999 +#: includes/wc-gateway-vipps-recurring.php:926 msgid "" "An unexpected error occurred while refunding a payment in Vipps/MobilePay." msgstr "" @@ -76,27 +76,23 @@ msgstr "Trekk betalinger via MobilePay automatisk" msgid "Brand" msgstr "Merkevare" -#: includes/wc-gateway-vipps-recurring.php:1976 +#: includes/wc-gateway-vipps-recurring.php:1903 msgid "Cancelled" msgstr "Kansellert" -#: includes/wc-gateway-vipps-recurring.php:2058 +#: includes/wc-gateway-vipps-recurring.php:1985 msgid "Cancelled due charge in Vipps/MobilePay." msgstr "Kansellerte ventende trekk i Vipps/MobilePay." -#: woo-vipps-recurring.php:163 -msgid "Cancelled payment" -msgstr "Kansellert betaling" - -#: woo-vipps-recurring.php:636 +#: woo-vipps-recurring.php:675 msgid "Capture payment" msgstr "Trekk beløp" -#: woo-vipps-recurring.php:561 +#: woo-vipps-recurring.php:600 msgid "Capture payment instantly" msgstr "Trekk betaling umiddelbart" -#: woo-vipps-recurring.php:562 +#: woo-vipps-recurring.php:601 msgid "" "Capture payment instantly even if the product is not virtual. Please make " "sure you are following the local jurisdiction in your country when using " @@ -111,7 +107,7 @@ msgid "Captured" msgstr "Beløp trukket" #. translators: Vipps/MobilePay Charge ID -#: includes/wc-gateway-vipps-recurring.php:761 +#: includes/wc-gateway-vipps-recurring.php:688 msgid "Charge completed (Charge ID: %s)" msgstr "Trekk fullført (Charge ID: %s)" @@ -142,11 +138,6 @@ msgstr "client_id" msgid "client_secret" msgstr "client_secret" -#. translators: %s: brand name, Vipps or MobilePay -#: assets/js/vipps-recurring-payment-method-block.js:49 -msgid "Continue with %s" -msgstr "Fortsett med %s" - #: includes/admin/vipps-recurring-settings.php:18 msgid "Controls the payment flow brand (Vipps or MobilePay)." msgstr "" @@ -154,11 +145,11 @@ msgstr "" "MobilePay)." #. translators: %s: the error message returned from Vipps/MobilePay -#: includes/wc-gateway-vipps-recurring.php:1870 +#: includes/wc-gateway-vipps-recurring.php:1799 msgid "Could not authenticate with the Vipps/MobilePay API: %s" msgstr "Kunne ikke autentisere med Vipps/MobilePay API-et: %s" -#: includes/wc-gateway-vipps-recurring.php:2062 +#: includes/wc-gateway-vipps-recurring.php:1989 msgid "" "Could not cancel charge in Vipps/MobilePay. Please manually check the status " "of this order if you plan to process a new renewal order!" @@ -167,7 +158,7 @@ msgstr "" "statusen på denne ordren dersom du har planer om å opprette en ny fornyelse!" #. translators: %s: The charge's status -#: includes/wc-gateway-vipps-recurring.php:1159 +#: includes/wc-gateway-vipps-recurring.php:1086 msgid "" "Could not capture charge because the status is not RESERVED or " "PARTIALLY_CAPTURED. Found status: %s" @@ -176,41 +167,29 @@ msgstr "" "PARTIALLY_CAPTURED. Fant status: %s" #. translators: %s order id -#: includes/wc-gateway-vipps-recurring.php:1223 +#: includes/wc-gateway-vipps-recurring.php:1150 msgid "Could not capture Vipps/MobilePay payment for order id: %s" msgstr "" "Kunne ikke trekke betaling i Vipps/MobilePay for betaling med ordre ID: %s" -#: includes/wc-gateway-vipps-recurring.php:408 -msgid "" -"Could not create or find the \"Vipps/MobilePay Recurring Payments specials\" " -"page" -msgstr "" -"Klarte ikke å finne eller opprette en \"Vipps/MobilePay Recurring Payments " -"specials\" side" - -#: includes/admin/vipps-recurring-settings.php:71 -msgid "Create a new page" -msgstr "Opprett ny side" - #: includes/admin/list-tables/wc-vipps-recurring-list-table-failed-charges.php:171 #: includes/admin/list-tables/wc-vipps-recurring-list-table-pending-charges.php:172 msgid "Created At" msgstr "Tidspunkt" -#: woo-vipps-recurring.php:575 +#: woo-vipps-recurring.php:614 msgid "Custom" msgstr "Egendefinert" -#: woo-vipps-recurring.php:582 +#: woo-vipps-recurring.php:621 msgid "Custom description" msgstr "Egendefinert beskrivelse" -#: includes/admin/vipps-recurring-settings.php:75 +#: includes/admin/vipps-recurring-settings.php:69 msgid "Default status to give orders with a reserved charge" msgstr "Standardstatus for ordre med reservert trekk i Vipps/MobilePay" -#: includes/admin/vipps-recurring-settings.php:84 +#: includes/admin/vipps-recurring-settings.php:78 msgid "Default status to give pending renewal orders" msgstr "Standardstatus for fornyelsesordre" @@ -227,12 +206,12 @@ msgstr "" "Beskrivelse for Vipps/MobilePay faste betalinger metoden. Dette kontrollerer " "beskrivelsen som kunden ser i checkout." -#: woo-vipps-recurring.php:569 +#: woo-vipps-recurring.php:608 msgid "Description source" msgstr "Beskrivelseskilde" #. translators: %s: brand (Vipps or MobilePay) -#: includes/wc-gateway-vipps-recurring.php:1481 +#: includes/wc-gateway-vipps-recurring.php:1408 msgid "" "Different subscription products can not be purchased at the same time using " "%s." @@ -249,10 +228,14 @@ msgid "" msgstr "Skrur av \"Velg en annen betalingsløsning\"-knappen i Klarna Checkout." #. translators: amount of orders checked -#: woo-vipps-recurring.php:529 +#: woo-vipps-recurring.php:568 msgid "Done. Checked the status of %s orders" msgstr "Sånn. Sjekket status på %s ordre" +#: includes/admin/vipps-recurring-settings.php:118 +msgid "Enable test mode" +msgstr "Skru på testmodus" + #: includes/admin/vipps-recurring-settings.php:10 msgid "Enable Vipps/MobilePay Recurring Payments" msgstr "Skru på Vipps/MobilePay Faste Betalinger" @@ -261,6 +244,13 @@ msgstr "Skru på Vipps/MobilePay Faste Betalinger" msgid "Enable/Disable" msgstr "Skru på/Skru av" +#: includes/admin/vipps-recurring-settings.php:120 +msgid "" +"Enabling this will route all API requests to the Vipps MobilePay test API." +msgstr "" +"Denne innstillingen gjør at alle forespørsler blir sendt mot Vipps MobilePay " +"sitt test API." + #. Author of the plugin msgid "Everyday AS" msgstr "Everyday AS" @@ -274,11 +264,11 @@ msgid "Failed Charges" msgstr "Mislykkede trekk" #. translators: Error message -#: includes/wc-gateway-vipps-recurring.php:890 +#: includes/wc-gateway-vipps-recurring.php:817 msgid "Failed creating a charge: %s" msgstr "Mislyktes med å opprette et trekk: %s" -#: woo-vipps-recurring.php:531 +#: woo-vipps-recurring.php:570 msgid "Failed to finish checking the status of all orders. Please try again." msgstr "Klarte ikke hente status på alle ordre. Vennligst prøv igjen." @@ -304,7 +294,7 @@ msgstr "her" msgid "https://everyday.no" msgstr "https://everyday.no" -#: woo-vipps-recurring.php:583 +#: woo-vipps-recurring.php:622 msgid "If the description source is set to \"custom\" this text will be used." msgstr "" "Hvis beskrivelseskilden er satt til \"egendefinert\" vil denne teksten bli " @@ -333,29 +323,20 @@ msgstr "" msgid "Image url" msgstr "Bildelenke" -#. translators: %s: brand (Vipps or MobilePay) -#: woo-vipps-recurring.php:165 -msgid "" -"It looks like you cancelled your order in %s. If this was a mistake you can " -"try again by checking out again :)" -msgstr "" -"Det ser ut som at du avlyste betalingen i %s. Hvis dette var et uhell så kan " -"du sjekke ut på nytt :)" - #: includes/admin/list-tables/wc-vipps-recurring-list-table-failed-charges.php:170 #: includes/admin/list-tables/wc-vipps-recurring-list-table-pending-charges.php:171 msgid "Latest API Status" msgstr "Nyeste API status" -#: includes/admin/vipps-recurring-settings.php:117 +#: includes/admin/vipps-recurring-settings.php:111 msgid "Log debug messages" msgstr "Logg feilsøkingsmeldinger" -#: includes/admin/vipps-recurring-settings.php:116 +#: includes/admin/vipps-recurring-settings.php:110 msgid "Logging" msgstr "Logging" -#: woo-vipps-recurring.php:584 +#: woo-vipps-recurring.php:623 msgid "Max 100 characters" msgstr "Maks 100 tegn" @@ -367,7 +348,7 @@ msgstr "Merchant Serial Number (MSN)" msgid "MobilePay" msgstr "MobilePay" -#: includes/wc-gateway-vipps-recurring.php:636 +#: includes/wc-gateway-vipps-recurring.php:563 msgid "" "MobilePay payments are automatically captured to prevent the payment " "reservation from automatically getting cancelled after 7 days." @@ -375,7 +356,7 @@ msgstr "" "Betalinger med MobilePay er automatisk trukket slik at reservasjonen ikke " "blir automatisk kansellert etter 7 dager." -#: includes/admin/vipps-recurring-settings.php:112 +#: includes/admin/vipps-recurring-settings.php:106 msgid "Newest first" msgstr "Nyeste først" @@ -391,18 +372,10 @@ msgstr "Ingen trekk har mislykket foreløpig." msgid "No response from Vipps/MobilePay" msgstr "Mottok ikke et svar fra Vipps/MobilePay" -#: woo-vipps-recurring.php:573 +#: woo-vipps-recurring.php:612 msgid "None" msgstr "Ingen" -#: assets/js/vipps-recurring-admin.js:77 -msgid "" -"Note: Reservations in MobilePay will be cancelled after 7 days. Remember to " -"ship and fulfill your orders." -msgstr "" -"NB: Reservasjoner i MobilePay blir kansellert etter 7 dager. Husk å sende og " -"fullføre ordrene deres." - #: includes/admin/vipps-recurring-settings.php:61 msgid "Ocp-Apim-Subscription-Key" msgstr "Ocp-Apim-Subscription-Key" @@ -413,16 +386,16 @@ msgid "" msgstr "" "Tilby faste betalinger med Vipps/MobilePay for WooCommerce Subscriptions" -#: includes/admin/vipps-recurring-settings.php:111 +#: includes/admin/vipps-recurring-settings.php:105 msgid "Oldest first" msgstr "Eldste først" -#: includes/wc-gateway-vipps-recurring.php:1987 +#: includes/wc-gateway-vipps-recurring.php:1914 msgid "On hold" msgstr "På vent" #. translators: %s: brand name, Vipps or MobilePay -#: includes/wc-gateway-vipps-recurring.php:164 +#: includes/wc-gateway-vipps-recurring.php:162 msgid "Pay with %s" msgstr "Betal med %s" @@ -431,11 +404,11 @@ msgstr "Betal med %s" msgid "Pay with {brand}." msgstr "Betal med {brand}." -#: includes/wc-gateway-vipps-recurring.php:1276 +#: includes/wc-gateway-vipps-recurring.php:1203 msgid "Payment gateway change request cancelled in Vipps/MobilePay" msgstr "Forespørsel om bytte av betalingsmiddel avbrutt i Vipps/MobilePay" -#: includes/wc-gateway-vipps-recurring.php:1965 +#: includes/wc-gateway-vipps-recurring.php:1892 msgid "Pending cancellation" msgstr "Venter på kansellering" @@ -443,11 +416,11 @@ msgstr "Venter på kansellering" msgid "Pending Charges" msgstr "Trekk på vent" -#: woo-vipps-recurring.php:574 +#: woo-vipps-recurring.php:613 msgid "Product short description" msgstr "Kort beskrivelse av produktet" -#: includes/admin/vipps-recurring-settings.php:110 +#: includes/admin/vipps-recurring-settings.php:104 msgid "Random" msgstr "Tilfeldig" @@ -466,39 +439,39 @@ msgid "Remember: {brand} is always has no fees when paying businesses." msgstr "Husk: {brand} er alltid gebyrfritt når du betaler til bedrifter." #. translators: Vipps/MobilePay Agreement ID -#: includes/wc-gateway-vipps-recurring.php:1655 +#: includes/wc-gateway-vipps-recurring.php:1583 msgid "Request to change gateway to Vipps/MobilePay with agreement ID: %s." msgstr "Forespørsel om å bytte til Vipps/MobilePay med agreement ID: %s" -#: includes/admin/vipps-recurring-settings.php:119 +#: includes/admin/vipps-recurring-settings.php:113 msgid "Save debug messages to the WooCommerce System Status log." msgstr "Lagre feilsøkingsmeldinger i WooCommerce sin System Status logg." -#: woo-vipps-recurring.php:748 +#: woo-vipps-recurring.php:787 msgid "Settings" msgstr "Innstillinger" -#: includes/admin/vipps-recurring-settings.php:69 -msgid "Special actions page" -msgstr "Side for spesielle hendelser" - -#: includes/admin/vipps-recurring-settings.php:106 +#: includes/admin/vipps-recurring-settings.php:100 msgid "Status checking sort order for charges" msgstr "Rekkefølgen trekk skal sjekkes i" -#: includes/wc-gateway-vipps-recurring.php:1867 +#: includes/wc-gateway-vipps-recurring.php:1794 msgid "Successfully authenticated with the Vipps/MobilePay API" msgstr "Autentisering med Vipps/MobilePay vellykket" -#: woo-vipps-recurring.php:277 +#: woo-vipps-recurring.php:276 msgid "Successfully checked the status of these charges" msgstr "Sjekk av trekkstatus vellykket" -#: includes/wc-gateway-vipps-recurring.php:682 +#: includes/admin/vipps-recurring-settings.php:117 +msgid "Test mode" +msgstr "Testmodus" + +#: includes/wc-gateway-vipps-recurring.php:609 msgid "The agreement was cancelled or expired in Vipps/MobilePay" msgstr "Betalingsavtalen utløp eller var avbrutt i Vipps/MobilePay" -#: includes/admin/vipps-recurring-settings.php:101 +#: includes/admin/vipps-recurring-settings.php:95 msgid "" "The amount of charges to check the status for in wp-cron per scheduled event." " It is recommended to keep this between 5 and 100. The higher the value, the " @@ -508,12 +481,7 @@ msgstr "" "sette denne til et tall mellom 5 og 100. Overstiger du 100 kan det by på " "ytelsesproblemer." -#: includes/admin/vipps-recurring-settings.php:70 -msgid "The page to use for special pages, like a cancelled purchase." -msgstr "" -"Siden du vil bruke til spesielle handlinger, slik som et kansellert kjøp." - -#: includes/admin/vipps-recurring-settings.php:107 +#: includes/admin/vipps-recurring-settings.php:101 msgid "" "The sort order we use when checking charges in wp-cron. Random sort order is " "the best for most use cases. Oldest first may be useful if you use " @@ -523,7 +491,7 @@ msgstr "" "anbefalt for de fleste bruksområder. Eldste først kan være nyttig dersom du " "bruker synkroniserte fornyelser." -#: includes/admin/vipps-recurring-settings.php:76 +#: includes/admin/vipps-recurring-settings.php:70 msgid "" "The status to give orders when the charge is reserved in Vipps/MobilePay (i." "e. tangible goods). Notice: This option only counts for newly signed " @@ -536,7 +504,7 @@ msgstr "" "innstillingen for fornyelsesordre nedenfor for å kontrollere standardstatus " "for fornyelsesordre." -#: includes/wc-gateway-vipps-recurring.php:586 +#: includes/wc-gateway-vipps-recurring.php:513 msgid "The subtotal is zero, the order is free for this subscription period." msgstr "Delsummen er lik null, ordren er gratis i denne abonnementsperioden." @@ -557,7 +525,7 @@ msgstr "" "Kontrollerer hvilken merkevare kunden ser i kassa. {brand} blir erstattet av " "enten Vipps eller MobilePay." -#: includes/admin/vipps-recurring-settings.php:95 +#: includes/admin/vipps-recurring-settings.php:89 msgid "" "This option will make sure order statuses always transition to \"completed\" " "when the renewal charge is completed in Vipps/MobilePay." @@ -569,7 +537,7 @@ msgstr "" msgid "This order has not yet been captured." msgstr "Denne ordren har ikke blitt trukket ennå." -#: includes/wc-gateway-vipps-recurring.php:1454 +#: includes/wc-gateway-vipps-recurring.php:1381 msgid "" "This subscription is already active in Vipps/MobilePay. You can leave this " "page." @@ -577,12 +545,16 @@ msgstr "" "Dette abonnementet har allerede en aktiv betalingsavtale i Vipps/MobilePay. " "Du kan forlate denne siden." -#: includes/wc-gateway-vipps-recurring.php:1929 +#: includes/admin/vipps-recurring-settings.php:123 +msgid "This value is being overriden by WC_VIPPS_RECURRING_TEST_MODE." +msgstr "Denne verdien er overstyrt av WC_VIPPS_RECURRING_TEST_MODE." + +#: includes/wc-gateway-vipps-recurring.php:1856 msgid "This Vipps/MobilePay agreement ID is invalid." msgstr "Denne Vipps/MobilePay betalingsavtale ID-en er ugyldig." -#: includes/admin/vipps-recurring-settings.php:93 -#: includes/admin/vipps-recurring-settings.php:94 +#: includes/admin/vipps-recurring-settings.php:87 +#: includes/admin/vipps-recurring-settings.php:88 msgid "Transition order status for renewals to \"completed\"" msgstr "Flytt status på fornyelsesordre til \"fullført\"" @@ -590,35 +562,39 @@ msgstr "Flytt status på fornyelsesordre til \"fullført\"" msgid "URL to the Vipps/MobilePay logo" msgstr "Lenke til Vipps/MobilePay logoen" +#: src/pages/PaymentRedirectPage.jsx:36 +msgid "Verifying your payment. Please wait." +msgstr "Vennligst vent mens vi sjekker betalingen din." + #: includes/admin/vipps-recurring-settings.php:21 msgid "Vipps" msgstr "Vipps" -#: includes/wc-gateway-vipps-recurring.php:1905 +#: includes/wc-gateway-vipps-recurring.php:1832 msgid "Vipps/MobilePay Agreement ID" msgstr "Vipps/MobilePay Betalingsavtale ID" #. translators: Vipps/MobilePay Charge ID, human diff timestamp -#: includes/wc-gateway-vipps-recurring.php:1112 +#: includes/wc-gateway-vipps-recurring.php:1039 msgid "Vipps/MobilePay charge created: %1$s. The charge will be complete %2$s." msgstr "Vipps/MobilePay trekk opprettet: %1$s. Trekket blir fullført %2$s." -#: includes/wc-gateway-vipps-recurring.php:1182 -#: includes/wc-gateway-vipps-recurring.php:1216 +#: includes/wc-gateway-vipps-recurring.php:1109 +#: includes/wc-gateway-vipps-recurring.php:1143 msgid "Vipps/MobilePay is temporarily unavailable." msgstr "Vipps/MobilePay er midlertidig utilgjengelig." -#: includes/wc-gateway-vipps-recurring.php:794 +#: includes/wc-gateway-vipps-recurring.php:721 msgid "Vipps/MobilePay payment cancelled." msgstr "Vipps/MobilePay betaling kansellert." -#: includes/wc-gateway-vipps-recurring.php:802 +#: includes/wc-gateway-vipps-recurring.php:729 msgid "Vipps/MobilePay payment failed." msgstr "Vipps/MobilePay betaling mislyktes." #: includes/pages/admin/vipps-recurring-admin-menu-page.php:9 -#: includes/wc-gateway-vipps-recurring.php:115 woo-vipps-recurring.php:504 -#: woo-vipps-recurring.php:505 woo-vipps-recurring.php:544 +#: includes/wc-gateway-vipps-recurring.php:110 woo-vipps-recurring.php:517 +#: woo-vipps-recurring.php:518 woo-vipps-recurring.php:583 msgid "Vipps/MobilePay Recurring Payments" msgstr "Vipps/MobilePay faste betalinger" @@ -626,7 +602,7 @@ msgstr "Vipps/MobilePay faste betalinger" msgid "Vipps/MobilePay recurring payments for WooCommerce" msgstr "Vipps/MobilePay faste betalinger for WooCommerce" -#: woo-vipps-recurring.php:269 +#: woo-vipps-recurring.php:268 msgid "" "Vipps/MobilePay Recurring Payments is currently in test mode - no real " "transactions will occur. Disable this in your wp_config when you are ready " @@ -637,7 +613,7 @@ msgstr "" "live." #. translators: %s link to WooCommerce Subscription's purchase page -#: woo-vipps-recurring.php:256 +#: woo-vipps-recurring.php:255 msgid "" "Vipps/MobilePay Recurring Payments requires WooCommerce Subscriptions to be " "installed and active. You can purchase and download %s here." @@ -645,11 +621,7 @@ msgstr "" "Vipps/MobilePay faste betalinger krever at WooCommerce Subscriptions er " "installert. Du kan kjøpe og laste ned %s her." -#: includes/wc-gateway-vipps-recurring.php:398 -msgid "Vipps/MobilePay Recurring Payments specials" -msgstr "Vipps/MobilePay faste betalinger spesialler" - -#: includes/wc-gateway-vipps-recurring.php:116 +#: includes/wc-gateway-vipps-recurring.php:111 msgid "" "Vipps/MobilePay Recurring Payments works by redirecting your customers to " "the Vipps MobilePay portal for confirmation. It creates a payment plan and " @@ -658,7 +630,7 @@ msgstr "" "Vipps/MobilePay Faste Betalinger lar deg ta løpende betalt med Vipps eller " "MobilePay via en betalingsavtale." -#: includes/wc-gateway-vipps-recurring.php:773 +#: includes/wc-gateway-vipps-recurring.php:700 msgid "Waiting for you to capture the payment" msgstr "Venter på at du skal trekke beløpet" @@ -666,7 +638,7 @@ msgstr "Venter på at du skal trekke beløpet" msgid "We hit Vipps/MobilePay's rate limit, we will retry later." msgstr "Vi traff Vipps/MobilePay sin \"rate-limit\", vi prøver igjen snart." -#: includes/admin/vipps-recurring-settings.php:85 +#: includes/admin/vipps-recurring-settings.php:79 msgid "" "When a renewal order happens we have to wait a few days for the money to be " "drawn from the customer. This settings controls the status to give these " @@ -676,7 +648,7 @@ msgstr "" "kunden sin bankkonto. Denne innstillingen kontrollerer hvilken status ordren " "skal ha i WooCommerce i mellomtiden." -#: woo-vipps-recurring.php:570 +#: woo-vipps-recurring.php:609 msgid "" "Where we should source the agreement description from. Displayed in the " "Vipps/MobilePay app." @@ -687,7 +659,7 @@ msgstr "" msgid "Yes" msgstr "Ja" -#: includes/wc-gateway-vipps-recurring.php:995 +#: includes/wc-gateway-vipps-recurring.php:922 msgid "" "You can not partially refund a pending or due charge. Please wait till the " "payment clears first or refund the full amount instead." @@ -697,7 +669,7 @@ msgstr "" "stedet." #. translators: %s is the days as an integer since the order was created -#: includes/wc-gateway-vipps-recurring.php:959 +#: includes/wc-gateway-vipps-recurring.php:886 msgid "" "You cannot refund a charge that was made more than 365 days ago. This order " "was created %s days ago." @@ -705,6 +677,10 @@ msgstr "" "Du kan ikke tilbakebetale en betaling som skjedde for mer enn 365 dager " "siden. Denne ordren ble gjort for %s dager siden." +#: src/pages/PaymentRedirectPage.jsx:40 +msgid "You will be redirected shortly." +msgstr "Du blir straks videresendt." + #: includes/wc-vipps-recurring-api.php:389 msgid "" "Your Vipps/MobilePay Recurring Payments gateway is not correctly configured." diff --git a/languages/vipps-recurring-payments-gateway-for-woocommerce.pot b/languages/vipps-recurring-payments-gateway-for-woocommerce.pot index 7797ad1..53f121f 100755 --- a/languages/vipps-recurring-payments-gateway-for-woocommerce.pot +++ b/languages/vipps-recurring-payments-gateway-for-woocommerce.pot @@ -9,9 +9,9 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"POT-Creation-Date: 2024-02-21T10:42:09+00:00\n" +"POT-Creation-Date: 2024-03-18T09:23:50+00:00\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"X-Generator: WP-CLI 2.7.1\n" +"X-Generator: WP-CLI 2.8.1\n" "X-Domain: vipps-recurring-payments-gateway-for-woocommerce\n" #. Plugin Name of the plugin @@ -158,82 +158,86 @@ msgid "Ocp-Apim-Subscription-Key" msgstr "" #: includes/admin/vipps-recurring-settings.php:69 -msgid "Special actions page" -msgstr "" - -#: includes/admin/vipps-recurring-settings.php:70 -msgid "The page to use for special pages, like a cancelled purchase." -msgstr "" - -#: includes/admin/vipps-recurring-settings.php:71 -msgid "Create a new page" -msgstr "" - -#: includes/admin/vipps-recurring-settings.php:75 msgid "Default status to give orders with a reserved charge" msgstr "" -#: includes/admin/vipps-recurring-settings.php:76 +#: includes/admin/vipps-recurring-settings.php:70 msgid "The status to give orders when the charge is reserved in Vipps/MobilePay (i.e. tangible goods). Notice: This option only counts for newly signed agreements by the customer. Use the setting below to set the default status for renewal orders." msgstr "" -#: includes/admin/vipps-recurring-settings.php:84 +#: includes/admin/vipps-recurring-settings.php:78 msgid "Default status to give pending renewal orders" msgstr "" -#: includes/admin/vipps-recurring-settings.php:85 +#: includes/admin/vipps-recurring-settings.php:79 msgid "When a renewal order happens we have to wait a few days for the money to be drawn from the customer. This settings controls the status to give these renewal orders before the charge completes." msgstr "" -#: includes/admin/vipps-recurring-settings.php:93 -#: includes/admin/vipps-recurring-settings.php:94 +#: includes/admin/vipps-recurring-settings.php:87 +#: includes/admin/vipps-recurring-settings.php:88 msgid "Transition order status for renewals to \"completed\"" msgstr "" -#: includes/admin/vipps-recurring-settings.php:95 +#: includes/admin/vipps-recurring-settings.php:89 msgid "This option will make sure order statuses always transition to \"completed\" when the renewal charge is completed in Vipps/MobilePay." msgstr "" -#: includes/admin/vipps-recurring-settings.php:100 +#: includes/admin/vipps-recurring-settings.php:94 msgid "Amount of charges to check per status check" msgstr "" -#: includes/admin/vipps-recurring-settings.php:101 +#: includes/admin/vipps-recurring-settings.php:95 msgid "The amount of charges to check the status for in wp-cron per scheduled event. It is recommended to keep this between 5 and 100. The higher the value, the more performance issues you may run into." msgstr "" -#: includes/admin/vipps-recurring-settings.php:106 +#: includes/admin/vipps-recurring-settings.php:100 msgid "Status checking sort order for charges" msgstr "" -#: includes/admin/vipps-recurring-settings.php:107 +#: includes/admin/vipps-recurring-settings.php:101 msgid "The sort order we use when checking charges in wp-cron. Random sort order is the best for most use cases. Oldest first may be useful if you use synchronized renewals." msgstr "" -#: includes/admin/vipps-recurring-settings.php:110 +#: includes/admin/vipps-recurring-settings.php:104 msgid "Random" msgstr "" -#: includes/admin/vipps-recurring-settings.php:111 +#: includes/admin/vipps-recurring-settings.php:105 msgid "Oldest first" msgstr "" -#: includes/admin/vipps-recurring-settings.php:112 +#: includes/admin/vipps-recurring-settings.php:106 msgid "Newest first" msgstr "" -#: includes/admin/vipps-recurring-settings.php:116 +#: includes/admin/vipps-recurring-settings.php:110 msgid "Logging" msgstr "" -#: includes/admin/vipps-recurring-settings.php:117 +#: includes/admin/vipps-recurring-settings.php:111 msgid "Log debug messages" msgstr "" -#: includes/admin/vipps-recurring-settings.php:119 +#: includes/admin/vipps-recurring-settings.php:113 msgid "Save debug messages to the WooCommerce System Status log." msgstr "" +#: includes/admin/vipps-recurring-settings.php:117 +msgid "Test mode" +msgstr "" + +#: includes/admin/vipps-recurring-settings.php:118 +msgid "Enable test mode" +msgstr "" + +#: includes/admin/vipps-recurring-settings.php:120 +msgid "Enabling this will route all API requests to the Vipps MobilePay test API." +msgstr "" + +#: includes/admin/vipps-recurring-settings.php:123 +msgid "This value is being overriden by WC_VIPPS_RECURRING_TEST_MODE." +msgstr "" + #: includes/compat/wc-vipps-recurring-kc-support.php:78 msgid "External Payment Method - Vipps/MobilePay Recurring Payments" msgstr "" @@ -272,10 +276,10 @@ msgid "Disables the \"Select another Payment method\" button in Klarna Checkout. msgstr "" #: includes/pages/admin/vipps-recurring-admin-menu-page.php:9 -#: includes/wc-gateway-vipps-recurring.php:115 -#: woo-vipps-recurring.php:504 -#: woo-vipps-recurring.php:505 -#: woo-vipps-recurring.php:544 +#: includes/wc-gateway-vipps-recurring.php:110 +#: woo-vipps-recurring.php:517 +#: woo-vipps-recurring.php:518 +#: woo-vipps-recurring.php:583 msgid "Vipps/MobilePay Recurring Payments" msgstr "" @@ -309,151 +313,143 @@ msgstr "" msgid "here" msgstr "" -#: includes/wc-gateway-vipps-recurring.php:116 +#: includes/wc-gateway-vipps-recurring.php:111 msgid "Vipps/MobilePay Recurring Payments works by redirecting your customers to the Vipps MobilePay portal for confirmation. It creates a payment plan and charges your users on the intervals you specify." msgstr "" #. translators: %s: brand name, Vipps or MobilePay -#: includes/wc-gateway-vipps-recurring.php:164 +#: includes/wc-gateway-vipps-recurring.php:162 msgid "Pay with %s" msgstr "" -#: includes/wc-gateway-vipps-recurring.php:398 -msgid "Vipps/MobilePay Recurring Payments specials" -msgstr "" - -#: includes/wc-gateway-vipps-recurring.php:408 -msgid "Could not create or find the \"Vipps/MobilePay Recurring Payments specials\" page" -msgstr "" - -#: includes/wc-gateway-vipps-recurring.php:586 +#: includes/wc-gateway-vipps-recurring.php:513 msgid "The subtotal is zero, the order is free for this subscription period." msgstr "" -#: includes/wc-gateway-vipps-recurring.php:636 +#: includes/wc-gateway-vipps-recurring.php:563 msgid "MobilePay payments are automatically captured to prevent the payment reservation from automatically getting cancelled after 7 days." msgstr "" -#: includes/wc-gateway-vipps-recurring.php:682 +#: includes/wc-gateway-vipps-recurring.php:609 msgid "The agreement was cancelled or expired in Vipps/MobilePay" msgstr "" #. translators: Vipps/MobilePay Charge ID -#: includes/wc-gateway-vipps-recurring.php:761 +#: includes/wc-gateway-vipps-recurring.php:688 msgid "Charge completed (Charge ID: %s)" msgstr "" -#: includes/wc-gateway-vipps-recurring.php:773 +#: includes/wc-gateway-vipps-recurring.php:700 msgid "Waiting for you to capture the payment" msgstr "" -#: includes/wc-gateway-vipps-recurring.php:794 +#: includes/wc-gateway-vipps-recurring.php:721 msgid "Vipps/MobilePay payment cancelled." msgstr "" -#: includes/wc-gateway-vipps-recurring.php:802 +#: includes/wc-gateway-vipps-recurring.php:729 msgid "Vipps/MobilePay payment failed." msgstr "" #. translators: Error message -#: includes/wc-gateway-vipps-recurring.php:890 +#: includes/wc-gateway-vipps-recurring.php:817 msgid "Failed creating a charge: %s" msgstr "" #. translators: %s is the days as an integer since the order was created -#: includes/wc-gateway-vipps-recurring.php:959 +#: includes/wc-gateway-vipps-recurring.php:886 msgid "You cannot refund a charge that was made more than 365 days ago. This order was created %s days ago." msgstr "" -#: includes/wc-gateway-vipps-recurring.php:975 +#: includes/wc-gateway-vipps-recurring.php:902 msgid "A temporary error occurred when refunding a payment through Vipps MobilePay. Please ensure the order is refunded manually or reset the order to \"Processing\" and try again." msgstr "" -#: includes/wc-gateway-vipps-recurring.php:995 +#: includes/wc-gateway-vipps-recurring.php:922 msgid "You can not partially refund a pending or due charge. Please wait till the payment clears first or refund the full amount instead." msgstr "" -#: includes/wc-gateway-vipps-recurring.php:999 +#: includes/wc-gateway-vipps-recurring.php:926 msgid "An unexpected error occurred while refunding a payment in Vipps/MobilePay." msgstr "" #. translators: Vipps/MobilePay Charge ID, human diff timestamp -#: includes/wc-gateway-vipps-recurring.php:1112 +#: includes/wc-gateway-vipps-recurring.php:1039 msgid "Vipps/MobilePay charge created: %1$s. The charge will be complete %2$s." msgstr "" #. translators: %s: The charge's status -#: includes/wc-gateway-vipps-recurring.php:1159 +#: includes/wc-gateway-vipps-recurring.php:1086 msgid "Could not capture charge because the status is not RESERVED or PARTIALLY_CAPTURED. Found status: %s" msgstr "" -#: includes/wc-gateway-vipps-recurring.php:1182 -#: includes/wc-gateway-vipps-recurring.php:1216 +#: includes/wc-gateway-vipps-recurring.php:1109 +#: includes/wc-gateway-vipps-recurring.php:1143 msgid "Vipps/MobilePay is temporarily unavailable." msgstr "" #. translators: %s order id -#: includes/wc-gateway-vipps-recurring.php:1223 +#: includes/wc-gateway-vipps-recurring.php:1150 msgid "Could not capture Vipps/MobilePay payment for order id: %s" msgstr "" -#: includes/wc-gateway-vipps-recurring.php:1276 +#: includes/wc-gateway-vipps-recurring.php:1203 msgid "Payment gateway change request cancelled in Vipps/MobilePay" msgstr "" -#: includes/wc-gateway-vipps-recurring.php:1454 +#: includes/wc-gateway-vipps-recurring.php:1381 msgid "This subscription is already active in Vipps/MobilePay. You can leave this page." msgstr "" #. translators: %s: brand (Vipps or MobilePay) -#: includes/wc-gateway-vipps-recurring.php:1481 +#: includes/wc-gateway-vipps-recurring.php:1408 msgid "Different subscription products can not be purchased at the same time using %s." msgstr "" #. translators: Vipps/MobilePay Agreement ID -#: includes/wc-gateway-vipps-recurring.php:1655 +#: includes/wc-gateway-vipps-recurring.php:1583 msgid "Request to change gateway to Vipps/MobilePay with agreement ID: %s." msgstr "" #. translators: Vipps/MobilePay Agreement ID -#: includes/wc-gateway-vipps-recurring.php:1684 +#: includes/wc-gateway-vipps-recurring.php:1612 msgid "Agreement created: %s. Customer sent to Vipps/MobilePay for confirmation." msgstr "" -#: includes/wc-gateway-vipps-recurring.php:1867 +#: includes/wc-gateway-vipps-recurring.php:1794 msgid "Successfully authenticated with the Vipps/MobilePay API" msgstr "" #. translators: %s: the error message returned from Vipps/MobilePay -#: includes/wc-gateway-vipps-recurring.php:1870 +#: includes/wc-gateway-vipps-recurring.php:1799 msgid "Could not authenticate with the Vipps/MobilePay API: %s" msgstr "" -#: includes/wc-gateway-vipps-recurring.php:1905 +#: includes/wc-gateway-vipps-recurring.php:1832 msgid "Vipps/MobilePay Agreement ID" msgstr "" -#: includes/wc-gateway-vipps-recurring.php:1929 +#: includes/wc-gateway-vipps-recurring.php:1856 msgid "This Vipps/MobilePay agreement ID is invalid." msgstr "" -#: includes/wc-gateway-vipps-recurring.php:1965 +#: includes/wc-gateway-vipps-recurring.php:1892 msgid "Pending cancellation" msgstr "" -#: includes/wc-gateway-vipps-recurring.php:1976 +#: includes/wc-gateway-vipps-recurring.php:1903 msgid "Cancelled" msgstr "" -#: includes/wc-gateway-vipps-recurring.php:1987 +#: includes/wc-gateway-vipps-recurring.php:1914 msgid "On hold" msgstr "" -#: includes/wc-gateway-vipps-recurring.php:2058 +#: includes/wc-gateway-vipps-recurring.php:1985 msgid "Cancelled due charge in Vipps/MobilePay." msgstr "" -#: includes/wc-gateway-vipps-recurring.php:2062 +#: includes/wc-gateway-vipps-recurring.php:1989 msgid "Could not cancel charge in Vipps/MobilePay. Please manually check the status of this order if you plan to process a new renewal order!" msgstr "" @@ -478,90 +474,80 @@ msgstr "" msgid "Your WordPress URL is not passing Merchant Agreement URL validation. Is your website publicly accessible?" msgstr "" -#: woo-vipps-recurring.php:163 -msgid "Cancelled payment" -msgstr "" - -#. translators: %s: brand (Vipps or MobilePay) -#: woo-vipps-recurring.php:165 -msgid "It looks like you cancelled your order in %s. If this was a mistake you can try again by checking out again :)" -msgstr "" - #. translators: %s link to WooCommerce Subscription's purchase page -#: woo-vipps-recurring.php:256 +#: woo-vipps-recurring.php:255 msgid "Vipps/MobilePay Recurring Payments requires WooCommerce Subscriptions to be installed and active. You can purchase and download %s here." msgstr "" -#: woo-vipps-recurring.php:269 +#: woo-vipps-recurring.php:268 msgid "Vipps/MobilePay Recurring Payments is currently in test mode - no real transactions will occur. Disable this in your wp_config when you are ready to go live!" msgstr "" -#: woo-vipps-recurring.php:277 +#: woo-vipps-recurring.php:276 msgid "Successfully checked the status of these charges" msgstr "" #. translators: amount of orders checked -#: woo-vipps-recurring.php:529 +#: woo-vipps-recurring.php:568 msgid "Done. Checked the status of %s orders" msgstr "" -#: woo-vipps-recurring.php:531 +#: woo-vipps-recurring.php:570 msgid "Failed to finish checking the status of all orders. Please try again." msgstr "" -#: woo-vipps-recurring.php:561 +#: woo-vipps-recurring.php:600 msgid "Capture payment instantly" msgstr "" -#: woo-vipps-recurring.php:562 +#: woo-vipps-recurring.php:601 msgid "Capture payment instantly even if the product is not virtual. Please make sure you are following the local jurisdiction in your country when using this option." msgstr "" -#: woo-vipps-recurring.php:569 +#: woo-vipps-recurring.php:608 msgid "Description source" msgstr "" -#: woo-vipps-recurring.php:570 +#: woo-vipps-recurring.php:609 msgid "Where we should source the agreement description from. Displayed in the Vipps/MobilePay app." msgstr "" -#: woo-vipps-recurring.php:573 +#: woo-vipps-recurring.php:612 msgid "None" msgstr "" -#: woo-vipps-recurring.php:574 +#: woo-vipps-recurring.php:613 msgid "Product short description" msgstr "" -#: woo-vipps-recurring.php:575 +#: woo-vipps-recurring.php:614 msgid "Custom" msgstr "" -#: woo-vipps-recurring.php:582 +#: woo-vipps-recurring.php:621 msgid "Custom description" msgstr "" -#: woo-vipps-recurring.php:583 +#: woo-vipps-recurring.php:622 msgid "If the description source is set to \"custom\" this text will be used." msgstr "" -#: woo-vipps-recurring.php:584 +#: woo-vipps-recurring.php:623 msgid "Max 100 characters" msgstr "" -#: woo-vipps-recurring.php:636 +#: woo-vipps-recurring.php:675 msgid "Capture payment" msgstr "" -#: woo-vipps-recurring.php:748 +#: woo-vipps-recurring.php:787 msgid "Settings" msgstr "" -#: assets/js/vipps-recurring-admin.js:77 -msgid "Note: Reservations in MobilePay will be cancelled after 7 days. Remember to ship and fulfill your orders." +#: src/pages/PaymentRedirectPage.jsx:36 +msgid "Verifying your payment. Please wait." msgstr "" -#. translators: %s: brand name, Vipps or MobilePay -#: assets/js/vipps-recurring-payment-method-block.js:49 -msgid "Continue with %s" +#: src/pages/PaymentRedirectPage.jsx:40 +msgid "You will be redirected shortly." msgstr "" diff --git a/src/build.map.json b/src/build.map.json index 1788141..33926ca 100644 --- a/src/build.map.json +++ b/src/build.map.json @@ -1,3 +1,3 @@ { - "": "assets/build/index.js" + "src/pages/PaymentRedirectPage.jsx": "assets/build/index.js" } diff --git a/src/main.scss b/src/main.scss index 7e0b54b..ceb5ea4 100644 --- a/src/main.scss +++ b/src/main.scss @@ -2,6 +2,71 @@ width: 70px; } -.payment-transport-page { - // +.vipps-recurring-payment-redirect-page { + z-index: 100000; + position: absolute; + top: 0; + left: 0; + height: 100%; + width: 100%; + background: #FFF; + color: #161225; + + &__container { + height: 100%; + display: flex; + align-items: center; + justify-content: center; + padding: 0 15px; + + &__content { + &__logo { + display: flex; + justify-content: center; + width: 100%; + + img { + height: 100%; + width: 150px; + } + } + + &__loading { + display: flex; + justify-content: center; + + &__spinner { + @keyframes spin { + to { + transform: rotate(360deg); + } + } + @-webkit-keyframes spin { + to { + transform: rotate(360deg); + } + } + + display: inline-block; + margin: 20px 0; + width: 32px; + height: 32px; + border: 2px solid rgba(0, 0, 0, .3); + border-radius: 50%; + border-top-color: #161225; + animation: spin 1s ease-in-out infinite; + } + } + + &__text { + font-size: 1.2rem; + text-align: center; + + p { + padding: 0; + margin: 0; + } + } + } + } } diff --git a/src/pages/PaymentRedirectPage.jsx b/src/pages/PaymentRedirectPage.jsx index 63e7e97..16f3d32 100644 --- a/src/pages/PaymentRedirectPage.jsx +++ b/src/pages/PaymentRedirectPage.jsx @@ -1,7 +1,55 @@ -export default function PaymentRedirectPage() { - return ( -
- Checking your payment. Please wait. -
- ) +import { useEffect, useState } from '@wordpress/element' +import apiFetch from '@wordpress/api-fetch' +import { __ } from '@wordpress/i18n' + +export default function PaymentRedirectPage () { + const { logo } = window.VippsMobilePaySettings + const searchParams = new URLSearchParams(window.location.search) + + // const [response, setResponse] = useState(null) + // + // const intervalHandler = setInterval(() => { + // apiFetch({ + // path: `/vipps-mobilepay-recurring/v1/orders/status/${searchParams.get( + // 'order_id')}?key=${searchParams.get('key')}`, method: 'GET', + // }).then(response => setResponse(response)) + // }, 1000) + // + // useEffect(() => { + // if (!response || response.status === 'PENDING') { + // return + // } + // + // clearInterval(intervalHandler) + // window.location.href = response.redirect_url + // }, [response]) + + return (
+
+
+
+ Logo +
+
+
+
+
+

+ {__('Verifying your payment. Please wait.', + 'vipps-recurring-payments-gateway-for-woocommerce')} +

+ +

+ {__('You will be redirected shortly.', + 'vipps-recurring-payments-gateway-for-woocommerce')} +

+
+
+
+
) } diff --git a/woo-vipps-recurring.php b/woo-vipps-recurring.php index cf04cab..31b0424 100755 --- a/woo-vipps-recurring.php +++ b/woo-vipps-recurring.php @@ -6,7 +6,7 @@ * Author: Everyday AS * Author URI: https://everyday.no * Version: 1.19.0 - * Requires at least: 4.4 + * Requires at least: 6.1 * Tested up to: 6.5 * WC tested up to: 8.6 * Text Domain: vipps-recurring-payments-gateway-for-woocommerce @@ -823,6 +823,7 @@ public function add_gateways( $methods ): array { public function wp_enqueue_scripts() { wp_enqueue_style( 'woo-vipps-recurring', + WC_VIPPS_RECURRING_PLUGIN_URL . '/assets/build/index.css', [], filemtime( WC_VIPPS_RECURRING_PLUGIN_PATH . '/assets/build/index.css' ) ); @@ -837,7 +838,11 @@ public function wp_enqueue_scripts() { true ); - wp_set_script_translations( 'woo-vipps-recurring', 'mediebank', WC_VIPPS_RECURRING_PLUGIN_PATH . '/languages' ); + wp_localize_script( 'woo-vipps-recurring', 'VippsMobilePaySettings', [ + 'logo' => WC_VIPPS_RECURRING_PLUGIN_URL . '/assets/images/' . $this->gateway->brand . '-logo.svg' + ] ); + + wp_set_script_translations( 'woo-vipps-recurring', 'vipps-recurring-payments-gateway-for-woocommerce', WC_VIPPS_RECURRING_PLUGIN_PATH . '/languages' ); } /**