diff --git a/.env.testing.example b/.env.testing.example index cbe4134..5ba4d38 100644 --- a/.env.testing.example +++ b/.env.testing.example @@ -1,3 +1,2 @@ -STRIPE_TEST_KEY= -STRIPE_TEST_SECRET= +STRIPE_TEST_SECRET=sk_test_123 STRIPE_API_BASE="stripemock:12111" diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 86170ff..e06ba59 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -13,26 +13,28 @@ jobs: strategy: max-parallel: 1 matrix: - php: [7.3, 7.4, 8.0] - laravel: [6.*, 7.*, 8.*] + php: [ 8.0, 8.1 ] + laravel: [ 8.*, 9.* ] include: - - laravel: 6.* - testbench: 4.* - phpunit: 9.* - - laravel: 7.* - testbench: 5.* - phpunit: 9.* - - laravel: 8.* + - php: 8.0 + laravel: 8.* testbench: 6.* phpunit: 9.* - - php: 8.0 + - php: 8.1 laravel: 8.* testbench: 6.* phpunit: 9.* - + - php: 8.0 + laravel: 9.* + testbench: 7.* + phpunit: 9.* + - php: 8.1 + laravel: 9.* + testbench: 7.* + phpunit: 9.* services: stripemock: - image: stripemock/stripe-mock:latest + image: stripe/stripe-mock:v0.141.0 ports: - 12111 @@ -49,7 +51,7 @@ jobs: - name: Install dependencies run: | - composer config "http-basic.nova.laravel.com" "${{ secrets.NOVA_USERNAME }}" "${{ secrets.NOVA_PASSWORD }}" + composer config "http-basic.nova.laravel.com" "${{ secrets.NOVA_USERNAME }}" "${{ secrets.NOVA_LICENSE_KEY }}" composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" "phpunit/phpunit:${{ matrix.phpunit }}" --no-interaction --no-update composer update --prefer-dist --no-interaction --no-progress --no-suggest diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 34f1db2..3fa9db5 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -25,7 +25,7 @@ jobs: - name: Install dependencies run: | - composer config "http-basic.nova.laravel.com" "${{ secrets.NOVA_USERNAME }}" "${{ secrets.NOVA_PASSWORD }}" + composer config "http-basic.nova.laravel.com" "${{ secrets.NOVA_USERNAME }}" "${{ secrets.NOVA_LICENSE_KEY }}" composer upgrade --no-interaction --no-suggest - name: PHP-8 compatible PHPCS @@ -50,7 +50,7 @@ jobs: - name: Install dependencies run: | - composer config "http-basic.nova.laravel.com" "${{ secrets.NOVA_USERNAME }}" "${{ secrets.NOVA_PASSWORD }}" + composer config "http-basic.nova.laravel.com" "${{ secrets.NOVA_USERNAME }}" "${{ secrets.NOVA_LICENSE_KEY }}" composer install --no-interaction --no-suggest - name: Tlint Lint diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 29d4a76..63104d3 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -28,9 +28,22 @@ Before submitting a pull request: To run the test suite locally: -- Run `cp .env.testing.example .env.testing` in the terminal -- Update `.env.testing` with your Stripe **test** API keys -- Run `vendor/bin/phpunit` in the terminal +- Copy the test `env` file: + ``` + cp .env.testing.example .env.testing + ``` +- Start the stripe mock docker container: + ``` + docker run -d --rm -it -p 12111-12112:12111-12112 --name nova-stripe-stripe-mock stripe/stripe-mock:v0.141.0 + ``` +- Run tests: + ``` + ./vendor/bin/phpunit + ``` +- When done testing your feature, be sure to stop the stripe mock container: + ``` + docker stop nova-stripe-stripe-mock + ``` ## Requirements diff --git a/charges-detail.png b/charges-detail.png index 21a0281..7b67511 100644 Binary files a/charges-detail.png and b/charges-detail.png differ diff --git a/charges-index.png b/charges-index.png index 634e99a..f3679a4 100644 Binary files a/charges-index.png and b/charges-index.png differ diff --git a/composer.json b/composer.json index 2b6dafd..438fd71 100644 --- a/composer.json +++ b/composer.json @@ -26,12 +26,11 @@ } ], "require": { - "php": ">=7.1.0", + "php": "^8.0|^8.1", "stripe/stripe-php": ">=5.0" }, "require-dev": { - "laravel/framework": ">=6.20.26", - "laravel/nova": "*@dev", + "laravel/nova": "^4.0", "orchestra/testbench": ">=3.6.x-dev", "phpunit/phpunit": "9.5.*", "tightenco/duster": "^0.3.2" @@ -54,7 +53,10 @@ } }, "config": { - "sort-packages": true + "sort-packages": true, + "allow-plugins": { + "dealerdirect/phpcodesniffer-composer-installer": true + } }, "minimum-stability": "dev", "prefer-stable": true diff --git a/customers-detail.png b/customers-detail.png new file mode 100644 index 0000000..d821863 Binary files /dev/null and b/customers-detail.png differ diff --git a/customers-index.png b/customers-index.png new file mode 100644 index 0000000..c31c563 Binary files /dev/null and b/customers-index.png differ diff --git a/dist/css/tool.css b/dist/css/tool.css index e69de29..47376b2 100644 --- a/dist/css/tool.css +++ b/dist/css/tool.css @@ -0,0 +1 @@ +/*! tailwindcss v3.1.8 | MIT License | https://tailwindcss.com*/*,:after,:before{border:0 solid #e5e7eb;box-sizing:border-box}:after,:before{--tw-content:""}html{-webkit-text-size-adjust:100%;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{color:inherit;font-family:inherit;font-size:100%;font-weight:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{color:#9ca3af;opacity:1}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::-webkit-backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.relative{position:relative}.m-2{margin:.5rem}.mr-2{margin-right:.5rem}.ml-auto{margin-left:auto}.mb-3{margin-bottom:.75rem}.mb-8{margin-bottom:2rem}.mb-2{margin-bottom:.5rem}.mb-6{margin-bottom:1.5rem}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.h-9{height:2.25rem}.w-1\/2{width:50%}.w-full{width:100%}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.flex-row-reverse{flex-direction:row-reverse}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.justify-end{justify-content:flex-end}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.whitespace-nowrap{white-space:nowrap}.rounded{border-radius:.25rem}.rounded-lg{border-radius:.5rem}.rounded-b-lg{border-bottom-left-radius:.5rem;border-bottom-right-radius:.5rem}.border-b{border-bottom-width:1px}.border-t{border-top-width:1px}.border-gray-200{--tw-border-opacity:1;border-color:rgb(229 231 235/var(--tw-border-opacity))}.border-gray-100{--tw-border-opacity:1;border-color:rgb(243 244 246/var(--tw-border-opacity))}.bg-gray-100{--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity))}.bg-gray-50{--tw-bg-opacity:1;background-color:rgb(249 250 251/var(--tw-bg-opacity))}.bg-green-100{--tw-bg-opacity:1;background-color:rgb(220 252 231/var(--tw-bg-opacity))}.bg-orange-100{--tw-bg-opacity:1;background-color:rgb(255 237 213/var(--tw-bg-opacity))}.bg-red-100{--tw-bg-opacity:1;background-color:rgb(254 226 226/var(--tw-bg-opacity))}.p-2{padding:.5rem}.p-3{padding:.75rem}.py-3{padding-bottom:.75rem;padding-top:.75rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.py-8{padding-bottom:2rem;padding-top:2rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.py-1{padding-bottom:.25rem;padding-top:.25rem}.py-4{padding-bottom:1rem;padding-top:1rem}.px-2{padding-left:.5rem;padding-right:.5rem}.py-2{padding-bottom:.5rem;padding-top:.5rem}.pl-5{padding-left:1.25rem}.pr-5{padding-right:1.25rem}.pr-2{padding-right:.5rem}.text-left{text-align:left}.text-center{text-align:center}.text-sm{font-size:.875rem;line-height:1.25rem}.text-2xl{font-size:1.5rem;line-height:2rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-normal{font-weight:400}.uppercase{text-transform:uppercase}.capitalize{text-transform:capitalize}.italic{font-style:italic}.tracking-wide{letter-spacing:.025em}.text-gray-500{--tw-text-opacity:1;color:rgb(107 114 128/var(--tw-text-opacity))}.text-gray-400{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity))}.text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.text-green-600{--tw-text-opacity:1;color:rgb(22 163 74/var(--tw-text-opacity))}.text-gray-600{--tw-text-opacity:1;color:rgb(75 85 99/var(--tw-text-opacity))}.text-orange-600{--tw-text-opacity:1;color:rgb(234 88 12/var(--tw-text-opacity))}.text-red-600{--tw-text-opacity:1;color:rgb(220 38 38/var(--tw-text-opacity))}.opacity-50{opacity:.5}.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.group:hover .group-hover\:bg-gray-50{--tw-bg-opacity:1;background-color:rgb(249 250 251/var(--tw-bg-opacity))}@media (prefers-color-scheme:dark){.dark\:border-gray-700{--tw-border-opacity:1;border-color:rgb(55 65 81/var(--tw-border-opacity))}.dark\:bg-gray-800{--tw-bg-opacity:1;background-color:rgb(31 41 55/var(--tw-bg-opacity))}.dark\:text-gray-400{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity))}.dark\:text-gray-800{--tw-text-opacity:1;color:rgb(31 41 55/var(--tw-text-opacity))}.dark\:ring-gray-600{--tw-ring-opacity:1;--tw-ring-color:rgb(75 85 99/var(--tw-ring-opacity))}.group:hover .dark\:group-hover\:bg-gray-900{--tw-bg-opacity:1;background-color:rgb(17 24 39/var(--tw-bg-opacity))}}@media (min-width:768px){.md\:text-2xl{font-size:1.5rem;line-height:2rem}} diff --git a/dist/js/tool.js b/dist/js/tool.js index 967835f..01ea782 100644 --- a/dist/js/tool.js +++ b/dist/js/tool.js @@ -1,4286 +1 @@ -/******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) { -/******/ return installedModules[moduleId].exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ i: moduleId, -/******/ l: false, -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.l = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; -/******/ -/******/ // define getter function for harmony exports -/******/ __webpack_require__.d = function(exports, name, getter) { -/******/ if(!__webpack_require__.o(exports, name)) { -/******/ Object.defineProperty(exports, name, { -/******/ configurable: false, -/******/ enumerable: true, -/******/ get: getter -/******/ }); -/******/ } -/******/ }; -/******/ -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = function(module) { -/******/ var getter = module && module.__esModule ? -/******/ function getDefault() { return module['default']; } : -/******/ function getModuleExports() { return module; }; -/******/ __webpack_require__.d(getter, 'a', getter); -/******/ return getter; -/******/ }; -/******/ -/******/ // Object.prototype.hasOwnProperty.call -/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; -/******/ -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; -/******/ -/******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 3); -/******/ }) -/************************************************************************/ -/******/ ([ -/* 0 */ -/***/ (function(module, exports) { - -/* globals __VUE_SSR_CONTEXT__ */ - -// IMPORTANT: Do NOT use ES2015 features in this file. -// This module is a runtime utility for cleaner component module output and will -// be included in the final webpack user bundle. - -module.exports = function normalizeComponent ( - rawScriptExports, - compiledTemplate, - functionalTemplate, - injectStyles, - scopeId, - moduleIdentifier /* server only */ -) { - var esModule - var scriptExports = rawScriptExports = rawScriptExports || {} - - // ES6 modules interop - var type = typeof rawScriptExports.default - if (type === 'object' || type === 'function') { - esModule = rawScriptExports - scriptExports = rawScriptExports.default - } - - // Vue.extend constructor export interop - var options = typeof scriptExports === 'function' - ? scriptExports.options - : scriptExports - - // render functions - if (compiledTemplate) { - options.render = compiledTemplate.render - options.staticRenderFns = compiledTemplate.staticRenderFns - options._compiled = true - } - - // functional template - if (functionalTemplate) { - options.functional = true - } - - // scopedId - if (scopeId) { - options._scopeId = scopeId - } - - var hook - if (moduleIdentifier) { // server build - hook = function (context) { - // 2.3 injection - context = - context || // cached call - (this.$vnode && this.$vnode.ssrContext) || // stateful - (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional - // 2.2 with runInNewContext: true - if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') { - context = __VUE_SSR_CONTEXT__ - } - // inject component styles - if (injectStyles) { - injectStyles.call(this, context) - } - // register component module identifier for async chunk inferrence - if (context && context._registeredComponents) { - context._registeredComponents.add(moduleIdentifier) - } - } - // used by ssr in case component is cached and beforeCreate - // never gets called - options._ssrRegister = hook - } else if (injectStyles) { - hook = injectStyles - } - - if (hook) { - var functional = options.functional - var existing = functional - ? options.render - : options.beforeCreate - - if (!functional) { - // inject component registration as beforeCreate hook - options.beforeCreate = existing - ? [].concat(existing, hook) - : [hook] - } else { - // for template-only hot-reload because in that case the render fn doesn't - // go through the normalizer - options._injectStyles = hook - // register for functioal component in vue file - options.render = function renderWithStyleInjection (h, context) { - hook.call(context) - return existing(h, context) - } - } - } - - return { - esModule: esModule, - exports: scriptExports, - options: options - } -} - - -/***/ }), -/* 1 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_currency_js__ = __webpack_require__(9); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_currency_js___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_currency_js__); -var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; - - - -/* harmony default export */ __webpack_exports__["a"] = (function (currency_code, amount) { - currency_code = currency_code.toUpperCase(); - var decimal_digits = currencies[currency_code] ? currencies[currency_code].decimal_digits : 2; - var currency_divisor = '1'.padEnd(decimal_digits + 1, '0'); - var currency_options = { - precision: decimal_digits - }; - - if (!currencies[currency_code]) { - return __WEBPACK_IMPORTED_MODULE_0_currency_js___default()(amount / currency_divisor, currency_options).format() + ' ' + currency_code; - } - - return __WEBPACK_IMPORTED_MODULE_0_currency_js___default()(amount / currency_divisor, _extends({}, currency_options, { - symbol: currencies[currency_code].symbol_native - })).format(true); -}); - -var currencies = { - "USD": { - "symbol": "$", - "name": "US Dollar", - "symbol_native": "$", - "decimal_digits": 2, - "rounding": 0, - "code": "USD", - "name_plural": "US dollars" - }, - "CAD": { - "symbol": "CA$", - "name": "Canadian Dollar", - "symbol_native": "$", - "decimal_digits": 2, - "rounding": 0, - "code": "CAD", - "name_plural": "Canadian dollars" - }, - "EUR": { - "symbol": "€", - "name": "Euro", - "symbol_native": "€", - "decimal_digits": 2, - "rounding": 0, - "code": "EUR", - "name_plural": "euros" - }, - "AED": { - "symbol": "AED", - "name": "United Arab Emirates Dirham", - "symbol_native": "د.إ.‏", - "decimal_digits": 2, - "rounding": 0, - "code": "AED", - "name_plural": "UAE dirhams" - }, - "AFN": { - "symbol": "Af", - "name": "Afghan Afghani", - "symbol_native": "؋", - "decimal_digits": 0, - "rounding": 0, - "code": "AFN", - "name_plural": "Afghan Afghanis" - }, - "ALL": { - "symbol": "ALL", - "name": "Albanian Lek", - "symbol_native": "Lek", - "decimal_digits": 0, - "rounding": 0, - "code": "ALL", - "name_plural": "Albanian lekë" - }, - "AMD": { - "symbol": "AMD", - "name": "Armenian Dram", - "symbol_native": "դր.", - "decimal_digits": 0, - "rounding": 0, - "code": "AMD", - "name_plural": "Armenian drams" - }, - "ANG": { - "symbol": "ƒ", - "name": "Netherlands Antillean guilder", - "symbol_native": "ƒ", - "decimal_digits": 0, - "rounding": 0, - "code": "ANG", - "name_plural": "Netherlands Antillean guilder" - }, - "AOA": { - "symbol": "Kz", - "name": "Angolan Kwanza", - "symbol_native": "Kz", - "decimal_digits": 0, - "rounding": 0, - "code": "AOA", - "name_plural": "Angolan Kwanzas" - }, - "ARS": { - "symbol": "AR$", - "name": "Argentine Peso", - "symbol_native": "$", - "decimal_digits": 2, - "rounding": 0, - "code": "ARS", - "name_plural": "Argentine pesos" - }, - "AUD": { - "symbol": "AU$", - "name": "Australian Dollar", - "symbol_native": "$", - "decimal_digits": 2, - "rounding": 0, - "code": "AUD", - "name_plural": "Australian dollars" - }, - "AZN": { - "symbol": "man.", - "name": "Azerbaijani Manat", - "symbol_native": "ман.", - "decimal_digits": 2, - "rounding": 0, - "code": "AZN", - "name_plural": "Azerbaijani manats" - }, - "BAM": { - "symbol": "KM", - "name": "Bosnia-Herzegovina Convertible Mark", - "symbol_native": "KM", - "decimal_digits": 2, - "rounding": 0, - "code": "BAM", - "name_plural": "Bosnia-Herzegovina convertible marks" - }, - "BDT": { - "symbol": "Tk", - "name": "Bangladeshi Taka", - "symbol_native": "৳", - "decimal_digits": 2, - "rounding": 0, - "code": "BDT", - "name_plural": "Bangladeshi takas" - }, - "BGN": { - "symbol": "BGN", - "name": "Bulgarian Lev", - "symbol_native": "лв.", - "decimal_digits": 2, - "rounding": 0, - "code": "BGN", - "name_plural": "Bulgarian leva" - }, - "BHD": { - "symbol": "BD", - "name": "Bahraini Dinar", - "symbol_native": "د.ب.‏", - "decimal_digits": 3, - "rounding": 0, - "code": "BHD", - "name_plural": "Bahraini dinars" - }, - "BIF": { - "symbol": "FBu", - "name": "Burundian Franc", - "symbol_native": "FBu", - "decimal_digits": 0, - "rounding": 0, - "code": "BIF", - "name_plural": "Burundian francs" - }, - "BND": { - "symbol": "BN$", - "name": "Brunei Dollar", - "symbol_native": "$", - "decimal_digits": 2, - "rounding": 0, - "code": "BND", - "name_plural": "Brunei dollars" - }, - "BMD": { - "symbol": "$", - "name": "Bermudian Dollar", - "symbol_native": "$", - "decimal_digits": 2, - "rounding": 0, - "code": "BMD", - "name_plural": "Bermudian Dollar" - }, - "BOB": { - "symbol": "Bs", - "name": "Bolivian Boliviano", - "symbol_native": "Bs", - "decimal_digits": 2, - "rounding": 0, - "code": "BOB", - "name_plural": "Bolivian bolivianos" - }, - "BRL": { - "symbol": "R$", - "name": "Brazilian Real", - "symbol_native": "R$", - "decimal_digits": 2, - "rounding": 0, - "code": "BRL", - "name_plural": "Brazilian reals" - }, - "BTN": { - "symbol": "Nu.", - "name": "Bhutanese Ngultrum", - "symbol_native": "Nu.", - "decimal_digits": 2, - "rounding": 0, - "code": "BTN", - "name_plural": "Bhutanese Ngultrum" - }, - "BWP": { - "symbol": "BWP", - "name": "Botswanan Pula", - "symbol_native": "P", - "decimal_digits": 2, - "rounding": 0, - "code": "BWP", - "name_plural": "Botswanan pulas" - }, - "BYR": { - "symbol": "BYR", - "name": "Belarusian Ruble", - "symbol_native": "BYR", - "decimal_digits": 0, - "rounding": 0, - "code": "BYR", - "name_plural": "Belarusian rubles" - }, - "BZD": { - "symbol": "BZ$", - "name": "Belize Dollar", - "symbol_native": "$", - "decimal_digits": 2, - "rounding": 0, - "code": "BZD", - "name_plural": "Belize dollars" - }, - "CDF": { - "symbol": "CDF", - "name": "Congolese Franc", - "symbol_native": "FrCD", - "decimal_digits": 2, - "rounding": 0, - "code": "CDF", - "name_plural": "Congolese francs" - }, - "CHF": { - "symbol": "CHF", - "name": "Swiss Franc", - "symbol_native": "CHF", - "decimal_digits": 2, - "rounding": 0.05, - "code": "CHF", - "name_plural": "Swiss francs" - }, - "CLP": { - "symbol": "CL$", - "name": "Chilean Peso", - "symbol_native": "$", - "decimal_digits": 0, - "rounding": 0, - "code": "CLP", - "name_plural": "Chilean pesos" - }, - "CNY": { - "symbol": "CN¥", - "name": "Chinese Yuan", - "symbol_native": "CN¥", - "decimal_digits": 2, - "rounding": 0, - "code": "CNY", - "name_plural": "Chinese yuan" - }, - "COP": { - "symbol": "CO$", - "name": "Colombian Peso", - "symbol_native": "$", - "decimal_digits": 0, - "rounding": 0, - "code": "COP", - "name_plural": "Colombian pesos" - }, - "CRC": { - "symbol": "₡", - "name": "Costa Rican Colón", - "symbol_native": "₡", - "decimal_digits": 0, - "rounding": 0, - "code": "CRC", - "name_plural": "Costa Rican colóns" - }, - "CVE": { - "symbol": "CV$", - "name": "Cape Verdean Escudo", - "symbol_native": "CV$", - "decimal_digits": 2, - "rounding": 0, - "code": "CVE", - "name_plural": "Cape Verdean escudos" - }, - "CZK": { - "symbol": "Kč", - "name": "Czech Republic Koruna", - "symbol_native": "Kč", - "decimal_digits": 2, - "rounding": 0, - "code": "CZK", - "name_plural": "Czech Republic korunas" - }, - "DJF": { - "symbol": "Fdj", - "name": "Djiboutian Franc", - "symbol_native": "Fdj", - "decimal_digits": 0, - "rounding": 0, - "code": "DJF", - "name_plural": "Djiboutian francs" - }, - "DKK": { - "symbol": "Dkr", - "name": "Danish Krone", - "symbol_native": "kr", - "decimal_digits": 2, - "rounding": 0, - "code": "DKK", - "name_plural": "Danish kroner" - }, - "DOP": { - "symbol": "RD$", - "name": "Dominican Peso", - "symbol_native": "RD$", - "decimal_digits": 2, - "rounding": 0, - "code": "DOP", - "name_plural": "Dominican pesos" - }, - "DZD": { - "symbol": "DA", - "name": "Algerian Dinar", - "symbol_native": "د.ج.‏", - "decimal_digits": 2, - "rounding": 0, - "code": "DZD", - "name_plural": "Algerian dinars" - }, - "EEK": { - "symbol": "Ekr", - "name": "Estonian Kroon", - "symbol_native": "kr", - "decimal_digits": 2, - "rounding": 0, - "code": "EEK", - "name_plural": "Estonian kroons" - }, - "EGP": { - "symbol": "EGP", - "name": "Egyptian Pound", - "symbol_native": "ج.م.‏", - "decimal_digits": 2, - "rounding": 0, - "code": "EGP", - "name_plural": "Egyptian pounds" - }, - "ERN": { - "symbol": "Nfk", - "name": "Eritrean Nakfa", - "symbol_native": "Nfk", - "decimal_digits": 2, - "rounding": 0, - "code": "ERN", - "name_plural": "Eritrean nakfas" - }, - "ETB": { - "symbol": "Br", - "name": "Ethiopian Birr", - "symbol_native": "Br", - "decimal_digits": 2, - "rounding": 0, - "code": "ETB", - "name_plural": "Ethiopian birrs" - }, - "FKP": { - "symbol": "£", - "name": "Falkland Island Pound", - "symbol_native": "£", - "decimal_digits": 2, - "rounding": 0, - "code": "FKP", - "name_plural": "Falkland Island Pounds" - }, - "GBP": { - "symbol": "£", - "name": "British Pound Sterling", - "symbol_native": "£", - "decimal_digits": 2, - "rounding": 0, - "code": "GBP", - "name_plural": "British pounds sterling" - }, - "GEL": { - "symbol": "GEL", - "name": "Georgian Lari", - "symbol_native": "GEL", - "decimal_digits": 2, - "rounding": 0, - "code": "GEL", - "name_plural": "Georgian laris" - }, - "GHS": { - "symbol": "GH₵", - "name": "Ghanaian Cedi", - "symbol_native": "GH₵", - "decimal_digits": 2, - "rounding": 0, - "code": "GHS", - "name_plural": "Ghanaian cedis" - }, - "GIP": { - "symbol": "£", - "name": "Gibraltar Pound", - "symbol_native": "£", - "decimal_digits": 2, - "rounding": 0, - "code": "GHS", - "name_plural": "Gibraltar pound" - }, - "GNF": { - "symbol": "FG", - "name": "Guinean Franc", - "symbol_native": "FG", - "decimal_digits": 0, - "rounding": 0, - "code": "GNF", - "name_plural": "Guinean francs" - }, - "GTQ": { - "symbol": "GTQ", - "name": "Guatemalan Quetzal", - "symbol_native": "Q", - "decimal_digits": 2, - "rounding": 0, - "code": "GTQ", - "name_plural": "Guatemalan quetzals" - }, - "HKD": { - "symbol": "HK$", - "name": "Hong Kong Dollar", - "symbol_native": "$", - "decimal_digits": 2, - "rounding": 0, - "code": "HKD", - "name_plural": "Hong Kong dollars" - }, - "HNL": { - "symbol": "HNL", - "name": "Honduran Lempira", - "symbol_native": "L", - "decimal_digits": 2, - "rounding": 0, - "code": "HNL", - "name_plural": "Honduran lempiras" - }, - "HRK": { - "symbol": "kn", - "name": "Croatian Kuna", - "symbol_native": "kn", - "decimal_digits": 2, - "rounding": 0, - "code": "HRK", - "name_plural": "Croatian kunas" - }, - "HUF": { - "symbol": "Ft", - "name": "Hungarian Forint", - "symbol_native": "Ft", - "decimal_digits": 0, - "rounding": 0, - "code": "HUF", - "name_plural": "Hungarian forints" - }, - "IDR": { - "symbol": "Rp", - "name": "Indonesian Rupiah", - "symbol_native": "Rp", - "decimal_digits": 0, - "rounding": 0, - "code": "IDR", - "name_plural": "Indonesian rupiahs" - }, - "ILS": { - "symbol": "₪", - "name": "Israeli New Sheqel", - "symbol_native": "₪", - "decimal_digits": 2, - "rounding": 0, - "code": "ILS", - "name_plural": "Israeli new sheqels" - }, - "INR": { - "symbol": "Rs", - "name": "Indian Rupee", - "symbol_native": "টকা", - "decimal_digits": 2, - "rounding": 0, - "code": "INR", - "name_plural": "Indian rupees" - }, - "IQD": { - "symbol": "IQD", - "name": "Iraqi Dinar", - "symbol_native": "د.ع.‏", - "decimal_digits": 0, - "rounding": 0, - "code": "IQD", - "name_plural": "Iraqi dinars" - }, - "IRR": { - "symbol": "IRR", - "name": "Iranian Rial", - "symbol_native": "﷼", - "decimal_digits": 0, - "rounding": 0, - "code": "IRR", - "name_plural": "Iranian rials" - }, - "ISK": { - "symbol": "Ikr", - "name": "Icelandic Króna", - "symbol_native": "kr", - "decimal_digits": 0, - "rounding": 0, - "code": "ISK", - "name_plural": "Icelandic krónur" - }, - "JMD": { - "symbol": "J$", - "name": "Jamaican Dollar", - "symbol_native": "$", - "decimal_digits": 2, - "rounding": 0, - "code": "JMD", - "name_plural": "Jamaican dollars" - }, - "JOD": { - "symbol": "JD", - "name": "Jordanian Dinar", - "symbol_native": "د.أ.‏", - "decimal_digits": 3, - "rounding": 0, - "code": "JOD", - "name_plural": "Jordanian dinars" - }, - "JPY": { - "symbol": "¥", - "name": "Japanese Yen", - "symbol_native": "¥", - "decimal_digits": 0, - "rounding": 0, - "code": "JPY", - "name_plural": "Japanese yen" - }, - "KES": { - "symbol": "с", - "name": "Kyrgyzstani som", - "symbol_native": "с", - "decimal_digits": 2, - "rounding": 0, - "code": "KES", - "name_plural": "Kyrgyzstani som" - }, - "KGS": { - "symbol": "Ksh", - "name": "Kyrgyzstani Som", - "symbol_native": "Ksh", - "decimal_digits": 2, - "rounding": 0, - "code": "KES", - "name_plural": "Kenyan shillings" - }, - "KHR": { - "symbol": "KHR", - "name": "Cambodian Riel", - "symbol_native": "៛", - "decimal_digits": 2, - "rounding": 0, - "code": "KHR", - "name_plural": "Cambodian riels" - }, - "KMF": { - "symbol": "CF", - "name": "Comorian Franc", - "symbol_native": "FC", - "decimal_digits": 0, - "rounding": 0, - "code": "KMF", - "name_plural": "Comorian francs" - }, - "KRW": { - "symbol": "₩", - "name": "South Korean Won", - "symbol_native": "₩", - "decimal_digits": 0, - "rounding": 0, - "code": "KRW", - "name_plural": "South Korean won" - }, - "KWD": { - "symbol": "KD", - "name": "Kuwaiti Dinar", - "symbol_native": "د.ك.‏", - "decimal_digits": 3, - "rounding": 0, - "code": "KWD", - "name_plural": "Kuwaiti dinars" - }, - "KYD": { - "symbol": "$", - "name": "Cayman Islands dollar", - "symbol_native": "$‏", - "decimal_digits": 2, - "rounding": 0, - "code": "KYD", - "name_plural": "Cayman Islands dollarS" - }, - "KZT": { - "symbol": "KZT", - "name": "Kazakhstani Tenge", - "symbol_native": "тңг.", - "decimal_digits": 2, - "rounding": 0, - "code": "KZT", - "name_plural": "Kazakhstani tenges" - }, - "LAK": { - "symbol": "₭", - "name": "Lao kip", - "symbol_native": "₭‏", - "decimal_digits": 0, - "rounding": 0, - "code": "LAK", - "name_plural": "Lao kip" - }, - "LBP": { - "symbol": "LB£", - "name": "Lebanese Pound", - "symbol_native": "ل.ل.‏", - "decimal_digits": 0, - "rounding": 0, - "code": "LBP", - "name_plural": "Lebanese pounds" - }, - "LKR": { - "symbol": "SLRs", - "name": "Sri Lankan Rupee", - "symbol_native": "SL Re", - "decimal_digits": 2, - "rounding": 0, - "code": "LKR", - "name_plural": "Sri Lankan rupees" - }, - "LRD": { - "symbol": "$", - "name": "Liberian Dollar", - "symbol_native": "$", - "decimal_digits": 2, - "rounding": 0, - "code": "LRD", - "name_plural": "Liberian Dollars" - }, - "LTL": { - "symbol": "Lt", - "name": "Lithuanian Litas", - "symbol_native": "Lt", - "decimal_digits": 2, - "rounding": 0, - "code": "LTL", - "name_plural": "Lithuanian litai" - }, - "LVL": { - "symbol": "Ls", - "name": "Latvian Lats", - "symbol_native": "Ls", - "decimal_digits": 2, - "rounding": 0, - "code": "LVL", - "name_plural": "Latvian lati" - }, - "LYD": { - "symbol": "LD", - "name": "Libyan Dinar", - "symbol_native": "د.ل.‏", - "decimal_digits": 3, - "rounding": 0, - "code": "LYD", - "name_plural": "Libyan dinars" - }, - "MAD": { - "symbol": "MAD", - "name": "Moroccan Dirham", - "symbol_native": "د.م.‏", - "decimal_digits": 2, - "rounding": 0, - "code": "MAD", - "name_plural": "Moroccan dirhams" - }, - "MDL": { - "symbol": "MDL", - "name": "Moldovan Leu", - "symbol_native": "MDL", - "decimal_digits": 2, - "rounding": 0, - "code": "MDL", - "name_plural": "Moldovan lei" - }, - "MGA": { - "symbol": "MGA", - "name": "Malagasy Ariary", - "symbol_native": "MGA", - "decimal_digits": 0, - "rounding": 0, - "code": "MGA", - "name_plural": "Malagasy Ariaries" - }, - "MKD": { - "symbol": "MKD", - "name": "Macedonian Denar", - "symbol_native": "MKD", - "decimal_digits": 2, - "rounding": 0, - "code": "MKD", - "name_plural": "Macedonian denari" - }, - "MMK": { - "symbol": "MMK", - "name": "Myanma Kyat", - "symbol_native": "K", - "decimal_digits": 0, - "rounding": 0, - "code": "MMK", - "name_plural": "Myanma kyats" - }, - "MOP": { - "symbol": "MOP$", - "name": "Macanese Pataca", - "symbol_native": "MOP$", - "decimal_digits": 2, - "rounding": 0, - "code": "MOP", - "name_plural": "Macanese patacas" - }, - "MUR": { - "symbol": "MURs", - "name": "Mauritian Rupee", - "symbol_native": "MURs", - "decimal_digits": 0, - "rounding": 0, - "code": "MUR", - "name_plural": "Mauritian rupees" - }, - "MWK": { - "symbol": "MK", - "name": "Malawian Kwacha", - "symbol_native": "MK", - "decimal_digits": 2, - "rounding": 0, - "code": "MWK", - "name_plural": "Malawian Kwacha" - }, - "MXN": { - "symbol": "MX$", - "name": "Mexican Peso", - "symbol_native": "$", - "decimal_digits": 2, - "rounding": 0, - "code": "MXN", - "name_plural": "Mexican pesos" - }, - "MYR": { - "symbol": "RM", - "name": "Malaysian Ringgit", - "symbol_native": "RM", - "decimal_digits": 2, - "rounding": 0, - "code": "MYR", - "name_plural": "Malaysian ringgits" - }, - "MZN": { - "symbol": "MTn", - "name": "Mozambican Metical", - "symbol_native": "MTn", - "decimal_digits": 2, - "rounding": 0, - "code": "MZN", - "name_plural": "Mozambican meticals" - }, - "NAD": { - "symbol": "N$", - "name": "Namibian Dollar", - "symbol_native": "N$", - "decimal_digits": 2, - "rounding": 0, - "code": "NAD", - "name_plural": "Namibian dollars" - }, - "NGN": { - "symbol": "₦", - "name": "Nigerian Naira", - "symbol_native": "₦", - "decimal_digits": 2, - "rounding": 0, - "code": "NGN", - "name_plural": "Nigerian nairas" - }, - "NIO": { - "symbol": "C$", - "name": "Nicaraguan Córdoba", - "symbol_native": "C$", - "decimal_digits": 2, - "rounding": 0, - "code": "NIO", - "name_plural": "Nicaraguan córdobas" - }, - "NOK": { - "symbol": "Nkr", - "name": "Norwegian Krone", - "symbol_native": "kr", - "decimal_digits": 2, - "rounding": 0, - "code": "NOK", - "name_plural": "Norwegian kroner" - }, - "NPR": { - "symbol": "NPRs", - "name": "Nepalese Rupee", - "symbol_native": "नेरू", - "decimal_digits": 2, - "rounding": 0, - "code": "NPR", - "name_plural": "Nepalese rupees" - }, - "NZD": { - "symbol": "NZ$", - "name": "New Zealand Dollar", - "symbol_native": "$", - "decimal_digits": 2, - "rounding": 0, - "code": "NZD", - "name_plural": "New Zealand dollars" - }, - "OMR": { - "symbol": "OMR", - "name": "Omani Rial", - "symbol_native": "ر.ع.‏", - "decimal_digits": 3, - "rounding": 0, - "code": "OMR", - "name_plural": "Omani rials" - }, - "PAB": { - "symbol": "B/.", - "name": "Panamanian Balboa", - "symbol_native": "B/.", - "decimal_digits": 2, - "rounding": 0, - "code": "PAB", - "name_plural": "Panamanian balboas" - }, - "PEN": { - "symbol": "S/.", - "name": "Peruvian Nuevo Sol", - "symbol_native": "S/.", - "decimal_digits": 2, - "rounding": 0, - "code": "PEN", - "name_plural": "Peruvian nuevos soles" - }, - "PHP": { - "symbol": "₱", - "name": "Philippine Peso", - "symbol_native": "₱", - "decimal_digits": 2, - "rounding": 0, - "code": "PHP", - "name_plural": "Philippine pesos" - }, - "PKR": { - "symbol": "PKRs", - "name": "Pakistani Rupee", - "symbol_native": "₨", - "decimal_digits": 0, - "rounding": 0, - "code": "PKR", - "name_plural": "Pakistani rupees" - }, - "PLN": { - "symbol": "zł", - "name": "Polish Zloty", - "symbol_native": "zł", - "decimal_digits": 2, - "rounding": 0, - "code": "PLN", - "name_plural": "Polish zlotys" - }, - "PYG": { - "symbol": "₲", - "name": "Paraguayan Guarani", - "symbol_native": "₲", - "decimal_digits": 0, - "rounding": 0, - "code": "PYG", - "name_plural": "Paraguayan guaranis" - }, - "QAR": { - "symbol": "QR", - "name": "Qatari Rial", - "symbol_native": "ر.ق.‏", - "decimal_digits": 2, - "rounding": 0, - "code": "QAR", - "name_plural": "Qatari rials" - }, - "RON": { - "symbol": "RON", - "name": "Romanian Leu", - "symbol_native": "RON", - "decimal_digits": 2, - "rounding": 0, - "code": "RON", - "name_plural": "Romanian lei" - }, - "RSD": { - "symbol": "din.", - "name": "Serbian Dinar", - "symbol_native": "дин.", - "decimal_digits": 0, - "rounding": 0, - "code": "RSD", - "name_plural": "Serbian dinars" - }, - "RUB": { - "symbol": "RUB", - "name": "Russian Ruble", - "symbol_native": "руб.", - "decimal_digits": 2, - "rounding": 0, - "code": "RUB", - "name_plural": "Russian rubles" - }, - "RWF": { - "symbol": "RWF", - "name": "Rwandan Franc", - "symbol_native": "FR", - "decimal_digits": 0, - "rounding": 0, - "code": "RWF", - "name_plural": "Rwandan francs" - }, - "SAR": { - "symbol": "SR", - "name": "Saudi Riyal", - "symbol_native": "ر.س.‏", - "decimal_digits": 2, - "rounding": 0, - "code": "SAR", - "name_plural": "Saudi riyals" - }, - "SBD": { - "symbol": "$", - "name": "Solomon Islander Dollar", - "symbol_native": "$", - "decimal_digits": 2, - "rounding": 0, - "code": "SBD", - "name_plural": "Solomon Islander Dollars" - }, - "SDG": { - "symbol": "SDG", - "name": "Sudanese Pound", - "symbol_native": "SDG", - "decimal_digits": 2, - "rounding": 0, - "code": "SDG", - "name_plural": "Sudanese pounds" - }, - "SEK": { - "symbol": "Skr", - "name": "Swedish Krona", - "symbol_native": "kr", - "decimal_digits": 2, - "rounding": 0, - "code": "SEK", - "name_plural": "Swedish kronor" - }, - "SGD": { - "symbol": "S$", - "name": "Singapore Dollar", - "symbol_native": "$", - "decimal_digits": 2, - "rounding": 0, - "code": "SGD", - "name_plural": "Singapore dollars" - }, - "SLL": { - "symbol": "Le", - "name": "Sierra Leonean Leone", - "symbol_native": "Le", - "decimal_digits": 2, - "rounding": 0, - "code": "SLL", - "name_plural": "Sierra Leonean Leone" - }, - "SOS": { - "symbol": "Ssh", - "name": "Somali Shilling", - "symbol_native": "Ssh", - "decimal_digits": 0, - "rounding": 0, - "code": "SOS", - "name_plural": "Somali shillings" - }, - "SSP": { - "symbol": "£", - "name": "South Sudanese pound", - "symbol_native": "£", - "decimal_digits": 2, - "rounding": 0, - "code": "SSP", - "name_plural": "South Sudanese pound" - }, - "STD": { - "symbol": "Db", - "name": "Sao Tomean Dobra", - "symbol_native": "Db", - "decimal_digits": 0, - "rounding": 0, - "code": "STD", - "name_plural": "Sao Tomean Dobra" - }, - "STN": { - "symbol": "Db", - "name": "Sao Tomean Dobra", - "symbol_native": "Db", - "decimal_digits": 0, - "rounding": 0, - "code": "STN", - "name_plural": "Sao Tomean Dobra" - }, - "SYP": { - "symbol": "SY£", - "name": "Syrian Pound", - "symbol_native": "ل.س.‏", - "decimal_digits": 0, - "rounding": 0, - "code": "SYP", - "name_plural": "Syrian pounds" - }, - "SZL": { - "symbol": "L", - "name": "Swazi Lilangeni", - "symbol_native": "L‏", - "decimal_digits": 0, - "rounding": 0, - "code": "SZL", - "name_plural": "Swazi Lilangeni" - }, - "THB": { - "symbol": "฿", - "name": "Thai Baht", - "symbol_native": "฿", - "decimal_digits": 2, - "rounding": 0, - "code": "THB", - "name_plural": "Thai baht" - }, - "TJS": { - "symbol": "ЅМ", - "name": "Tajikistani Somoni", - "symbol_native": "ЅМ", - "decimal_digits": 2, - "rounding": 0, - "code": "THB", - "name_plural": "Tajikistani Somoni" - }, - "TND": { - "symbol": "DT", - "name": "Tunisian Dinar", - "symbol_native": "د.ت.‏", - "decimal_digits": 3, - "rounding": 0, - "code": "TND", - "name_plural": "Tunisian dinars" - }, - "TOP": { - "symbol": "T$", - "name": "Tongan Paʻanga", - "symbol_native": "T$", - "decimal_digits": 2, - "rounding": 0, - "code": "TOP", - "name_plural": "Tongan paʻanga" - }, - "TRY": { - "symbol": "TL", - "name": "Turkish Lira", - "symbol_native": "TL", - "decimal_digits": 2, - "rounding": 0, - "code": "TRY", - "name_plural": "Turkish Lira" - }, - "TTD": { - "symbol": "TT$", - "name": "Trinidad and Tobago Dollar", - "symbol_native": "$", - "decimal_digits": 2, - "rounding": 0, - "code": "TTD", - "name_plural": "Trinidad and Tobago dollars" - }, - "TWD": { - "symbol": "NT$", - "name": "New Taiwan Dollar", - "symbol_native": "NT$", - "decimal_digits": 2, - "rounding": 0, - "code": "TWD", - "name_plural": "New Taiwan dollars" - }, - "TZS": { - "symbol": "TSh", - "name": "Tanzanian Shilling", - "symbol_native": "TSh", - "decimal_digits": 0, - "rounding": 0, - "code": "TZS", - "name_plural": "Tanzanian shillings" - }, - "UAH": { - "symbol": "₴", - "name": "Ukrainian Hryvnia", - "symbol_native": "₴", - "decimal_digits": 2, - "rounding": 0, - "code": "UAH", - "name_plural": "Ukrainian hryvnias" - }, - "UGX": { - "symbol": "USh", - "name": "Ugandan Shilling", - "symbol_native": "USh", - "decimal_digits": 0, - "rounding": 0, - "code": "UGX", - "name_plural": "Ugandan shillings" - }, - "UYU": { - "symbol": "$U", - "name": "Uruguayan Peso", - "symbol_native": "$", - "decimal_digits": 2, - "rounding": 0, - "code": "UYU", - "name_plural": "Uruguayan pesos" - }, - "UZS": { - "symbol": "UZS", - "name": "Uzbekistan Som", - "symbol_native": "UZS", - "decimal_digits": 0, - "rounding": 0, - "code": "UZS", - "name_plural": "Uzbekistan som" - }, - "VEF": { - "symbol": "Bs.F.", - "name": "Venezuelan Bolívar", - "symbol_native": "Bs.F.", - "decimal_digits": 2, - "rounding": 0, - "code": "VEF", - "name_plural": "Venezuelan bolívars" - }, - "VND": { - "symbol": "₫", - "name": "Vietnamese Dong", - "symbol_native": "₫", - "decimal_digits": 0, - "rounding": 0, - "code": "VND", - "name_plural": "Vietnamese dong" - }, - "VUV": { - "symbol": "Vt", - "name": "Ni-Vanuatu Vatu", - "symbol_native": "Vt", - "decimal_digits": 0, - "rounding": 0, - "code": "VUV", - "name_plural": "Ni-Vanuatu Vatu" - }, - "XAF": { - "symbol": "FCFA", - "name": "CFA Franc BEAC", - "symbol_native": "FCFA", - "decimal_digits": 0, - "rounding": 0, - "code": "XAF", - "name_plural": "CFA francs BEAC" - }, - "XCD": { - "symbol": "$", - "name": "East Caribbean Dollar", - "symbol_native": "$", - "decimal_digits": 0, - "rounding": 0, - "code": "XCD", - "name_plural": "East Caribbean Dollars" - }, - "XOF": { - "symbol": "CFA", - "name": "CFA Franc BCEAO", - "symbol_native": "CFA", - "decimal_digits": 0, - "rounding": 0, - "code": "XOF", - "name_plural": "CFA francs BCEAO" - }, - "XPF": { - "symbol": "Fr", - "name": "CFP franc", - "symbol_native": "Fr", - "decimal_digits": 0, - "rounding": 0, - "code": "XPF", - "name_plural": "CFP franc" - }, - "YER": { - "symbol": "YR", - "name": "Yemeni Rial", - "symbol_native": "ر.ي.‏", - "decimal_digits": 0, - "rounding": 0, - "code": "YER", - "name_plural": "Yemeni rials" - }, - "ZAR": { - "symbol": "R", - "name": "South African Rand", - "symbol_native": "R", - "decimal_digits": 2, - "rounding": 0, - "code": "ZAR", - "name_plural": "South African rand" - }, - "ZMK": { - "symbol": "ZK", - "name": "Zambian Kwacha", - "symbol_native": "ZK", - "decimal_digits": 0, - "rounding": 0, - "code": "ZMK", - "name_plural": "Zambian kwachas" - } -}; - -/***/ }), -/* 2 */ -/***/ (function(module, exports, __webpack_require__) { - -var disposed = false -var normalizeComponent = __webpack_require__(0) -/* script */ -var __vue_script__ = __webpack_require__(13) -/* template */ -var __vue_template__ = __webpack_require__(14) -/* template functional */ -var __vue_template_functional__ = false -/* styles */ -var __vue_styles__ = null -/* scopeId */ -var __vue_scopeId__ = null -/* moduleIdentifier (server only) */ -var __vue_module_identifier__ = null -var Component = normalizeComponent( - __vue_script__, - __vue_template__, - __vue_template_functional__, - __vue_styles__, - __vue_scopeId__, - __vue_module_identifier__ -) -Component.options.__file = "resources/js/components/PaginationLinks.vue" - -/* hot reload */ -if (false) {(function () { - var hotAPI = require("vue-hot-reload-api") - hotAPI.install(require("vue"), false) - if (!hotAPI.compatible) return - module.hot.accept() - if (!module.hot.data) { - hotAPI.createRecord("data-v-2963ad24", Component.options) - } else { - hotAPI.reload("data-v-2963ad24", Component.options) - } - module.hot.dispose(function (data) { - disposed = true - }) -})()} - -module.exports = Component.exports - - -/***/ }), -/* 3 */ -/***/ (function(module, exports, __webpack_require__) { - -__webpack_require__(4); -module.exports = __webpack_require__(43); - - -/***/ }), -/* 4 */ -/***/ (function(module, exports, __webpack_require__) { - -Nova.booting(function (Vue, router) { - Vue.config.devtools = true; - - router.addRoutes([{ - name: "nova-stripe", - path: "/nova-stripe", - component: __webpack_require__(5) - }, { - name: "charge-detail", - path: "/nova-stripe/charge/:chargeId", - component: __webpack_require__(20), - props: true - }, { - name: "customer-list", - path: "/nova-stripe/customers", - component: __webpack_require__(26), - props: true - }, { - name: "customer-detail", - path: "/nova-stripe/customers/:customerId", - component: __webpack_require__(37), - props: true - }]); -}); - -/***/ }), -/* 5 */ -/***/ (function(module, exports, __webpack_require__) { - -var disposed = false -var normalizeComponent = __webpack_require__(0) -/* script */ -var __vue_script__ = __webpack_require__(6) -/* template */ -var __vue_template__ = __webpack_require__(19) -/* template functional */ -var __vue_template_functional__ = false -/* styles */ -var __vue_styles__ = null -/* scopeId */ -var __vue_scopeId__ = null -/* moduleIdentifier (server only) */ -var __vue_module_identifier__ = null -var Component = normalizeComponent( - __vue_script__, - __vue_template__, - __vue_template_functional__, - __vue_styles__, - __vue_scopeId__, - __vue_module_identifier__ -) -Component.options.__file = "resources/js/views/Index.vue" - -/* hot reload */ -if (false) {(function () { - var hotAPI = require("vue-hot-reload-api") - hotAPI.install(require("vue"), false) - if (!hotAPI.compatible) return - module.hot.accept() - if (!module.hot.data) { - hotAPI.createRecord("data-v-494d9643", Component.options) - } else { - hotAPI.reload("data-v-494d9643", Component.options) - } - module.hot.dispose(function (data) { - disposed = true - }) -})()} - -module.exports = Component.exports - - -/***/ }), -/* 6 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__components_BalanceCard_vue__ = __webpack_require__(7); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__components_BalanceCard_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__components_BalanceCard_vue__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__components_ChargesTable_vue__ = __webpack_require__(11); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__components_ChargesTable_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__components_ChargesTable_vue__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__components_ColumnSelect__ = __webpack_require__(16); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__components_ColumnSelect___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2__components_ColumnSelect__); -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// - - - - - -/* harmony default export */ __webpack_exports__["default"] = ({ - components: { BalanceCard: __WEBPACK_IMPORTED_MODULE_0__components_BalanceCard_vue___default.a, ChargesTable: __WEBPACK_IMPORTED_MODULE_1__components_ChargesTable_vue___default.a, ColumnSelect: __WEBPACK_IMPORTED_MODULE_2__components_ColumnSelect___default.a }, - data: function data() { - return { - selectedColumns: ['id', 'amount', 'created', 'status'], - singleCharge: {} - }; - } -}); - -/***/ }), -/* 7 */ -/***/ (function(module, exports, __webpack_require__) { - -var disposed = false -var normalizeComponent = __webpack_require__(0) -/* script */ -var __vue_script__ = __webpack_require__(8) -/* template */ -var __vue_template__ = __webpack_require__(10) -/* template functional */ -var __vue_template_functional__ = false -/* styles */ -var __vue_styles__ = null -/* scopeId */ -var __vue_scopeId__ = null -/* moduleIdentifier (server only) */ -var __vue_module_identifier__ = null -var Component = normalizeComponent( - __vue_script__, - __vue_template__, - __vue_template_functional__, - __vue_styles__, - __vue_scopeId__, - __vue_module_identifier__ -) -Component.options.__file = "resources/js/components/BalanceCard.vue" - -/* hot reload */ -if (false) {(function () { - var hotAPI = require("vue-hot-reload-api") - hotAPI.install(require("vue"), false) - if (!hotAPI.compatible) return - module.hot.accept() - if (!module.hot.data) { - hotAPI.createRecord("data-v-6441a4f1", Component.options) - } else { - hotAPI.reload("data-v-6441a4f1", Component.options) - } - module.hot.dispose(function (data) { - disposed = true - }) -})()} - -module.exports = Component.exports - - -/***/ }), -/* 8 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils_moneyFormat__ = __webpack_require__(1); -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// - - - -/* harmony default export */ __webpack_exports__["default"] = ({ - data: function data() { - return { - initialLoading: true, - balance: {} - }; - }, - - - methods: { - getBalance: function getBalance() { - var _this = this; - - Nova.request().get('/nova-vendor/nova-stripe/stripe/balance').then(function (response) { - _this.balance = response.data.balance; - _this.initialLoading = false; - }); - } - }, - - created: function created() { - this.getBalance(); - }, - - - filters: { - money: __WEBPACK_IMPORTED_MODULE_0__utils_moneyFormat__["a" /* default */] - } -}); - -/***/ }), -/* 9 */ -/***/ (function(module, exports, __webpack_require__) { - -/* - currency.js - v1.2.2 - http://scurker.github.io/currency.js - - Copyright (c) 2019 Jason Wilson - Released under MIT license -*/ -(function(d,c){ true?module.exports=c():"function"===typeof define&&define.amd?define(c):(d=d||self,d.currency=c())})(this,function(){function d(b,a){if(!(this instanceof d))return new d(b,a);a=Object.assign({},m,a);var f=Math.pow(10,a.precision);this.intValue=b=c(b,a);this.value=b/f;a.increment=a.increment||1/f;a.groups=a.useVedic?n:p;this.s=a;this.p=f}function c(b,a){var f=2 1; - } - }, - methods: { - moment: moment, - listCharges: function listCharges(params) { - var _this = this; - - Nova.request().get("/nova-vendor/nova-stripe/stripe/charges", { params: params }).then(function (response) { - _this.charges = response.data.charges.data; - _this.charges.length > 0 ? _this.$emit('charge', _this.charges[0]) : ''; - _this.hasMore = response.data.charges.has_more; - _this.initialLoading = false; - _this.loading = false; - }); - }, - nextPage: function nextPage() { - this.loading = true; - - this.listCharges({ - starting_after: this.charges[this.charges.length - 1].id - }); - - this.page++; - }, - previousPage: function previousPage() { - this.loading = true; - - this.listCharges({ ending_before: this.charges[0].id }); - - if (this.hasPrevious) { - this.page--; - } - }, - statusClass: function statusClass(status) { - return this.statusClassList[status]; - } - }, - filters: { - date: function date(_date) { - return moment.unix(_date).format("YYYY/MM/DD h:mm:ss a"); - }, - - - money: __WEBPACK_IMPORTED_MODULE_1__utils_moneyFormat__["a" /* default */] - }, - created: function created() { - this.listCharges(); - } -}); - -/***/ }), -/* 13 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// - -/* harmony default export */ __webpack_exports__["default"] = ({ - props: ['resource', 'hasMore', 'hasPrevious'], - - methods: { - /** - * Select the previous page. - */ - previousPage: function previousPage() { - this.$emit('previous'); - }, - - - /** - * Select the next page. - */ - nextPage: function nextPage() { - this.$emit('next'); - } - } -}); - -/***/ }), -/* 14 */ -/***/ (function(module, exports, __webpack_require__) { - -var render = function() { - var _vm = this - var _h = _vm.$createElement - var _c = _vm._self._c || _h - return _c("div", { staticClass: "bg-20 rounded-b" }, [ - _vm.resource.length > 0 - ? _c("nav", { staticClass: "flex" }, [ - _c( - "button", - { - staticClass: "btn btn-link py-3 px-4", - class: { - "text-primary dim": _vm.hasPrevious, - "text-80 opacity-50 cursor-not-allowed": !_vm.hasPrevious - }, - attrs: { - disabled: !_vm.hasPrevious, - rel: "prev", - dusk: "previous" - }, - on: { - click: function($event) { - $event.preventDefault() - return _vm.previousPage() - } - } - }, - [ - _vm._v( - "\n " + _vm._s(_vm.__("Previous")) + "\n " - ) - ] - ), - _vm._v(" "), - _c( - "button", - { - staticClass: "ml-auto btn btn-link py-3 px-4", - class: { - "text-primary dim": _vm.hasMore, - "text-80 opacity-50 cursor-not-allowed": !_vm.hasMore - }, - attrs: { disabled: !_vm.hasMore, rel: "next", dusk: "next" }, - on: { - click: function($event) { - $event.preventDefault() - return _vm.nextPage() - } - } - }, - [_vm._v("\n " + _vm._s(_vm.__("Next")) + "\n ")] - ) - ]) - : _vm._e() - ]) -} -var staticRenderFns = [] -render._withStripped = true -module.exports = { render: render, staticRenderFns: staticRenderFns } -if (false) { - module.hot.accept() - if (module.hot.data) { - require("vue-hot-reload-api") .rerender("data-v-2963ad24", module.exports) - } -} - -/***/ }), -/* 15 */ -/***/ (function(module, exports, __webpack_require__) { - -var render = function() { - var _vm = this - var _h = _vm.$createElement - var _c = _vm._self._c || _h - return _c( - "loading-view", - { attrs: { loading: _vm.initialLoading } }, - [ - _c( - "loading-card", - { staticClass: "card relative", attrs: { loading: _vm.loading } }, - [ - _c("div", { staticClass: "overflow-x-auto" }, [ - _vm.charges.length > 0 - ? _c( - "table", - { - staticClass: "table w-full", - attrs: { - cellpadding: "0", - cellspacing: "0", - "data-testid": "resource-table" - } - }, - [ - _c("thead", [ - _c( - "tr", - [ - _vm._l(_vm.columns, function(column) { - return _vm.columns - ? _c("th", { staticClass: "text-left" }, [ - _c( - "span", - { - staticClass: - "inline-flex items-center capitalize" - }, - [ - _vm._v( - "\n " + - _vm._s(column.replaceAll("_", " ")) + - "\n " - ) - ] - ) - ]) - : _vm._e() - }), - _vm._v(" "), - _c("th", [_vm._v(" ")]) - ], - 2 - ) - ]), - _vm._v(" "), - _vm._l(_vm.charges, function(charge) { - return _c("tbody", [ - _c( - "tr", - [ - _vm._l(_vm.columns, function(column) { - return _c("td", [ - _vm.moneyColumns.find(function(moneyColumn) { - return moneyColumn === column - }) - ? _c("span", [ - _vm._v( - _vm._s( - _vm._f("money")( - charge.currency, - charge[column] - ) - ) - ) - ]) - : _vm.dateColumns.find(function(dateColumn) { - return dateColumn === column - }) - ? _c("span", [ - _vm._v( - _vm._s(_vm._f("date")(charge[column])) - ) - ]) - : column === "status" - ? _c( - "span", - { - staticClass: - "rounded-lg px-3 py-1 capitalize text-xs font-black", - class: _vm.statusClass(charge.status) - }, - [ - _vm._v( - _vm._s( - charge.refunded - ? "Refunded" - : charge.status - ) - ) - ] - ) - : _c("span", [_vm._v(_vm._s(charge[column]))]) - ]) - }), - _vm._v(" "), - _c("td", [ - _c( - "span", - [ - _c( - "router-link", - { - staticClass: - "cursor-pointer text-70 hover:text-primary mr-3", - attrs: { - to: { - name: "charge-detail", - params: { - chargeId: charge.id - } - }, - title: _vm.__("View") - } - }, - [ - _c("icon", { - attrs: { - type: "view", - width: "22", - height: "18", - "view-box": "0 0 22 16" - } - }) - ], - 1 - ) - ], - 1 - ) - ]) - ], - 2 - ) - ]) - }) - ], - 2 - ) - : _vm._e() - ]), - _vm._v(" "), - _c("ChargesPaginationLinks", { - attrs: { - resource: _vm.charges, - hasMore: _vm.hasMore, - hasPrevious: _vm.hasPrevious - }, - on: { previous: _vm.previousPage, next: _vm.nextPage } - }) - ], - 1 - ) - ], - 1 - ) -} -var staticRenderFns = [] -render._withStripped = true -module.exports = { render: render, staticRenderFns: staticRenderFns } -if (false) { - module.hot.accept() - if (module.hot.data) { - require("vue-hot-reload-api") .rerender("data-v-f151498c", module.exports) - } -} - -/***/ }), -/* 16 */ -/***/ (function(module, exports, __webpack_require__) { - -var disposed = false -var normalizeComponent = __webpack_require__(0) -/* script */ -var __vue_script__ = __webpack_require__(17) -/* template */ -var __vue_template__ = __webpack_require__(18) -/* template functional */ -var __vue_template_functional__ = false -/* styles */ -var __vue_styles__ = null -/* scopeId */ -var __vue_scopeId__ = null -/* moduleIdentifier (server only) */ -var __vue_module_identifier__ = null -var Component = normalizeComponent( - __vue_script__, - __vue_template__, - __vue_template_functional__, - __vue_styles__, - __vue_scopeId__, - __vue_module_identifier__ -) -Component.options.__file = "resources/js/components/ColumnSelect.vue" - -/* hot reload */ -if (false) {(function () { - var hotAPI = require("vue-hot-reload-api") - hotAPI.install(require("vue"), false) - if (!hotAPI.compatible) return - module.hot.accept() - if (!module.hot.data) { - hotAPI.createRecord("data-v-3cd0c6dd", Component.options) - } else { - hotAPI.reload("data-v-3cd0c6dd", Component.options) - } - module.hot.dispose(function (data) { - disposed = true - }) -})()} - -module.exports = Component.exports - - -/***/ }), -/* 17 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// - -/* harmony default export */ __webpack_exports__["default"] = ({ - props: ['resource'], - data: function data() { - return { - checkedColumns: this.$attrs.value - }; - } -}); - -/***/ }), -/* 18 */ -/***/ (function(module, exports, __webpack_require__) { - -var render = function() { - var _vm = this - var _h = _vm.$createElement - var _c = _vm._self._c || _h - return _c( - "div", - { staticClass: "flex justify-end p-2" }, - [ - _c( - "dropdown", - { attrs: { offset: "-480" } }, - [ - _c( - "dropdown-trigger", - { staticClass: "text-90 bg-30 px-3 border-2 border-30 rounded" }, - [_vm._v("Select Columns")] - ), - _vm._v(" "), - _c( - "dropdown-menu", - { - staticClass: "p-3 text-90", - staticStyle: { width: "100%", columns: "25vw 3" }, - attrs: { slot: "menu", direction: "rtl" }, - slot: "menu" - }, - _vm._l(_vm.resource, function(key, value) { - return _vm.resource - ? _c("div", { staticClass: "mb-2" }, [ - _c("input", { - directives: [ - { - name: "model", - rawName: "v-model", - value: _vm.checkedColumns, - expression: "checkedColumns" - } - ], - attrs: { type: "checkbox", id: value }, - domProps: { - value: value, - checked: Array.isArray(_vm.checkedColumns) - ? _vm._i(_vm.checkedColumns, value) > -1 - : _vm.checkedColumns - }, - on: { - change: [ - function($event) { - var $$a = _vm.checkedColumns, - $$el = $event.target, - $$c = $$el.checked ? true : false - if (Array.isArray($$a)) { - var $$v = value, - $$i = _vm._i($$a, $$v) - if ($$el.checked) { - $$i < 0 && - (_vm.checkedColumns = $$a.concat([$$v])) - } else { - $$i > -1 && - (_vm.checkedColumns = $$a - .slice(0, $$i) - .concat($$a.slice($$i + 1))) - } - } else { - _vm.checkedColumns = $$c - } - }, - function($event) { - return _vm.$emit( - "checkedColumns", - _vm.checkedColumns - ) - } - ] - } - }), - _vm._v(" "), - _c( - "label", - { staticClass: "capitalize", attrs: { for: value } }, - [_vm._v(_vm._s(value.replaceAll("_", " ")))] - ) - ]) - : _vm._e() - }), - 0 - ) - ], - 1 - ) - ], - 1 - ) -} -var staticRenderFns = [] -render._withStripped = true -module.exports = { render: render, staticRenderFns: staticRenderFns } -if (false) { - module.hot.accept() - if (module.hot.data) { - require("vue-hot-reload-api") .rerender("data-v-3cd0c6dd", module.exports) - } -} - -/***/ }), -/* 19 */ -/***/ (function(module, exports, __webpack_require__) { - -var render = function() { - var _vm = this - var _h = _vm.$createElement - var _c = _vm._self._c || _h - return _c( - "div", - [ - _c("heading", { staticClass: "mb-6" }, [_vm._v("Stripe Dashboard")]), - _vm._v(" "), - _c("BalanceCard"), - _vm._v(" "), - _c( - "card", - [ - _c("ColumnSelect", { - attrs: { resource: _vm.singleCharge }, - on: { - checkedColumns: function($event) { - _vm.selectedColumns = $event - } - }, - model: { - value: _vm.selectedColumns, - callback: function($$v) { - _vm.selectedColumns = $$v - }, - expression: "selectedColumns" - } - }), - _vm._v(" "), - _c("ChargesTable", { - attrs: { columns: _vm.selectedColumns }, - on: { - charge: function($event) { - _vm.singleCharge = $event - } - } - }) - ], - 1 - ) - ], - 1 - ) -} -var staticRenderFns = [] -render._withStripped = true -module.exports = { render: render, staticRenderFns: staticRenderFns } -if (false) { - module.hot.accept() - if (module.hot.data) { - require("vue-hot-reload-api") .rerender("data-v-494d9643", module.exports) - } -} - -/***/ }), -/* 20 */ -/***/ (function(module, exports, __webpack_require__) { - -var disposed = false -var normalizeComponent = __webpack_require__(0) -/* script */ -var __vue_script__ = __webpack_require__(21) -/* template */ -var __vue_template__ = __webpack_require__(25) -/* template functional */ -var __vue_template_functional__ = false -/* styles */ -var __vue_styles__ = null -/* scopeId */ -var __vue_scopeId__ = null -/* moduleIdentifier (server only) */ -var __vue_module_identifier__ = null -var Component = normalizeComponent( - __vue_script__, - __vue_template__, - __vue_template_functional__, - __vue_styles__, - __vue_scopeId__, - __vue_module_identifier__ -) -Component.options.__file = "resources/js/views/Detail.vue" - -/* hot reload */ -if (false) {(function () { - var hotAPI = require("vue-hot-reload-api") - hotAPI.install(require("vue"), false) - if (!hotAPI.compatible) return - module.hot.accept() - if (!module.hot.data) { - hotAPI.createRecord("data-v-78b841b0", Component.options) - } else { - hotAPI.reload("data-v-78b841b0", Component.options) - } - module.hot.dispose(function (data) { - disposed = true - }) -})()} - -module.exports = Component.exports - - -/***/ }), -/* 21 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__components_ChargeDetailCard_vue__ = __webpack_require__(22); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__components_ChargeDetailCard_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__components_ChargeDetailCard_vue__); -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// - - - -/* harmony default export */ __webpack_exports__["default"] = ({ - props: ['chargeId'], - components: { ChargeDetailCard: __WEBPACK_IMPORTED_MODULE_0__components_ChargeDetailCard_vue___default.a }, - data: function data() { - return { - charge: undefined, - deleting: false - }; - }, - - methods: { - refund: function refund(chargeId) { - var _this = this; - - this.deleting = true; - - Nova.request().post('/nova-vendor/nova-stripe/stripe/charges/' + this.chargeId + '/refund').then(function (response) { - Nova.success('Charge Successfully Refunded!'); - _this.$refs.detail.getCharge(); - }); - - this.deleting = false; - } - } -}); - -/***/ }), -/* 22 */ -/***/ (function(module, exports, __webpack_require__) { - -var disposed = false -var normalizeComponent = __webpack_require__(0) -/* script */ -var __vue_script__ = __webpack_require__(23) -/* template */ -var __vue_template__ = __webpack_require__(24) -/* template functional */ -var __vue_template_functional__ = false -/* styles */ -var __vue_styles__ = null -/* scopeId */ -var __vue_scopeId__ = null -/* moduleIdentifier (server only) */ -var __vue_module_identifier__ = null -var Component = normalizeComponent( - __vue_script__, - __vue_template__, - __vue_template_functional__, - __vue_styles__, - __vue_scopeId__, - __vue_module_identifier__ -) -Component.options.__file = "resources/js/components/ChargeDetailCard.vue" - -/* hot reload */ -if (false) {(function () { - var hotAPI = require("vue-hot-reload-api") - hotAPI.install(require("vue"), false) - if (!hotAPI.compatible) return - module.hot.accept() - if (!module.hot.data) { - hotAPI.createRecord("data-v-7fa87680", Component.options) - } else { - hotAPI.reload("data-v-7fa87680", Component.options) - } - module.hot.dispose(function (data) { - disposed = true - }) -})()} - -module.exports = Component.exports - - -/***/ }), -/* 23 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// - -/* harmony default export */ __webpack_exports__["default"] = ({ - props: ["chargeId"], - - data: function data() { - return { - initialLoading: true, - charge: { - amount: 0, - currency: "" - } - }; - }, - - - computed: { - amount: function amount() { - return this.formatMoney(this.charge.amount, this.charge.currency); - }, - fee: function fee() { - if (!this.charge.balance_transaction) { - return 0; - } - - return this.formatMoney(this.charge.balance_transaction.fee, this.charge.balance_transaction.currency); - }, - net: function net() { - if (!this.charge.balance_transaction) { - return 0; - } - - return this.formatMoney(this.charge.amount - this.charge.balance_transaction.fee, this.charge.currency); - }, - date: function date() { - return moment.unix(this.charge.created).format("YYYY/MM/DD h:mm:ss a"); - } - }, - - methods: { - moment: moment, - - getCharge: function getCharge() { - var _this = this; - - Nova.request().get("/nova-vendor/nova-stripe/stripe/charges/" + this.chargeId).then(function (response) { - _this.charge = response.data.charge; - _this.initialLoading = false; - _this.$emit('charge-loaded', response.data.charge); - }); - }, - formatMoney: function formatMoney(amount, currency) { - return (amount / 100).toFixed(2) + " " + currency.toUpperCase(); - } - }, - - created: function created() { - this.getCharge(); - } -}); - -/***/ }), -/* 24 */ -/***/ (function(module, exports, __webpack_require__) { - -var render = function() { - var _vm = this - var _h = _vm.$createElement - var _c = _vm._self._c || _h - return _c( - "loading-card", - { staticClass: "mb-6 py-3 px-6", attrs: { loading: _vm.initialLoading } }, - [ - _c("detail-text-field", { - attrs: { field: { name: "ID", value: _vm.charge.id } } - }), - _vm._v(" "), - _c("detail-text-field", { - attrs: { field: { name: "Amount", value: _vm.amount } } - }), - _vm._v(" "), - _c("detail-text-field", { - attrs: { field: { name: "Fee", value: _vm.fee } } - }), - _vm._v(" "), - _c("detail-text-field", { - attrs: { field: { name: "Net", value: _vm.net } } - }), - _vm._v(" "), - _c("detail-text-field", { - attrs: { field: { name: "Status", value: _vm.charge.status } } - }), - _vm._v(" "), - _c("detail-text-field", { - attrs: { field: { name: "Created", value: _vm.date } } - }), - _vm._v(" "), - _c("detail-text-field", { - attrs: { field: { name: "Metadata", value: _vm.charge.metadata } } - }), - _vm._v(" "), - _c("detail-boolean-field", { - attrs: { field: { name: "Livemode", value: _vm.charge.livemode } } - }), - _vm._v(" "), - _c("detail-boolean-field", { - attrs: { field: { name: "Captured", value: _vm.charge.captured } } - }), - _vm._v(" "), - _c("detail-boolean-field", { - attrs: { field: { name: "Paid", value: _vm.charge.paid } } - }), - _vm._v(" "), - _c("detail-boolean-field", { - attrs: { field: { name: "Refunded", value: _vm.charge.refunded } } - }), - _vm._v(" "), - _c("detail-text-field", { - attrs: { field: { name: "Dispute", value: _vm.charge.dispute } } - }), - _vm._v(" "), - _c("detail-text-field", { - attrs: { - field: { name: "Fraud Details", value: _vm.charge.fraud_details } - } - }), - _vm._v(" "), - _c("detail-text-field", { - attrs: { - field: { name: "Transfer Group", value: _vm.charge.transfer_group } - } - }) - ], - 1 - ) -} -var staticRenderFns = [] -render._withStripped = true -module.exports = { render: render, staticRenderFns: staticRenderFns } -if (false) { - module.hot.accept() - if (module.hot.data) { - require("vue-hot-reload-api") .rerender("data-v-7fa87680", module.exports) - } -} - -/***/ }), -/* 25 */ -/***/ (function(module, exports, __webpack_require__) { - -var render = function() { - var _vm = this - var _h = _vm.$createElement - var _c = _vm._self._c || _h - return _c( - "div", - [ - _c("heading", { staticClass: "mb-6" }, [_vm._v("Charge Details")]), - _vm._v(" "), - _c("div", { staticClass: "flex flex-row-reverse mb-3" }, [ - _vm.charge && !_vm.charge.refunded - ? _c( - "button", - { - staticClass: "btn-primary px-4 py-2 rounded", - attrs: { disabled: _vm.deleting }, - on: { - click: function($event) { - return _vm.refund(_vm.charge.id) - } - } - }, - [_vm._v("\n Refund\n ")] - ) - : _vm._e() - ]), - _vm._v(" "), - _c("ChargeDetailCard", { - ref: "detail", - attrs: { "charge-id": _vm.chargeId }, - on: { - "charge-loaded": function($event) { - _vm.charge = $event - } - } - }) - ], - 1 - ) -} -var staticRenderFns = [] -render._withStripped = true -module.exports = { render: render, staticRenderFns: staticRenderFns } -if (false) { - module.hot.accept() - if (module.hot.data) { - require("vue-hot-reload-api") .rerender("data-v-78b841b0", module.exports) - } -} - -/***/ }), -/* 26 */ -/***/ (function(module, exports, __webpack_require__) { - -var disposed = false -var normalizeComponent = __webpack_require__(0) -/* script */ -var __vue_script__ = __webpack_require__(27) -/* template */ -var __vue_template__ = __webpack_require__(36) -/* template functional */ -var __vue_template_functional__ = false -/* styles */ -var __vue_styles__ = null -/* scopeId */ -var __vue_scopeId__ = null -/* moduleIdentifier (server only) */ -var __vue_module_identifier__ = null -var Component = normalizeComponent( - __vue_script__, - __vue_template__, - __vue_template_functional__, - __vue_styles__, - __vue_scopeId__, - __vue_module_identifier__ -) -Component.options.__file = "resources/js/views/Customers.vue" - -/* hot reload */ -if (false) {(function () { - var hotAPI = require("vue-hot-reload-api") - hotAPI.install(require("vue"), false) - if (!hotAPI.compatible) return - module.hot.accept() - if (!module.hot.data) { - hotAPI.createRecord("data-v-c9944874", Component.options) - } else { - hotAPI.reload("data-v-c9944874", Component.options) - } - module.hot.dispose(function (data) { - disposed = true - }) -})()} - -module.exports = Component.exports - - -/***/ }), -/* 27 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__components_CustomersTable__ = __webpack_require__(28); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__components_CustomersTable___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__components_CustomersTable__); -// -// -// -// -// -// -// -// - - - -/* harmony default export */ __webpack_exports__["default"] = ({ - components: { CustomersTable: __WEBPACK_IMPORTED_MODULE_0__components_CustomersTable___default.a } -}); - -/***/ }), -/* 28 */ -/***/ (function(module, exports, __webpack_require__) { - -var disposed = false -function injectStyle (ssrContext) { - if (disposed) return - __webpack_require__(29) -} -var normalizeComponent = __webpack_require__(0) -/* script */ -var __vue_script__ = __webpack_require__(34) -/* template */ -var __vue_template__ = __webpack_require__(35) -/* template functional */ -var __vue_template_functional__ = false -/* styles */ -var __vue_styles__ = injectStyle -/* scopeId */ -var __vue_scopeId__ = null -/* moduleIdentifier (server only) */ -var __vue_module_identifier__ = null -var Component = normalizeComponent( - __vue_script__, - __vue_template__, - __vue_template_functional__, - __vue_styles__, - __vue_scopeId__, - __vue_module_identifier__ -) -Component.options.__file = "resources/js/components/CustomersTable.vue" - -/* hot reload */ -if (false) {(function () { - var hotAPI = require("vue-hot-reload-api") - hotAPI.install(require("vue"), false) - if (!hotAPI.compatible) return - module.hot.accept() - if (!module.hot.data) { - hotAPI.createRecord("data-v-b32879b8", Component.options) - } else { - hotAPI.reload("data-v-b32879b8", Component.options) - } - module.hot.dispose(function (data) { - disposed = true - }) -})()} - -module.exports = Component.exports - - -/***/ }), -/* 29 */ -/***/ (function(module, exports, __webpack_require__) { - -// style-loader: Adds some css to the DOM by adding a diff --git a/resources/js/components/PaginationLinks.vue b/resources/js/components/PaginationLinks.vue index cf72cd6..91176bd 100644 --- a/resources/js/components/PaginationLinks.vue +++ b/resources/js/components/PaginationLinks.vue @@ -1,57 +1,62 @@ diff --git a/resources/js/components/BalanceCard.vue b/resources/js/components/cards/BalanceCard.vue similarity index 54% rename from resources/js/components/BalanceCard.vue rename to resources/js/components/cards/BalanceCard.vue index bccc4eb..19b567f 100644 --- a/resources/js/components/BalanceCard.vue +++ b/resources/js/components/cards/BalanceCard.vue @@ -1,41 +1,47 @@ diff --git a/resources/js/components/cards/ChargeDetailCard.vue b/resources/js/components/cards/ChargeDetailCard.vue new file mode 100644 index 0000000..cf01bd8 --- /dev/null +++ b/resources/js/components/cards/ChargeDetailCard.vue @@ -0,0 +1,111 @@ + + + diff --git a/resources/js/components/cards/CustomerDetailCard.vue b/resources/js/components/cards/CustomerDetailCard.vue new file mode 100644 index 0000000..042e11d --- /dev/null +++ b/resources/js/components/cards/CustomerDetailCard.vue @@ -0,0 +1,131 @@ + + + diff --git a/resources/js/components/layouts/NovaStripeLayout.vue b/resources/js/components/layouts/NovaStripeLayout.vue new file mode 100644 index 0000000..ee2b466 --- /dev/null +++ b/resources/js/components/layouts/NovaStripeLayout.vue @@ -0,0 +1,24 @@ + + + diff --git a/resources/js/components/tables/ChargesTable.vue b/resources/js/components/tables/ChargesTable.vue new file mode 100644 index 0000000..751e414 --- /dev/null +++ b/resources/js/components/tables/ChargesTable.vue @@ -0,0 +1,148 @@ + + + diff --git a/resources/js/components/tables/CustomersTable.vue b/resources/js/components/tables/CustomersTable.vue new file mode 100644 index 0000000..dced761 --- /dev/null +++ b/resources/js/components/tables/CustomersTable.vue @@ -0,0 +1,95 @@ + + + diff --git a/resources/js/components/tables/_shared/BaseTable.vue b/resources/js/components/tables/_shared/BaseTable.vue new file mode 100644 index 0000000..6f1f00b --- /dev/null +++ b/resources/js/components/tables/_shared/BaseTable.vue @@ -0,0 +1,71 @@ + + + diff --git a/resources/js/components/tables/_shared/BodyCell.vue b/resources/js/components/tables/_shared/BodyCell.vue new file mode 100644 index 0000000..5f81a1a --- /dev/null +++ b/resources/js/components/tables/_shared/BodyCell.vue @@ -0,0 +1,7 @@ + diff --git a/resources/js/components/tables/_shared/HeaderCell.vue b/resources/js/components/tables/_shared/HeaderCell.vue new file mode 100644 index 0000000..504a4f8 --- /dev/null +++ b/resources/js/components/tables/_shared/HeaderCell.vue @@ -0,0 +1,7 @@ + diff --git a/resources/js/pages/CustomerDetail.vue b/resources/js/pages/CustomerDetail.vue new file mode 100644 index 0000000..fd42653 --- /dev/null +++ b/resources/js/pages/CustomerDetail.vue @@ -0,0 +1,19 @@ + + + diff --git a/resources/js/pages/Customers.vue b/resources/js/pages/Customers.vue new file mode 100644 index 0000000..a1782c3 --- /dev/null +++ b/resources/js/pages/Customers.vue @@ -0,0 +1,5 @@ + diff --git a/resources/js/pages/Detail.vue b/resources/js/pages/Detail.vue new file mode 100644 index 0000000..8d15cb4 --- /dev/null +++ b/resources/js/pages/Detail.vue @@ -0,0 +1,60 @@ + + + diff --git a/resources/js/pages/Tool.vue b/resources/js/pages/Tool.vue new file mode 100644 index 0000000..ad8524a --- /dev/null +++ b/resources/js/pages/Tool.vue @@ -0,0 +1,32 @@ + + + diff --git a/resources/js/tool.js b/resources/js/tool.js index 75b863b..4308be3 100644 --- a/resources/js/tool.js +++ b/resources/js/tool.js @@ -1,29 +1,27 @@ -Nova.booting((Vue, router) => { - Vue.config.devtools = true; +import moneyFormat from './utils/moneyFormat.js' - router.addRoutes([ - { - name: "nova-stripe", - path: "/nova-stripe", - component: require("./views/Index"), - }, - { - name: "charge-detail", - path: "/nova-stripe/charge/:chargeId", - component: require("./views/Detail"), - props: true, - }, - { - name: "customer-list", - path: "/nova-stripe/customers", - component: require("./views/Customers"), - props: true, +Nova.booting((Vue) => { + const files = require.context('./', true, /\.vue$/i) + files + .keys() + .map((key) => + Vue.component( + key.split('/').pop().split('.')[0], + files(key).default + ) + ) + + Vue.config.globalProperties.$filters = { + money(currency, value) { + return moneyFormat(currency, value) }, - { - name: "customer-detail", - path: "/nova-stripe/customers/:customerId", - component: require("./views/CustomerDetail"), - props: true, + date(value) { + return new Date(value * 1000).toLocaleString() }, - ]); -}); + } + + Nova.inertia('Tool', require('./pages/Tool').default) + Nova.inertia('Detail', require('./pages/Detail').default) + Nova.inertia('Customers', require('./pages/Customers').default) + Nova.inertia('CustomerDetail', require('./pages/CustomerDetail').default) +}) diff --git a/resources/js/utils/moneyFormat.js b/resources/js/utils/moneyFormat.js index 54c03c6..0447c1e 100644 --- a/resources/js/utils/moneyFormat.js +++ b/resources/js/utils/moneyFormat.js @@ -2,1272 +2,1278 @@ import currency from 'currency.js' export default (currency_code, amount) => { currency_code = currency_code.toUpperCase() - let decimal_digits = currencies[currency_code] ? currencies[currency_code].decimal_digits : 2 + let decimal_digits = currencies[currency_code] + ? currencies[currency_code].decimal_digits + : 2 let currency_divisor = '1'.padEnd(decimal_digits + 1, '0') let currency_options = { - precision: decimal_digits + precision: decimal_digits, } - if (! currencies[currency_code]) { - return currency(amount / currency_divisor, currency_options).format() + ' ' + currency_code + if (!currencies[currency_code]) { + return ( + currency(amount / currency_divisor, currency_options).format() + + ' ' + + currency_code + ) } return currency(amount / currency_divisor, { ...currency_options, - symbol: currencies[currency_code].symbol_native + symbol: currencies[currency_code].symbol_native, }).format(true) } const currencies = { - "USD" : { - "symbol" : "$", - "name" : "US Dollar", - "symbol_native" : "$", - "decimal_digits" : 2, - "rounding" : 0, - "code" : "USD", - "name_plural" : "US dollars" - }, - "CAD" : { - "symbol" : "CA$", - "name" : "Canadian Dollar", - "symbol_native" : "$", - "decimal_digits" : 2, - "rounding" : 0, - "code" : "CAD", - "name_plural" : "Canadian dollars" - }, - "EUR" : { - "symbol" : "€", - "name" : "Euro", - "symbol_native" : "€", - "decimal_digits" : 2, - "rounding" : 0, - "code" : "EUR", - "name_plural" : "euros" - }, - "AED" : { - "symbol" : "AED", - "name" : "United Arab Emirates Dirham", - "symbol_native" : "د.إ.‏", - "decimal_digits" : 2, - "rounding" : 0, - "code" : "AED", - "name_plural" : "UAE dirhams" - }, - "AFN" : { - "symbol" : "Af", - "name" : "Afghan Afghani", - "symbol_native" : "؋", - "decimal_digits" : 0, - "rounding" : 0, - "code" : "AFN", - "name_plural" : "Afghan Afghanis" - }, - "ALL" : { - "symbol" : "ALL", - "name" : "Albanian Lek", - "symbol_native" : "Lek", - "decimal_digits" : 0, - "rounding" : 0, - "code" : "ALL", - "name_plural" : "Albanian lekë" - }, - "AMD" : { - "symbol" : "AMD", - "name" : "Armenian Dram", - "symbol_native" : "դր.", - "decimal_digits" : 0, - "rounding" : 0, - "code" : "AMD", - "name_plural" : "Armenian drams" - }, - "ANG" : { - "symbol" : "ƒ", - "name" : "Netherlands Antillean guilder", - "symbol_native" : "ƒ", - "decimal_digits" : 0, - "rounding" : 0, - "code" : "ANG", - "name_plural" : "Netherlands Antillean guilder" - }, - "AOA" : { - "symbol" : "Kz", - "name" : "Angolan Kwanza", - "symbol_native" : "Kz", - "decimal_digits" : 0, - "rounding" : 0, - "code" : "AOA", - "name_plural" : "Angolan Kwanzas" - }, - "ARS" : { - "symbol" : "AR$", - "name" : "Argentine Peso", - "symbol_native" : "$", - "decimal_digits" : 2, - "rounding" : 0, - "code" : "ARS", - "name_plural" : "Argentine pesos" - }, - "AUD" : { - "symbol" : "AU$", - "name" : "Australian Dollar", - "symbol_native" : "$", - "decimal_digits" : 2, - "rounding" : 0, - "code" : "AUD", - "name_plural" : "Australian dollars" - }, - "AZN" : { - "symbol" : "man.", - "name" : "Azerbaijani Manat", - "symbol_native" : "ман.", - "decimal_digits" : 2, - "rounding" : 0, - "code" : "AZN", - "name_plural" : "Azerbaijani manats" - }, - "BAM" : { - "symbol" : "KM", - "name" : "Bosnia-Herzegovina Convertible Mark", - "symbol_native" : "KM", - "decimal_digits" : 2, - "rounding" : 0, - "code" : "BAM", - "name_plural" : "Bosnia-Herzegovina convertible marks" - }, - "BDT" : { - "symbol" : "Tk", - "name" : "Bangladeshi Taka", - "symbol_native" : "৳", - "decimal_digits" : 2, - "rounding" : 0, - "code" : "BDT", - "name_plural" : "Bangladeshi takas" - }, - "BGN" : { - "symbol" : "BGN", - "name" : "Bulgarian Lev", - "symbol_native" : "лв.", - "decimal_digits" : 2, - "rounding" : 0, - "code" : "BGN", - "name_plural" : "Bulgarian leva" - }, - "BHD" : { - "symbol" : "BD", - "name" : "Bahraini Dinar", - "symbol_native" : "د.ب.‏", - "decimal_digits" : 3, - "rounding" : 0, - "code" : "BHD", - "name_plural" : "Bahraini dinars" - }, - "BIF" : { - "symbol" : "FBu", - "name" : "Burundian Franc", - "symbol_native" : "FBu", - "decimal_digits" : 0, - "rounding" : 0, - "code" : "BIF", - "name_plural" : "Burundian francs" - }, - "BND" : { - "symbol" : "BN$", - "name" : "Brunei Dollar", - "symbol_native" : "$", - "decimal_digits" : 2, - "rounding" : 0, - "code" : "BND", - "name_plural" : "Brunei dollars" - }, - "BMD" : { - "symbol" : "$", - "name" : "Bermudian Dollar", - "symbol_native" : "$", - "decimal_digits" : 2, - "rounding" : 0, - "code" : "BMD", - "name_plural" : "Bermudian Dollar" - }, - "BOB" : { - "symbol" : "Bs", - "name" : "Bolivian Boliviano", - "symbol_native" : "Bs", - "decimal_digits" : 2, - "rounding" : 0, - "code" : "BOB", - "name_plural" : "Bolivian bolivianos" - }, - "BRL" : { - "symbol" : "R$", - "name" : "Brazilian Real", - "symbol_native" : "R$", - "decimal_digits" : 2, - "rounding" : 0, - "code" : "BRL", - "name_plural" : "Brazilian reals" - }, - "BTN" : { - "symbol" : "Nu.", - "name" : "Bhutanese Ngultrum", - "symbol_native" : "Nu.", - "decimal_digits" : 2, - "rounding" : 0, - "code" : "BTN", - "name_plural" : "Bhutanese Ngultrum" - }, - "BWP" : { - "symbol" : "BWP", - "name" : "Botswanan Pula", - "symbol_native" : "P", - "decimal_digits" : 2, - "rounding" : 0, - "code" : "BWP", - "name_plural" : "Botswanan pulas" - }, - "BYR" : { - "symbol" : "BYR", - "name" : "Belarusian Ruble", - "symbol_native" : "BYR", - "decimal_digits" : 0, - "rounding" : 0, - "code" : "BYR", - "name_plural" : "Belarusian rubles" - }, - "BZD" : { - "symbol" : "BZ$", - "name" : "Belize Dollar", - "symbol_native" : "$", - "decimal_digits" : 2, - "rounding" : 0, - "code" : "BZD", - "name_plural" : "Belize dollars" - }, - "CDF" : { - "symbol" : "CDF", - "name" : "Congolese Franc", - "symbol_native" : "FrCD", - "decimal_digits" : 2, - "rounding" : 0, - "code" : "CDF", - "name_plural" : "Congolese francs" - }, - "CHF" : { - "symbol" : "CHF", - "name" : "Swiss Franc", - "symbol_native" : "CHF", - "decimal_digits" : 2, - "rounding" : 0.05, - "code" : "CHF", - "name_plural" : "Swiss francs" - }, - "CLP" : { - "symbol" : "CL$", - "name" : "Chilean Peso", - "symbol_native" : "$", - "decimal_digits" : 0, - "rounding" : 0, - "code" : "CLP", - "name_plural" : "Chilean pesos" - }, - "CNY" : { - "symbol" : "CN¥", - "name" : "Chinese Yuan", - "symbol_native" : "CN¥", - "decimal_digits" : 2, - "rounding" : 0, - "code" : "CNY", - "name_plural" : "Chinese yuan" - }, - "COP" : { - "symbol" : "CO$", - "name" : "Colombian Peso", - "symbol_native" : "$", - "decimal_digits" : 0, - "rounding" : 0, - "code" : "COP", - "name_plural" : "Colombian pesos" - }, - "CRC" : { - "symbol" : "₡", - "name" : "Costa Rican Colón", - "symbol_native" : "₡", - "decimal_digits" : 0, - "rounding" : 0, - "code" : "CRC", - "name_plural" : "Costa Rican colóns" - }, - "CVE" : { - "symbol" : "CV$", - "name" : "Cape Verdean Escudo", - "symbol_native" : "CV$", - "decimal_digits" : 2, - "rounding" : 0, - "code" : "CVE", - "name_plural" : "Cape Verdean escudos" - }, - "CZK" : { - "symbol" : "Kč", - "name" : "Czech Republic Koruna", - "symbol_native" : "Kč", - "decimal_digits" : 2, - "rounding" : 0, - "code" : "CZK", - "name_plural" : "Czech Republic korunas" - }, - "DJF" : { - "symbol" : "Fdj", - "name" : "Djiboutian Franc", - "symbol_native" : "Fdj", - "decimal_digits" : 0, - "rounding" : 0, - "code" : "DJF", - "name_plural" : "Djiboutian francs" - }, - "DKK" : { - "symbol" : "Dkr", - "name" : "Danish Krone", - "symbol_native" : "kr", - "decimal_digits" : 2, - "rounding" : 0, - "code" : "DKK", - "name_plural" : "Danish kroner" - }, - "DOP" : { - "symbol" : "RD$", - "name" : "Dominican Peso", - "symbol_native" : "RD$", - "decimal_digits" : 2, - "rounding" : 0, - "code" : "DOP", - "name_plural" : "Dominican pesos" - }, - "DZD" : { - "symbol" : "DA", - "name" : "Algerian Dinar", - "symbol_native" : "د.ج.‏", - "decimal_digits" : 2, - "rounding" : 0, - "code" : "DZD", - "name_plural" : "Algerian dinars" - }, - "EEK" : { - "symbol" : "Ekr", - "name" : "Estonian Kroon", - "symbol_native" : "kr", - "decimal_digits" : 2, - "rounding" : 0, - "code" : "EEK", - "name_plural" : "Estonian kroons" - }, - "EGP" : { - "symbol" : "EGP", - "name" : "Egyptian Pound", - "symbol_native" : "ج.م.‏", - "decimal_digits" : 2, - "rounding" : 0, - "code" : "EGP", - "name_plural" : "Egyptian pounds" - }, - "ERN" : { - "symbol" : "Nfk", - "name" : "Eritrean Nakfa", - "symbol_native" : "Nfk", - "decimal_digits" : 2, - "rounding" : 0, - "code" : "ERN", - "name_plural" : "Eritrean nakfas" - }, - "ETB" : { - "symbol" : "Br", - "name" : "Ethiopian Birr", - "symbol_native" : "Br", - "decimal_digits" : 2, - "rounding" : 0, - "code" : "ETB", - "name_plural" : "Ethiopian birrs" - }, - "FKP" : { - "symbol" : "£", - "name" : "Falkland Island Pound", - "symbol_native" : "£", - "decimal_digits" : 2, - "rounding" : 0, - "code" : "FKP", - "name_plural" : "Falkland Island Pounds" - }, - "GBP" : { - "symbol" : "£", - "name" : "British Pound Sterling", - "symbol_native" : "£", - "decimal_digits" : 2, - "rounding" : 0, - "code" : "GBP", - "name_plural" : "British pounds sterling" - }, - "GEL" : { - "symbol" : "GEL", - "name" : "Georgian Lari", - "symbol_native" : "GEL", - "decimal_digits" : 2, - "rounding" : 0, - "code" : "GEL", - "name_plural" : "Georgian laris" - }, - "GHS" : { - "symbol" : "GH₵", - "name" : "Ghanaian Cedi", - "symbol_native" : "GH₵", - "decimal_digits" : 2, - "rounding" : 0, - "code" : "GHS", - "name_plural" : "Ghanaian cedis" - }, - "GIP" : { - "symbol" : "£", - "name" : "Gibraltar Pound", - "symbol_native" : "£", - "decimal_digits" : 2, - "rounding" : 0, - "code" : "GHS", - "name_plural" : "Gibraltar pound" - }, - "GNF" : { - "symbol" : "FG", - "name" : "Guinean Franc", - "symbol_native" : "FG", - "decimal_digits" : 0, - "rounding" : 0, - "code" : "GNF", - "name_plural" : "Guinean francs" - }, - "GTQ" : { - "symbol" : "GTQ", - "name" : "Guatemalan Quetzal", - "symbol_native" : "Q", - "decimal_digits" : 2, - "rounding" : 0, - "code" : "GTQ", - "name_plural" : "Guatemalan quetzals" - }, - "HKD" : { - "symbol" : "HK$", - "name" : "Hong Kong Dollar", - "symbol_native" : "$", - "decimal_digits" : 2, - "rounding" : 0, - "code" : "HKD", - "name_plural" : "Hong Kong dollars" - }, - "HNL" : { - "symbol" : "HNL", - "name" : "Honduran Lempira", - "symbol_native" : "L", - "decimal_digits" : 2, - "rounding" : 0, - "code" : "HNL", - "name_plural" : "Honduran lempiras" - }, - "HRK" : { - "symbol" : "kn", - "name" : "Croatian Kuna", - "symbol_native" : "kn", - "decimal_digits" : 2, - "rounding" : 0, - "code" : "HRK", - "name_plural" : "Croatian kunas" - }, - "HUF" : { - "symbol" : "Ft", - "name" : "Hungarian Forint", - "symbol_native" : "Ft", - "decimal_digits" : 0, - "rounding" : 0, - "code" : "HUF", - "name_plural" : "Hungarian forints" - }, - "IDR" : { - "symbol" : "Rp", - "name" : "Indonesian Rupiah", - "symbol_native" : "Rp", - "decimal_digits" : 0, - "rounding" : 0, - "code" : "IDR", - "name_plural" : "Indonesian rupiahs" - }, - "ILS" : { - "symbol" : "₪", - "name" : "Israeli New Sheqel", - "symbol_native" : "₪", - "decimal_digits" : 2, - "rounding" : 0, - "code" : "ILS", - "name_plural" : "Israeli new sheqels" - }, - "INR" : { - "symbol" : "Rs", - "name" : "Indian Rupee", - "symbol_native" : "টকা", - "decimal_digits" : 2, - "rounding" : 0, - "code" : "INR", - "name_plural" : "Indian rupees" - }, - "IQD" : { - "symbol" : "IQD", - "name" : "Iraqi Dinar", - "symbol_native" : "د.ع.‏", - "decimal_digits" : 0, - "rounding" : 0, - "code" : "IQD", - "name_plural" : "Iraqi dinars" - }, - "IRR" : { - "symbol" : "IRR", - "name" : "Iranian Rial", - "symbol_native" : "﷼", - "decimal_digits" : 0, - "rounding" : 0, - "code" : "IRR", - "name_plural" : "Iranian rials" - }, - "ISK" : { - "symbol" : "Ikr", - "name" : "Icelandic Króna", - "symbol_native" : "kr", - "decimal_digits" : 0, - "rounding" : 0, - "code" : "ISK", - "name_plural" : "Icelandic krónur" - }, - "JMD" : { - "symbol" : "J$", - "name" : "Jamaican Dollar", - "symbol_native" : "$", - "decimal_digits" : 2, - "rounding" : 0, - "code" : "JMD", - "name_plural" : "Jamaican dollars" - }, - "JOD" : { - "symbol" : "JD", - "name" : "Jordanian Dinar", - "symbol_native" : "د.أ.‏", - "decimal_digits" : 3, - "rounding" : 0, - "code" : "JOD", - "name_plural" : "Jordanian dinars" - }, - "JPY" : { - "symbol" : "¥", - "name" : "Japanese Yen", - "symbol_native" : "¥", - "decimal_digits" : 0, - "rounding" : 0, - "code" : "JPY", - "name_plural" : "Japanese yen" - }, - "KES" : { - "symbol" : "с", - "name" : "Kyrgyzstani som", - "symbol_native" : "с", - "decimal_digits" : 2, - "rounding" : 0, - "code" : "KES", - "name_plural" : "Kyrgyzstani som" - }, - "KGS" : { - "symbol" : "Ksh", - "name" : "Kyrgyzstani Som", - "symbol_native" : "Ksh", - "decimal_digits" : 2, - "rounding" : 0, - "code" : "KES", - "name_plural" : "Kenyan shillings" - }, - "KHR" : { - "symbol" : "KHR", - "name" : "Cambodian Riel", - "symbol_native" : "៛", - "decimal_digits" : 2, - "rounding" : 0, - "code" : "KHR", - "name_plural" : "Cambodian riels" - }, - "KMF" : { - "symbol" : "CF", - "name" : "Comorian Franc", - "symbol_native" : "FC", - "decimal_digits" : 0, - "rounding" : 0, - "code" : "KMF", - "name_plural" : "Comorian francs" - }, - "KRW" : { - "symbol" : "₩", - "name" : "South Korean Won", - "symbol_native" : "₩", - "decimal_digits" : 0, - "rounding" : 0, - "code" : "KRW", - "name_plural" : "South Korean won" - }, - "KWD" : { - "symbol" : "KD", - "name" : "Kuwaiti Dinar", - "symbol_native" : "د.ك.‏", - "decimal_digits" : 3, - "rounding" : 0, - "code" : "KWD", - "name_plural" : "Kuwaiti dinars" - }, - "KYD" : { - "symbol" : "$", - "name" : "Cayman Islands dollar", - "symbol_native" : "$‏", - "decimal_digits" : 2, - "rounding" : 0, - "code" : "KYD", - "name_plural" : "Cayman Islands dollarS" - }, - "KZT" : { - "symbol" : "KZT", - "name" : "Kazakhstani Tenge", - "symbol_native" : "тңг.", - "decimal_digits" : 2, - "rounding" : 0, - "code" : "KZT", - "name_plural" : "Kazakhstani tenges" - }, - "LAK" : { - "symbol" : "₭", - "name" : "Lao kip", - "symbol_native" : "₭‏", - "decimal_digits" : 0, - "rounding" : 0, - "code" : "LAK", - "name_plural" : "Lao kip" - }, - "LBP" : { - "symbol" : "LB£", - "name" : "Lebanese Pound", - "symbol_native" : "ل.ل.‏", - "decimal_digits" : 0, - "rounding" : 0, - "code" : "LBP", - "name_plural" : "Lebanese pounds" - }, - "LKR" : { - "symbol" : "SLRs", - "name" : "Sri Lankan Rupee", - "symbol_native" : "SL Re", - "decimal_digits" : 2, - "rounding" : 0, - "code" : "LKR", - "name_plural" : "Sri Lankan rupees" - }, - "LRD" : { - "symbol" : "$", - "name" : "Liberian Dollar", - "symbol_native" : "$", - "decimal_digits" : 2, - "rounding" : 0, - "code" : "LRD", - "name_plural" : "Liberian Dollars" - }, - "LTL" : { - "symbol" : "Lt", - "name" : "Lithuanian Litas", - "symbol_native" : "Lt", - "decimal_digits" : 2, - "rounding" : 0, - "code" : "LTL", - "name_plural" : "Lithuanian litai" - }, - "LVL" : { - "symbol" : "Ls", - "name" : "Latvian Lats", - "symbol_native" : "Ls", - "decimal_digits" : 2, - "rounding" : 0, - "code" : "LVL", - "name_plural" : "Latvian lati" - }, - "LYD" : { - "symbol" : "LD", - "name" : "Libyan Dinar", - "symbol_native" : "د.ل.‏", - "decimal_digits" : 3, - "rounding" : 0, - "code" : "LYD", - "name_plural" : "Libyan dinars" - }, - "MAD" : { - "symbol" : "MAD", - "name" : "Moroccan Dirham", - "symbol_native" : "د.م.‏", - "decimal_digits" : 2, - "rounding" : 0, - "code" : "MAD", - "name_plural" : "Moroccan dirhams" - }, - "MDL" : { - "symbol" : "MDL", - "name" : "Moldovan Leu", - "symbol_native" : "MDL", - "decimal_digits" : 2, - "rounding" : 0, - "code" : "MDL", - "name_plural" : "Moldovan lei" - }, - "MGA" : { - "symbol" : "MGA", - "name" : "Malagasy Ariary", - "symbol_native" : "MGA", - "decimal_digits" : 0, - "rounding" : 0, - "code" : "MGA", - "name_plural" : "Malagasy Ariaries" - }, - "MKD" : { - "symbol" : "MKD", - "name" : "Macedonian Denar", - "symbol_native" : "MKD", - "decimal_digits" : 2, - "rounding" : 0, - "code" : "MKD", - "name_plural" : "Macedonian denari" - }, - "MMK" : { - "symbol" : "MMK", - "name" : "Myanma Kyat", - "symbol_native" : "K", - "decimal_digits" : 0, - "rounding" : 0, - "code" : "MMK", - "name_plural" : "Myanma kyats" - }, - "MOP" : { - "symbol" : "MOP$", - "name" : "Macanese Pataca", - "symbol_native" : "MOP$", - "decimal_digits" : 2, - "rounding" : 0, - "code" : "MOP", - "name_plural" : "Macanese patacas" - }, - "MUR" : { - "symbol" : "MURs", - "name" : "Mauritian Rupee", - "symbol_native" : "MURs", - "decimal_digits" : 0, - "rounding" : 0, - "code" : "MUR", - "name_plural" : "Mauritian rupees" - }, - "MWK" : { - "symbol" : "MK", - "name" : "Malawian Kwacha", - "symbol_native" : "MK", - "decimal_digits" : 2, - "rounding" : 0, - "code" : "MWK", - "name_plural" : "Malawian Kwacha" - }, - "MXN" : { - "symbol" : "MX$", - "name" : "Mexican Peso", - "symbol_native" : "$", - "decimal_digits" : 2, - "rounding" : 0, - "code" : "MXN", - "name_plural" : "Mexican pesos" - }, - "MYR" : { - "symbol" : "RM", - "name" : "Malaysian Ringgit", - "symbol_native" : "RM", - "decimal_digits" : 2, - "rounding" : 0, - "code" : "MYR", - "name_plural" : "Malaysian ringgits" - }, - "MZN" : { - "symbol" : "MTn", - "name" : "Mozambican Metical", - "symbol_native" : "MTn", - "decimal_digits" : 2, - "rounding" : 0, - "code" : "MZN", - "name_plural" : "Mozambican meticals" - }, - "NAD" : { - "symbol" : "N$", - "name" : "Namibian Dollar", - "symbol_native" : "N$", - "decimal_digits" : 2, - "rounding" : 0, - "code" : "NAD", - "name_plural" : "Namibian dollars" - }, - "NGN" : { - "symbol" : "₦", - "name" : "Nigerian Naira", - "symbol_native" : "₦", - "decimal_digits" : 2, - "rounding" : 0, - "code" : "NGN", - "name_plural" : "Nigerian nairas" - }, - "NIO" : { - "symbol" : "C$", - "name" : "Nicaraguan Córdoba", - "symbol_native" : "C$", - "decimal_digits" : 2, - "rounding" : 0, - "code" : "NIO", - "name_plural" : "Nicaraguan córdobas" - }, - "NOK" : { - "symbol" : "Nkr", - "name" : "Norwegian Krone", - "symbol_native" : "kr", - "decimal_digits" : 2, - "rounding" : 0, - "code" : "NOK", - "name_plural" : "Norwegian kroner" - }, - "NPR" : { - "symbol" : "NPRs", - "name" : "Nepalese Rupee", - "symbol_native" : "नेरू", - "decimal_digits" : 2, - "rounding" : 0, - "code" : "NPR", - "name_plural" : "Nepalese rupees" - }, - "NZD" : { - "symbol" : "NZ$", - "name" : "New Zealand Dollar", - "symbol_native" : "$", - "decimal_digits" : 2, - "rounding" : 0, - "code" : "NZD", - "name_plural" : "New Zealand dollars" - }, - "OMR" : { - "symbol" : "OMR", - "name" : "Omani Rial", - "symbol_native" : "ر.ع.‏", - "decimal_digits" : 3, - "rounding" : 0, - "code" : "OMR", - "name_plural" : "Omani rials" - }, - "PAB" : { - "symbol" : "B/.", - "name" : "Panamanian Balboa", - "symbol_native" : "B/.", - "decimal_digits" : 2, - "rounding" : 0, - "code" : "PAB", - "name_plural" : "Panamanian balboas" - }, - "PEN" : { - "symbol" : "S/.", - "name" : "Peruvian Nuevo Sol", - "symbol_native" : "S/.", - "decimal_digits" : 2, - "rounding" : 0, - "code" : "PEN", - "name_plural" : "Peruvian nuevos soles" - }, - "PHP" : { - "symbol" : "₱", - "name" : "Philippine Peso", - "symbol_native" : "₱", - "decimal_digits" : 2, - "rounding" : 0, - "code" : "PHP", - "name_plural" : "Philippine pesos" - }, - "PKR" : { - "symbol" : "PKRs", - "name" : "Pakistani Rupee", - "symbol_native" : "₨", - "decimal_digits" : 0, - "rounding" : 0, - "code" : "PKR", - "name_plural" : "Pakistani rupees" - }, - "PLN" : { - "symbol" : "zł", - "name" : "Polish Zloty", - "symbol_native" : "zł", - "decimal_digits" : 2, - "rounding" : 0, - "code" : "PLN", - "name_plural" : "Polish zlotys" - }, - "PYG" : { - "symbol" : "₲", - "name" : "Paraguayan Guarani", - "symbol_native" : "₲", - "decimal_digits" : 0, - "rounding" : 0, - "code" : "PYG", - "name_plural" : "Paraguayan guaranis" - }, - "QAR" : { - "symbol" : "QR", - "name" : "Qatari Rial", - "symbol_native" : "ر.ق.‏", - "decimal_digits" : 2, - "rounding" : 0, - "code" : "QAR", - "name_plural" : "Qatari rials" - }, - "RON" : { - "symbol" : "RON", - "name" : "Romanian Leu", - "symbol_native" : "RON", - "decimal_digits" : 2, - "rounding" : 0, - "code" : "RON", - "name_plural" : "Romanian lei" - }, - "RSD" : { - "symbol" : "din.", - "name" : "Serbian Dinar", - "symbol_native" : "дин.", - "decimal_digits" : 0, - "rounding" : 0, - "code" : "RSD", - "name_plural" : "Serbian dinars" - }, - "RUB" : { - "symbol" : "RUB", - "name" : "Russian Ruble", - "symbol_native" : "руб.", - "decimal_digits" : 2, - "rounding" : 0, - "code" : "RUB", - "name_plural" : "Russian rubles" - }, - "RWF" : { - "symbol" : "RWF", - "name" : "Rwandan Franc", - "symbol_native" : "FR", - "decimal_digits" : 0, - "rounding" : 0, - "code" : "RWF", - "name_plural" : "Rwandan francs" - }, - "SAR" : { - "symbol" : "SR", - "name" : "Saudi Riyal", - "symbol_native" : "ر.س.‏", - "decimal_digits" : 2, - "rounding" : 0, - "code" : "SAR", - "name_plural" : "Saudi riyals" - }, - "SBD" : { - "symbol" : "$", - "name" : "Solomon Islander Dollar", - "symbol_native" : "$", - "decimal_digits" : 2, - "rounding" : 0, - "code" : "SBD", - "name_plural" : "Solomon Islander Dollars" - }, - "SDG" : { - "symbol" : "SDG", - "name" : "Sudanese Pound", - "symbol_native" : "SDG", - "decimal_digits" : 2, - "rounding" : 0, - "code" : "SDG", - "name_plural" : "Sudanese pounds" - }, - "SEK" : { - "symbol" : "Skr", - "name" : "Swedish Krona", - "symbol_native" : "kr", - "decimal_digits" : 2, - "rounding" : 0, - "code" : "SEK", - "name_plural" : "Swedish kronor" - }, - "SGD" : { - "symbol" : "S$", - "name" : "Singapore Dollar", - "symbol_native" : "$", - "decimal_digits" : 2, - "rounding" : 0, - "code" : "SGD", - "name_plural" : "Singapore dollars" - }, - "SLL" : { - "symbol" : "Le", - "name" : "Sierra Leonean Leone", - "symbol_native" : "Le", - "decimal_digits" : 2, - "rounding" : 0, - "code" : "SLL", - "name_plural" : "Sierra Leonean Leone" - }, - "SOS" : { - "symbol" : "Ssh", - "name" : "Somali Shilling", - "symbol_native" : "Ssh", - "decimal_digits" : 0, - "rounding" : 0, - "code" : "SOS", - "name_plural" : "Somali shillings" - }, - "SSP" : { - "symbol" : "£", - "name" : "South Sudanese pound", - "symbol_native" : "£", - "decimal_digits" : 2, - "rounding" : 0, - "code" : "SSP", - "name_plural" : "South Sudanese pound" - }, - "STD" : { - "symbol" : "Db", - "name" : "Sao Tomean Dobra", - "symbol_native" : "Db", - "decimal_digits" : 0, - "rounding" : 0, - "code" : "STD", - "name_plural" : "Sao Tomean Dobra" - }, - "STN" : { - "symbol" : "Db", - "name" : "Sao Tomean Dobra", - "symbol_native" : "Db", - "decimal_digits" : 0, - "rounding" : 0, - "code" : "STN", - "name_plural" : "Sao Tomean Dobra" - }, - "SYP" : { - "symbol" : "SY£", - "name" : "Syrian Pound", - "symbol_native" : "ل.س.‏", - "decimal_digits" : 0, - "rounding" : 0, - "code" : "SYP", - "name_plural" : "Syrian pounds" - }, - "SZL" : { - "symbol" : "L", - "name" : "Swazi Lilangeni", - "symbol_native" : "L‏", - "decimal_digits" : 0, - "rounding" : 0, - "code" : "SZL", - "name_plural" : "Swazi Lilangeni" - }, - "THB" : { - "symbol" : "฿", - "name" : "Thai Baht", - "symbol_native" : "฿", - "decimal_digits" : 2, - "rounding" : 0, - "code" : "THB", - "name_plural" : "Thai baht" - }, - "TJS" : { - "symbol" : "ЅМ", - "name" : "Tajikistani Somoni", - "symbol_native" : "ЅМ", - "decimal_digits" : 2, - "rounding" : 0, - "code" : "THB", - "name_plural" : "Tajikistani Somoni" - }, - "TND" : { - "symbol" : "DT", - "name" : "Tunisian Dinar", - "symbol_native" : "د.ت.‏", - "decimal_digits" : 3, - "rounding" : 0, - "code" : "TND", - "name_plural" : "Tunisian dinars" - }, - "TOP" : { - "symbol" : "T$", - "name" : "Tongan Paʻanga", - "symbol_native" : "T$", - "decimal_digits" : 2, - "rounding" : 0, - "code" : "TOP", - "name_plural" : "Tongan paʻanga" - }, - "TRY" : { - "symbol" : "TL", - "name" : "Turkish Lira", - "symbol_native" : "TL", - "decimal_digits" : 2, - "rounding" : 0, - "code" : "TRY", - "name_plural" : "Turkish Lira" - }, - "TTD" : { - "symbol" : "TT$", - "name" : "Trinidad and Tobago Dollar", - "symbol_native" : "$", - "decimal_digits" : 2, - "rounding" : 0, - "code" : "TTD", - "name_plural" : "Trinidad and Tobago dollars" - }, - "TWD" : { - "symbol" : "NT$", - "name" : "New Taiwan Dollar", - "symbol_native" : "NT$", - "decimal_digits" : 2, - "rounding" : 0, - "code" : "TWD", - "name_plural" : "New Taiwan dollars" - }, - "TZS" : { - "symbol" : "TSh", - "name" : "Tanzanian Shilling", - "symbol_native" : "TSh", - "decimal_digits" : 0, - "rounding" : 0, - "code" : "TZS", - "name_plural" : "Tanzanian shillings" - }, - "UAH" : { - "symbol" : "₴", - "name" : "Ukrainian Hryvnia", - "symbol_native" : "₴", - "decimal_digits" : 2, - "rounding" : 0, - "code" : "UAH", - "name_plural" : "Ukrainian hryvnias" - }, - "UGX" : { - "symbol" : "USh", - "name" : "Ugandan Shilling", - "symbol_native" : "USh", - "decimal_digits" : 0, - "rounding" : 0, - "code" : "UGX", - "name_plural" : "Ugandan shillings" - }, - "UYU" : { - "symbol" : "$U", - "name" : "Uruguayan Peso", - "symbol_native" : "$", - "decimal_digits" : 2, - "rounding" : 0, - "code" : "UYU", - "name_plural" : "Uruguayan pesos" - }, - "UZS" : { - "symbol" : "UZS", - "name" : "Uzbekistan Som", - "symbol_native" : "UZS", - "decimal_digits" : 0, - "rounding" : 0, - "code" : "UZS", - "name_plural" : "Uzbekistan som" - }, - "VEF" : { - "symbol" : "Bs.F.", - "name" : "Venezuelan Bolívar", - "symbol_native" : "Bs.F.", - "decimal_digits" : 2, - "rounding" : 0, - "code" : "VEF", - "name_plural" : "Venezuelan bolívars" - }, - "VND" : { - "symbol" : "₫", - "name" : "Vietnamese Dong", - "symbol_native" : "₫", - "decimal_digits" : 0, - "rounding" : 0, - "code" : "VND", - "name_plural" : "Vietnamese dong" - }, - "VUV" : { - "symbol" : "Vt", - "name" : "Ni-Vanuatu Vatu", - "symbol_native" : "Vt", - "decimal_digits" : 0, - "rounding" : 0, - "code" : "VUV", - "name_plural" : "Ni-Vanuatu Vatu" - }, - "XAF" : { - "symbol" : "FCFA", - "name" : "CFA Franc BEAC", - "symbol_native" : "FCFA", - "decimal_digits" : 0, - "rounding" : 0, - "code" : "XAF", - "name_plural" : "CFA francs BEAC" - }, - "XCD" : { - "symbol" : "$", - "name" : "East Caribbean Dollar", - "symbol_native" : "$", - "decimal_digits" : 0, - "rounding" : 0, - "code" : "XCD", - "name_plural" : "East Caribbean Dollars" - }, - "XOF" : { - "symbol" : "CFA", - "name" : "CFA Franc BCEAO", - "symbol_native" : "CFA", - "decimal_digits" : 0, - "rounding" : 0, - "code" : "XOF", - "name_plural" : "CFA francs BCEAO" - }, - "XPF" : { - "symbol" : "Fr", - "name" : "CFP franc", - "symbol_native" : "Fr", - "decimal_digits" : 0, - "rounding" : 0, - "code" : "XPF", - "name_plural" : "CFP franc" - }, - "YER" : { - "symbol" : "YR", - "name" : "Yemeni Rial", - "symbol_native" : "ر.ي.‏", - "decimal_digits" : 0, - "rounding" : 0, - "code" : "YER", - "name_plural" : "Yemeni rials" - }, - "ZAR" : { - "symbol" : "R", - "name" : "South African Rand", - "symbol_native" : "R", - "decimal_digits" : 2, - "rounding" : 0, - "code" : "ZAR", - "name_plural" : "South African rand" - }, - "ZMK" : { - "symbol" : "ZK", - "name" : "Zambian Kwacha", - "symbol_native" : "ZK", - "decimal_digits" : 0, - "rounding" : 0, - "code" : "ZMK", - "name_plural" : "Zambian kwachas" - } + USD: { + symbol: '$', + name: 'US Dollar', + symbol_native: '$', + decimal_digits: 2, + rounding: 0, + code: 'USD', + name_plural: 'US dollars', + }, + CAD: { + symbol: 'CA$', + name: 'Canadian Dollar', + symbol_native: '$', + decimal_digits: 2, + rounding: 0, + code: 'CAD', + name_plural: 'Canadian dollars', + }, + EUR: { + symbol: '€', + name: 'Euro', + symbol_native: '€', + decimal_digits: 2, + rounding: 0, + code: 'EUR', + name_plural: 'euros', + }, + AED: { + symbol: 'AED', + name: 'United Arab Emirates Dirham', + symbol_native: 'د.إ.‏', + decimal_digits: 2, + rounding: 0, + code: 'AED', + name_plural: 'UAE dirhams', + }, + AFN: { + symbol: 'Af', + name: 'Afghan Afghani', + symbol_native: '؋', + decimal_digits: 0, + rounding: 0, + code: 'AFN', + name_plural: 'Afghan Afghanis', + }, + ALL: { + symbol: 'ALL', + name: 'Albanian Lek', + symbol_native: 'Lek', + decimal_digits: 0, + rounding: 0, + code: 'ALL', + name_plural: 'Albanian lekë', + }, + AMD: { + symbol: 'AMD', + name: 'Armenian Dram', + symbol_native: 'դր.', + decimal_digits: 0, + rounding: 0, + code: 'AMD', + name_plural: 'Armenian drams', + }, + ANG: { + symbol: 'ƒ', + name: 'Netherlands Antillean guilder', + symbol_native: 'ƒ', + decimal_digits: 0, + rounding: 0, + code: 'ANG', + name_plural: 'Netherlands Antillean guilder', + }, + AOA: { + symbol: 'Kz', + name: 'Angolan Kwanza', + symbol_native: 'Kz', + decimal_digits: 0, + rounding: 0, + code: 'AOA', + name_plural: 'Angolan Kwanzas', + }, + ARS: { + symbol: 'AR$', + name: 'Argentine Peso', + symbol_native: '$', + decimal_digits: 2, + rounding: 0, + code: 'ARS', + name_plural: 'Argentine pesos', + }, + AUD: { + symbol: 'AU$', + name: 'Australian Dollar', + symbol_native: '$', + decimal_digits: 2, + rounding: 0, + code: 'AUD', + name_plural: 'Australian dollars', + }, + AZN: { + symbol: 'man.', + name: 'Azerbaijani Manat', + symbol_native: 'ман.', + decimal_digits: 2, + rounding: 0, + code: 'AZN', + name_plural: 'Azerbaijani manats', + }, + BAM: { + symbol: 'KM', + name: 'Bosnia-Herzegovina Convertible Mark', + symbol_native: 'KM', + decimal_digits: 2, + rounding: 0, + code: 'BAM', + name_plural: 'Bosnia-Herzegovina convertible marks', + }, + BDT: { + symbol: 'Tk', + name: 'Bangladeshi Taka', + symbol_native: '৳', + decimal_digits: 2, + rounding: 0, + code: 'BDT', + name_plural: 'Bangladeshi takas', + }, + BGN: { + symbol: 'BGN', + name: 'Bulgarian Lev', + symbol_native: 'лв.', + decimal_digits: 2, + rounding: 0, + code: 'BGN', + name_plural: 'Bulgarian leva', + }, + BHD: { + symbol: 'BD', + name: 'Bahraini Dinar', + symbol_native: 'د.ب.‏', + decimal_digits: 3, + rounding: 0, + code: 'BHD', + name_plural: 'Bahraini dinars', + }, + BIF: { + symbol: 'FBu', + name: 'Burundian Franc', + symbol_native: 'FBu', + decimal_digits: 0, + rounding: 0, + code: 'BIF', + name_plural: 'Burundian francs', + }, + BND: { + symbol: 'BN$', + name: 'Brunei Dollar', + symbol_native: '$', + decimal_digits: 2, + rounding: 0, + code: 'BND', + name_plural: 'Brunei dollars', + }, + BMD: { + symbol: '$', + name: 'Bermudian Dollar', + symbol_native: '$', + decimal_digits: 2, + rounding: 0, + code: 'BMD', + name_plural: 'Bermudian Dollar', + }, + BOB: { + symbol: 'Bs', + name: 'Bolivian Boliviano', + symbol_native: 'Bs', + decimal_digits: 2, + rounding: 0, + code: 'BOB', + name_plural: 'Bolivian bolivianos', + }, + BRL: { + symbol: 'R$', + name: 'Brazilian Real', + symbol_native: 'R$', + decimal_digits: 2, + rounding: 0, + code: 'BRL', + name_plural: 'Brazilian reals', + }, + BTN: { + symbol: 'Nu.', + name: 'Bhutanese Ngultrum', + symbol_native: 'Nu.', + decimal_digits: 2, + rounding: 0, + code: 'BTN', + name_plural: 'Bhutanese Ngultrum', + }, + BWP: { + symbol: 'BWP', + name: 'Botswanan Pula', + symbol_native: 'P', + decimal_digits: 2, + rounding: 0, + code: 'BWP', + name_plural: 'Botswanan pulas', + }, + BYR: { + symbol: 'BYR', + name: 'Belarusian Ruble', + symbol_native: 'BYR', + decimal_digits: 0, + rounding: 0, + code: 'BYR', + name_plural: 'Belarusian rubles', + }, + BZD: { + symbol: 'BZ$', + name: 'Belize Dollar', + symbol_native: '$', + decimal_digits: 2, + rounding: 0, + code: 'BZD', + name_plural: 'Belize dollars', + }, + CDF: { + symbol: 'CDF', + name: 'Congolese Franc', + symbol_native: 'FrCD', + decimal_digits: 2, + rounding: 0, + code: 'CDF', + name_plural: 'Congolese francs', + }, + CHF: { + symbol: 'CHF', + name: 'Swiss Franc', + symbol_native: 'CHF', + decimal_digits: 2, + rounding: 0.05, + code: 'CHF', + name_plural: 'Swiss francs', + }, + CLP: { + symbol: 'CL$', + name: 'Chilean Peso', + symbol_native: '$', + decimal_digits: 0, + rounding: 0, + code: 'CLP', + name_plural: 'Chilean pesos', + }, + CNY: { + symbol: 'CN¥', + name: 'Chinese Yuan', + symbol_native: 'CN¥', + decimal_digits: 2, + rounding: 0, + code: 'CNY', + name_plural: 'Chinese yuan', + }, + COP: { + symbol: 'CO$', + name: 'Colombian Peso', + symbol_native: '$', + decimal_digits: 0, + rounding: 0, + code: 'COP', + name_plural: 'Colombian pesos', + }, + CRC: { + symbol: '₡', + name: 'Costa Rican Colón', + symbol_native: '₡', + decimal_digits: 0, + rounding: 0, + code: 'CRC', + name_plural: 'Costa Rican colóns', + }, + CVE: { + symbol: 'CV$', + name: 'Cape Verdean Escudo', + symbol_native: 'CV$', + decimal_digits: 2, + rounding: 0, + code: 'CVE', + name_plural: 'Cape Verdean escudos', + }, + CZK: { + symbol: 'Kč', + name: 'Czech Republic Koruna', + symbol_native: 'Kč', + decimal_digits: 2, + rounding: 0, + code: 'CZK', + name_plural: 'Czech Republic korunas', + }, + DJF: { + symbol: 'Fdj', + name: 'Djiboutian Franc', + symbol_native: 'Fdj', + decimal_digits: 0, + rounding: 0, + code: 'DJF', + name_plural: 'Djiboutian francs', + }, + DKK: { + symbol: 'Dkr', + name: 'Danish Krone', + symbol_native: 'kr', + decimal_digits: 2, + rounding: 0, + code: 'DKK', + name_plural: 'Danish kroner', + }, + DOP: { + symbol: 'RD$', + name: 'Dominican Peso', + symbol_native: 'RD$', + decimal_digits: 2, + rounding: 0, + code: 'DOP', + name_plural: 'Dominican pesos', + }, + DZD: { + symbol: 'DA', + name: 'Algerian Dinar', + symbol_native: 'د.ج.‏', + decimal_digits: 2, + rounding: 0, + code: 'DZD', + name_plural: 'Algerian dinars', + }, + EEK: { + symbol: 'Ekr', + name: 'Estonian Kroon', + symbol_native: 'kr', + decimal_digits: 2, + rounding: 0, + code: 'EEK', + name_plural: 'Estonian kroons', + }, + EGP: { + symbol: 'EGP', + name: 'Egyptian Pound', + symbol_native: 'ج.م.‏', + decimal_digits: 2, + rounding: 0, + code: 'EGP', + name_plural: 'Egyptian pounds', + }, + ERN: { + symbol: 'Nfk', + name: 'Eritrean Nakfa', + symbol_native: 'Nfk', + decimal_digits: 2, + rounding: 0, + code: 'ERN', + name_plural: 'Eritrean nakfas', + }, + ETB: { + symbol: 'Br', + name: 'Ethiopian Birr', + symbol_native: 'Br', + decimal_digits: 2, + rounding: 0, + code: 'ETB', + name_plural: 'Ethiopian birrs', + }, + FKP: { + symbol: '£', + name: 'Falkland Island Pound', + symbol_native: '£', + decimal_digits: 2, + rounding: 0, + code: 'FKP', + name_plural: 'Falkland Island Pounds', + }, + GBP: { + symbol: '£', + name: 'British Pound Sterling', + symbol_native: '£', + decimal_digits: 2, + rounding: 0, + code: 'GBP', + name_plural: 'British pounds sterling', + }, + GEL: { + symbol: 'GEL', + name: 'Georgian Lari', + symbol_native: 'GEL', + decimal_digits: 2, + rounding: 0, + code: 'GEL', + name_plural: 'Georgian laris', + }, + GHS: { + symbol: 'GH₵', + name: 'Ghanaian Cedi', + symbol_native: 'GH₵', + decimal_digits: 2, + rounding: 0, + code: 'GHS', + name_plural: 'Ghanaian cedis', + }, + GIP: { + symbol: '£', + name: 'Gibraltar Pound', + symbol_native: '£', + decimal_digits: 2, + rounding: 0, + code: 'GHS', + name_plural: 'Gibraltar pound', + }, + GNF: { + symbol: 'FG', + name: 'Guinean Franc', + symbol_native: 'FG', + decimal_digits: 0, + rounding: 0, + code: 'GNF', + name_plural: 'Guinean francs', + }, + GTQ: { + symbol: 'GTQ', + name: 'Guatemalan Quetzal', + symbol_native: 'Q', + decimal_digits: 2, + rounding: 0, + code: 'GTQ', + name_plural: 'Guatemalan quetzals', + }, + HKD: { + symbol: 'HK$', + name: 'Hong Kong Dollar', + symbol_native: '$', + decimal_digits: 2, + rounding: 0, + code: 'HKD', + name_plural: 'Hong Kong dollars', + }, + HNL: { + symbol: 'HNL', + name: 'Honduran Lempira', + symbol_native: 'L', + decimal_digits: 2, + rounding: 0, + code: 'HNL', + name_plural: 'Honduran lempiras', + }, + HRK: { + symbol: 'kn', + name: 'Croatian Kuna', + symbol_native: 'kn', + decimal_digits: 2, + rounding: 0, + code: 'HRK', + name_plural: 'Croatian kunas', + }, + HUF: { + symbol: 'Ft', + name: 'Hungarian Forint', + symbol_native: 'Ft', + decimal_digits: 0, + rounding: 0, + code: 'HUF', + name_plural: 'Hungarian forints', + }, + IDR: { + symbol: 'Rp', + name: 'Indonesian Rupiah', + symbol_native: 'Rp', + decimal_digits: 0, + rounding: 0, + code: 'IDR', + name_plural: 'Indonesian rupiahs', + }, + ILS: { + symbol: '₪', + name: 'Israeli New Sheqel', + symbol_native: '₪', + decimal_digits: 2, + rounding: 0, + code: 'ILS', + name_plural: 'Israeli new sheqels', + }, + INR: { + symbol: 'Rs', + name: 'Indian Rupee', + symbol_native: 'টকা', + decimal_digits: 2, + rounding: 0, + code: 'INR', + name_plural: 'Indian rupees', + }, + IQD: { + symbol: 'IQD', + name: 'Iraqi Dinar', + symbol_native: 'د.ع.‏', + decimal_digits: 0, + rounding: 0, + code: 'IQD', + name_plural: 'Iraqi dinars', + }, + IRR: { + symbol: 'IRR', + name: 'Iranian Rial', + symbol_native: '﷼', + decimal_digits: 0, + rounding: 0, + code: 'IRR', + name_plural: 'Iranian rials', + }, + ISK: { + symbol: 'Ikr', + name: 'Icelandic Króna', + symbol_native: 'kr', + decimal_digits: 0, + rounding: 0, + code: 'ISK', + name_plural: 'Icelandic krónur', + }, + JMD: { + symbol: 'J$', + name: 'Jamaican Dollar', + symbol_native: '$', + decimal_digits: 2, + rounding: 0, + code: 'JMD', + name_plural: 'Jamaican dollars', + }, + JOD: { + symbol: 'JD', + name: 'Jordanian Dinar', + symbol_native: 'د.أ.‏', + decimal_digits: 3, + rounding: 0, + code: 'JOD', + name_plural: 'Jordanian dinars', + }, + JPY: { + symbol: '¥', + name: 'Japanese Yen', + symbol_native: '¥', + decimal_digits: 0, + rounding: 0, + code: 'JPY', + name_plural: 'Japanese yen', + }, + KES: { + symbol: 'с', + name: 'Kyrgyzstani som', + symbol_native: 'с', + decimal_digits: 2, + rounding: 0, + code: 'KES', + name_plural: 'Kyrgyzstani som', + }, + KGS: { + symbol: 'Ksh', + name: 'Kyrgyzstani Som', + symbol_native: 'Ksh', + decimal_digits: 2, + rounding: 0, + code: 'KES', + name_plural: 'Kenyan shillings', + }, + KHR: { + symbol: 'KHR', + name: 'Cambodian Riel', + symbol_native: '៛', + decimal_digits: 2, + rounding: 0, + code: 'KHR', + name_plural: 'Cambodian riels', + }, + KMF: { + symbol: 'CF', + name: 'Comorian Franc', + symbol_native: 'FC', + decimal_digits: 0, + rounding: 0, + code: 'KMF', + name_plural: 'Comorian francs', + }, + KRW: { + symbol: '₩', + name: 'South Korean Won', + symbol_native: '₩', + decimal_digits: 0, + rounding: 0, + code: 'KRW', + name_plural: 'South Korean won', + }, + KWD: { + symbol: 'KD', + name: 'Kuwaiti Dinar', + symbol_native: 'د.ك.‏', + decimal_digits: 3, + rounding: 0, + code: 'KWD', + name_plural: 'Kuwaiti dinars', + }, + KYD: { + symbol: '$', + name: 'Cayman Islands dollar', + symbol_native: '$‏', + decimal_digits: 2, + rounding: 0, + code: 'KYD', + name_plural: 'Cayman Islands dollarS', + }, + KZT: { + symbol: 'KZT', + name: 'Kazakhstani Tenge', + symbol_native: 'тңг.', + decimal_digits: 2, + rounding: 0, + code: 'KZT', + name_plural: 'Kazakhstani tenges', + }, + LAK: { + symbol: '₭', + name: 'Lao kip', + symbol_native: '₭‏', + decimal_digits: 0, + rounding: 0, + code: 'LAK', + name_plural: 'Lao kip', + }, + LBP: { + symbol: 'LB£', + name: 'Lebanese Pound', + symbol_native: 'ل.ل.‏', + decimal_digits: 0, + rounding: 0, + code: 'LBP', + name_plural: 'Lebanese pounds', + }, + LKR: { + symbol: 'SLRs', + name: 'Sri Lankan Rupee', + symbol_native: 'SL Re', + decimal_digits: 2, + rounding: 0, + code: 'LKR', + name_plural: 'Sri Lankan rupees', + }, + LRD: { + symbol: '$', + name: 'Liberian Dollar', + symbol_native: '$', + decimal_digits: 2, + rounding: 0, + code: 'LRD', + name_plural: 'Liberian Dollars', + }, + LTL: { + symbol: 'Lt', + name: 'Lithuanian Litas', + symbol_native: 'Lt', + decimal_digits: 2, + rounding: 0, + code: 'LTL', + name_plural: 'Lithuanian litai', + }, + LVL: { + symbol: 'Ls', + name: 'Latvian Lats', + symbol_native: 'Ls', + decimal_digits: 2, + rounding: 0, + code: 'LVL', + name_plural: 'Latvian lati', + }, + LYD: { + symbol: 'LD', + name: 'Libyan Dinar', + symbol_native: 'د.ل.‏', + decimal_digits: 3, + rounding: 0, + code: 'LYD', + name_plural: 'Libyan dinars', + }, + MAD: { + symbol: 'MAD', + name: 'Moroccan Dirham', + symbol_native: 'د.م.‏', + decimal_digits: 2, + rounding: 0, + code: 'MAD', + name_plural: 'Moroccan dirhams', + }, + MDL: { + symbol: 'MDL', + name: 'Moldovan Leu', + symbol_native: 'MDL', + decimal_digits: 2, + rounding: 0, + code: 'MDL', + name_plural: 'Moldovan lei', + }, + MGA: { + symbol: 'MGA', + name: 'Malagasy Ariary', + symbol_native: 'MGA', + decimal_digits: 0, + rounding: 0, + code: 'MGA', + name_plural: 'Malagasy Ariaries', + }, + MKD: { + symbol: 'MKD', + name: 'Macedonian Denar', + symbol_native: 'MKD', + decimal_digits: 2, + rounding: 0, + code: 'MKD', + name_plural: 'Macedonian denari', + }, + MMK: { + symbol: 'MMK', + name: 'Myanma Kyat', + symbol_native: 'K', + decimal_digits: 0, + rounding: 0, + code: 'MMK', + name_plural: 'Myanma kyats', + }, + MOP: { + symbol: 'MOP$', + name: 'Macanese Pataca', + symbol_native: 'MOP$', + decimal_digits: 2, + rounding: 0, + code: 'MOP', + name_plural: 'Macanese patacas', + }, + MUR: { + symbol: 'MURs', + name: 'Mauritian Rupee', + symbol_native: 'MURs', + decimal_digits: 0, + rounding: 0, + code: 'MUR', + name_plural: 'Mauritian rupees', + }, + MWK: { + symbol: 'MK', + name: 'Malawian Kwacha', + symbol_native: 'MK', + decimal_digits: 2, + rounding: 0, + code: 'MWK', + name_plural: 'Malawian Kwacha', + }, + MXN: { + symbol: 'MX$', + name: 'Mexican Peso', + symbol_native: '$', + decimal_digits: 2, + rounding: 0, + code: 'MXN', + name_plural: 'Mexican pesos', + }, + MYR: { + symbol: 'RM', + name: 'Malaysian Ringgit', + symbol_native: 'RM', + decimal_digits: 2, + rounding: 0, + code: 'MYR', + name_plural: 'Malaysian ringgits', + }, + MZN: { + symbol: 'MTn', + name: 'Mozambican Metical', + symbol_native: 'MTn', + decimal_digits: 2, + rounding: 0, + code: 'MZN', + name_plural: 'Mozambican meticals', + }, + NAD: { + symbol: 'N$', + name: 'Namibian Dollar', + symbol_native: 'N$', + decimal_digits: 2, + rounding: 0, + code: 'NAD', + name_plural: 'Namibian dollars', + }, + NGN: { + symbol: '₦', + name: 'Nigerian Naira', + symbol_native: '₦', + decimal_digits: 2, + rounding: 0, + code: 'NGN', + name_plural: 'Nigerian nairas', + }, + NIO: { + symbol: 'C$', + name: 'Nicaraguan Córdoba', + symbol_native: 'C$', + decimal_digits: 2, + rounding: 0, + code: 'NIO', + name_plural: 'Nicaraguan córdobas', + }, + NOK: { + symbol: 'Nkr', + name: 'Norwegian Krone', + symbol_native: 'kr', + decimal_digits: 2, + rounding: 0, + code: 'NOK', + name_plural: 'Norwegian kroner', + }, + NPR: { + symbol: 'NPRs', + name: 'Nepalese Rupee', + symbol_native: 'नेरू', + decimal_digits: 2, + rounding: 0, + code: 'NPR', + name_plural: 'Nepalese rupees', + }, + NZD: { + symbol: 'NZ$', + name: 'New Zealand Dollar', + symbol_native: '$', + decimal_digits: 2, + rounding: 0, + code: 'NZD', + name_plural: 'New Zealand dollars', + }, + OMR: { + symbol: 'OMR', + name: 'Omani Rial', + symbol_native: 'ر.ع.‏', + decimal_digits: 3, + rounding: 0, + code: 'OMR', + name_plural: 'Omani rials', + }, + PAB: { + symbol: 'B/.', + name: 'Panamanian Balboa', + symbol_native: 'B/.', + decimal_digits: 2, + rounding: 0, + code: 'PAB', + name_plural: 'Panamanian balboas', + }, + PEN: { + symbol: 'S/.', + name: 'Peruvian Nuevo Sol', + symbol_native: 'S/.', + decimal_digits: 2, + rounding: 0, + code: 'PEN', + name_plural: 'Peruvian nuevos soles', + }, + PHP: { + symbol: '₱', + name: 'Philippine Peso', + symbol_native: '₱', + decimal_digits: 2, + rounding: 0, + code: 'PHP', + name_plural: 'Philippine pesos', + }, + PKR: { + symbol: 'PKRs', + name: 'Pakistani Rupee', + symbol_native: '₨', + decimal_digits: 0, + rounding: 0, + code: 'PKR', + name_plural: 'Pakistani rupees', + }, + PLN: { + symbol: 'zł', + name: 'Polish Zloty', + symbol_native: 'zł', + decimal_digits: 2, + rounding: 0, + code: 'PLN', + name_plural: 'Polish zlotys', + }, + PYG: { + symbol: '₲', + name: 'Paraguayan Guarani', + symbol_native: '₲', + decimal_digits: 0, + rounding: 0, + code: 'PYG', + name_plural: 'Paraguayan guaranis', + }, + QAR: { + symbol: 'QR', + name: 'Qatari Rial', + symbol_native: 'ر.ق.‏', + decimal_digits: 2, + rounding: 0, + code: 'QAR', + name_plural: 'Qatari rials', + }, + RON: { + symbol: 'RON', + name: 'Romanian Leu', + symbol_native: 'RON', + decimal_digits: 2, + rounding: 0, + code: 'RON', + name_plural: 'Romanian lei', + }, + RSD: { + symbol: 'din.', + name: 'Serbian Dinar', + symbol_native: 'дин.', + decimal_digits: 0, + rounding: 0, + code: 'RSD', + name_plural: 'Serbian dinars', + }, + RUB: { + symbol: 'RUB', + name: 'Russian Ruble', + symbol_native: 'руб.', + decimal_digits: 2, + rounding: 0, + code: 'RUB', + name_plural: 'Russian rubles', + }, + RWF: { + symbol: 'RWF', + name: 'Rwandan Franc', + symbol_native: 'FR', + decimal_digits: 0, + rounding: 0, + code: 'RWF', + name_plural: 'Rwandan francs', + }, + SAR: { + symbol: 'SR', + name: 'Saudi Riyal', + symbol_native: 'ر.س.‏', + decimal_digits: 2, + rounding: 0, + code: 'SAR', + name_plural: 'Saudi riyals', + }, + SBD: { + symbol: '$', + name: 'Solomon Islander Dollar', + symbol_native: '$', + decimal_digits: 2, + rounding: 0, + code: 'SBD', + name_plural: 'Solomon Islander Dollars', + }, + SDG: { + symbol: 'SDG', + name: 'Sudanese Pound', + symbol_native: 'SDG', + decimal_digits: 2, + rounding: 0, + code: 'SDG', + name_plural: 'Sudanese pounds', + }, + SEK: { + symbol: 'Skr', + name: 'Swedish Krona', + symbol_native: 'kr', + decimal_digits: 2, + rounding: 0, + code: 'SEK', + name_plural: 'Swedish kronor', + }, + SGD: { + symbol: 'S$', + name: 'Singapore Dollar', + symbol_native: '$', + decimal_digits: 2, + rounding: 0, + code: 'SGD', + name_plural: 'Singapore dollars', + }, + SLL: { + symbol: 'Le', + name: 'Sierra Leonean Leone', + symbol_native: 'Le', + decimal_digits: 2, + rounding: 0, + code: 'SLL', + name_plural: 'Sierra Leonean Leone', + }, + SOS: { + symbol: 'Ssh', + name: 'Somali Shilling', + symbol_native: 'Ssh', + decimal_digits: 0, + rounding: 0, + code: 'SOS', + name_plural: 'Somali shillings', + }, + SSP: { + symbol: '£', + name: 'South Sudanese pound', + symbol_native: '£', + decimal_digits: 2, + rounding: 0, + code: 'SSP', + name_plural: 'South Sudanese pound', + }, + STD: { + symbol: 'Db', + name: 'Sao Tomean Dobra', + symbol_native: 'Db', + decimal_digits: 0, + rounding: 0, + code: 'STD', + name_plural: 'Sao Tomean Dobra', + }, + STN: { + symbol: 'Db', + name: 'Sao Tomean Dobra', + symbol_native: 'Db', + decimal_digits: 0, + rounding: 0, + code: 'STN', + name_plural: 'Sao Tomean Dobra', + }, + SYP: { + symbol: 'SY£', + name: 'Syrian Pound', + symbol_native: 'ل.س.‏', + decimal_digits: 0, + rounding: 0, + code: 'SYP', + name_plural: 'Syrian pounds', + }, + SZL: { + symbol: 'L', + name: 'Swazi Lilangeni', + symbol_native: 'L‏', + decimal_digits: 0, + rounding: 0, + code: 'SZL', + name_plural: 'Swazi Lilangeni', + }, + THB: { + symbol: '฿', + name: 'Thai Baht', + symbol_native: '฿', + decimal_digits: 2, + rounding: 0, + code: 'THB', + name_plural: 'Thai baht', + }, + TJS: { + symbol: 'ЅМ', + name: 'Tajikistani Somoni', + symbol_native: 'ЅМ', + decimal_digits: 2, + rounding: 0, + code: 'THB', + name_plural: 'Tajikistani Somoni', + }, + TND: { + symbol: 'DT', + name: 'Tunisian Dinar', + symbol_native: 'د.ت.‏', + decimal_digits: 3, + rounding: 0, + code: 'TND', + name_plural: 'Tunisian dinars', + }, + TOP: { + symbol: 'T$', + name: 'Tongan Paʻanga', + symbol_native: 'T$', + decimal_digits: 2, + rounding: 0, + code: 'TOP', + name_plural: 'Tongan paʻanga', + }, + TRY: { + symbol: 'TL', + name: 'Turkish Lira', + symbol_native: 'TL', + decimal_digits: 2, + rounding: 0, + code: 'TRY', + name_plural: 'Turkish Lira', + }, + TTD: { + symbol: 'TT$', + name: 'Trinidad and Tobago Dollar', + symbol_native: '$', + decimal_digits: 2, + rounding: 0, + code: 'TTD', + name_plural: 'Trinidad and Tobago dollars', + }, + TWD: { + symbol: 'NT$', + name: 'New Taiwan Dollar', + symbol_native: 'NT$', + decimal_digits: 2, + rounding: 0, + code: 'TWD', + name_plural: 'New Taiwan dollars', + }, + TZS: { + symbol: 'TSh', + name: 'Tanzanian Shilling', + symbol_native: 'TSh', + decimal_digits: 0, + rounding: 0, + code: 'TZS', + name_plural: 'Tanzanian shillings', + }, + UAH: { + symbol: '₴', + name: 'Ukrainian Hryvnia', + symbol_native: '₴', + decimal_digits: 2, + rounding: 0, + code: 'UAH', + name_plural: 'Ukrainian hryvnias', + }, + UGX: { + symbol: 'USh', + name: 'Ugandan Shilling', + symbol_native: 'USh', + decimal_digits: 0, + rounding: 0, + code: 'UGX', + name_plural: 'Ugandan shillings', + }, + UYU: { + symbol: '$U', + name: 'Uruguayan Peso', + symbol_native: '$', + decimal_digits: 2, + rounding: 0, + code: 'UYU', + name_plural: 'Uruguayan pesos', + }, + UZS: { + symbol: 'UZS', + name: 'Uzbekistan Som', + symbol_native: 'UZS', + decimal_digits: 0, + rounding: 0, + code: 'UZS', + name_plural: 'Uzbekistan som', + }, + VEF: { + symbol: 'Bs.F.', + name: 'Venezuelan Bolívar', + symbol_native: 'Bs.F.', + decimal_digits: 2, + rounding: 0, + code: 'VEF', + name_plural: 'Venezuelan bolívars', + }, + VND: { + symbol: '₫', + name: 'Vietnamese Dong', + symbol_native: '₫', + decimal_digits: 0, + rounding: 0, + code: 'VND', + name_plural: 'Vietnamese dong', + }, + VUV: { + symbol: 'Vt', + name: 'Ni-Vanuatu Vatu', + symbol_native: 'Vt', + decimal_digits: 0, + rounding: 0, + code: 'VUV', + name_plural: 'Ni-Vanuatu Vatu', + }, + XAF: { + symbol: 'FCFA', + name: 'CFA Franc BEAC', + symbol_native: 'FCFA', + decimal_digits: 0, + rounding: 0, + code: 'XAF', + name_plural: 'CFA francs BEAC', + }, + XCD: { + symbol: '$', + name: 'East Caribbean Dollar', + symbol_native: '$', + decimal_digits: 0, + rounding: 0, + code: 'XCD', + name_plural: 'East Caribbean Dollars', + }, + XOF: { + symbol: 'CFA', + name: 'CFA Franc BCEAO', + symbol_native: 'CFA', + decimal_digits: 0, + rounding: 0, + code: 'XOF', + name_plural: 'CFA francs BCEAO', + }, + XPF: { + symbol: 'Fr', + name: 'CFP franc', + symbol_native: 'Fr', + decimal_digits: 0, + rounding: 0, + code: 'XPF', + name_plural: 'CFP franc', + }, + YER: { + symbol: 'YR', + name: 'Yemeni Rial', + symbol_native: 'ر.ي.‏', + decimal_digits: 0, + rounding: 0, + code: 'YER', + name_plural: 'Yemeni rials', + }, + ZAR: { + symbol: 'R', + name: 'South African Rand', + symbol_native: 'R', + decimal_digits: 2, + rounding: 0, + code: 'ZAR', + name_plural: 'South African rand', + }, + ZMK: { + symbol: 'ZK', + name: 'Zambian Kwacha', + symbol_native: 'ZK', + decimal_digits: 0, + rounding: 0, + code: 'ZMK', + name_plural: 'Zambian kwachas', + }, } diff --git a/resources/js/views/CustomerDetail.vue b/resources/js/views/CustomerDetail.vue deleted file mode 100644 index 9391412..0000000 --- a/resources/js/views/CustomerDetail.vue +++ /dev/null @@ -1,16 +0,0 @@ - - - diff --git a/resources/js/views/Customers.vue b/resources/js/views/Customers.vue deleted file mode 100644 index bf2fb9b..0000000 --- a/resources/js/views/Customers.vue +++ /dev/null @@ -1,15 +0,0 @@ - - - diff --git a/resources/js/views/Detail.vue b/resources/js/views/Detail.vue deleted file mode 100644 index 1ea7ef7..0000000 --- a/resources/js/views/Detail.vue +++ /dev/null @@ -1,55 +0,0 @@ - - - diff --git a/resources/js/views/Index.vue b/resources/js/views/Index.vue deleted file mode 100644 index 75335c8..0000000 --- a/resources/js/views/Index.vue +++ /dev/null @@ -1,33 +0,0 @@ - - - diff --git a/resources/lang/_lang.json b/resources/lang/_lang.json new file mode 100644 index 0000000..94439bd --- /dev/null +++ b/resources/lang/_lang.json @@ -0,0 +1,89 @@ +{ + "Address": "", + "Amount": "", + "Available Balance": "", + "Balance": "", + "Captured": "", + "Charge Details": "", + "Created": "", + "Currency": "", + "Customer ID": "", + "Customers": "", + "Default Source": "", + "Delinquent": "", + "Description": "", + "Discount": "", + "Dispute": "", + "Email": "", + "Fee": "", + "Fraud Details": "", + "ID": "", + "Invoice Prefix": "", + "Livemode": "", + "Metadata": "", + "Name": "", + "Net": "", + "Next Invoice Sequence": "", + "Next": "", + "Paid": "", + "Pending Balance": "", + "Phone": "", + "Preferred Locales": "", + "Previous": "", + "Refund": "", + "Refunded": "", + "Select Columns": "", + "Shipping Address": "", + "Status": "", + "Stripe Dashboard": "", + "Tax Exempt": "", + "Transfer Group": "", + "View": "", + "amount captured": "", + "amount refunded": "", + "amount": "", + "application fee amount": "", + "application fee": "", + "application": "", + "balance transaction": "", + "billing details": "", + "calculated statement descriptor": "", + "captured": "", + "created": "", + "currency": "", + "customer": "", + "description": "", + "destination": "", + "dispute": "", + "disputed": "", + "failure balance transaction": "", + "failure code": "", + "failure message": "", + "fraud details": "", + "id": "", + "invoice": "", + "livemode": "", + "metadata": "", + "object": "", + "on behalf of": "", + "order": "", + "outcome": "", + "paid": "", + "payment intent": "", + "payment method details": "", + "payment method": "", + "receipt email": "", + "receipt number": "", + "receipt url": "", + "refunded": "", + "refunds": "", + "review": "", + "shipping": "", + "source transfer": "", + "source": "", + "statement descriptor suffix": "", + "statement descriptor": "", + "status": "", + "transfer data": "", + "transfer group": "" +} diff --git a/resources/lang/en.json b/resources/lang/en.json new file mode 100644 index 0000000..361af7a --- /dev/null +++ b/resources/lang/en.json @@ -0,0 +1,89 @@ +{ + "Address": "Address", + "Amount": "Amount", + "Available Balance": "Available Balance", + "Balance": "Balance", + "Captured": "Captured", + "Charge Details": "Charge Details", + "Created": "Created", + "Currency": "Currency", + "Customer ID": "", + "Customers": "Customers", + "Default Source": "Default Source", + "Delinquent": "Delinquent", + "Description": "Description", + "Discount": "Discount", + "Dispute": "Dispute", + "Email": "Email", + "Fee": "Fee", + "Fraud Details": "Fraud Details", + "ID": "ID", + "Invoice Prefix": "Invoice Prefix", + "Livemode": "Livemode", + "Metadata": "Metadata", + "Name": "Name", + "Net": "Net", + "Next Invoice Sequence": "Next Invoice Sequence", + "Next": "Next", + "Paid": "Paid", + "Pending Balance": "Pending Balance", + "Phone": "Phone", + "Preferred Locales": "Preferred Locales", + "Previous": "Previous", + "Refund": "Refund", + "Refunded": "Refunded", + "Select Columns": "Select Columns", + "Shipping Address": "Shipping Address", + "Status": "Status", + "Stripe Dashboard": "Stripe Dashboard", + "Tax Exempt": "Tax Exempt", + "Transfer Group": "Transfer Group", + "View": "View", + "amount captured": "amount captured", + "amount refunded": "amount refunded", + "amount": "amount", + "application fee amount": "application fee amount", + "application fee": "application fee", + "application": "application", + "balance transaction": "balance transaction", + "billing details": "billing details", + "calculated statement descriptor": "calculated statement descriptor", + "captured": "captured", + "created": "created", + "currency": "currency", + "customer": "customer", + "description": "description", + "destination": "destination", + "dispute": "dispute", + "disputed": "disputed", + "failure balance transaction": "failure balance transaction", + "failure code": "failure code", + "failure message": "failure message", + "fraud details": "fraud details", + "id": "id", + "invoice": "invoice", + "livemode": "livemode", + "metadata": "metadata", + "object": "object", + "on behalf of": "on behalf of", + "order": "order", + "outcome": "outcome", + "paid": "paid", + "payment intent": "payment intent", + "payment method details": "payment method details", + "payment method": "payment method", + "receipt email": "receipt email", + "receipt number": "receipt number", + "receipt url": "receipt url", + "refunded": "refunded", + "refunds": "refunds", + "review": "review", + "shipping": "shipping", + "source transfer": "source transfer", + "source": "source", + "statement descriptor suffix": "statement descriptor suffix", + "statement descriptor": "statement descriptor", + "status": "status", + "transfer data": "transfer data", + "transfer group": "transfer group" +} diff --git a/resources/sass/tool.scss b/resources/sass/tool.scss deleted file mode 100644 index f85ad40..0000000 --- a/resources/sass/tool.scss +++ /dev/null @@ -1 +0,0 @@ -// Nova Tool CSS diff --git a/resources/views/navigation.blade.php b/resources/views/navigation.blade.php deleted file mode 100644 index 31665e8..0000000 --- a/resources/views/navigation.blade.php +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - Stripe - - - - - - Customers - - diff --git a/routes/inertia.php b/routes/inertia.php new file mode 100644 index 0000000..4057036 --- /dev/null +++ b/routes/inertia.php @@ -0,0 +1,36 @@ +group(function () { + Route::get('/', function () { + return inertia('Tool'); + })->name(''); + + Route::get('charges/{chargeId}', function (string $chargeId) { + return inertia('Detail', [ + 'chargeId' => $chargeId, + ]); + })->name('.charge'); + + Route::get('customers', function () { + return inertia('Customers'); + })->name('.customers'); + + Route::get('customers/{customerId}', function (string $customerId) { + return inertia('CustomerDetail', [ + 'customerId' => $customerId, + ]); + })->name('.customers'); +}); diff --git a/src/NovaStripe.php b/src/NovaStripe.php index 0847d0a..be3af6c 100644 --- a/src/NovaStripe.php +++ b/src/NovaStripe.php @@ -2,6 +2,9 @@ namespace Tighten\NovaStripe; +use Illuminate\Http\Request; +use Laravel\Nova\Menu\MenuItem; +use Laravel\Nova\Menu\MenuSection; use Laravel\Nova\Nova; use Laravel\Nova\Tool; @@ -16,15 +19,24 @@ public function boot() { Nova::script('nova-stripe', __DIR__ . '/../dist/js/tool.js'); Nova::style('nova-stripe', __DIR__ . '/../dist/css/tool.css'); + Nova::translations(__DIR__ . '/../dist/lang/' . app()->getLocale() . '.json'); } /** - * Build the view that renders the navigation links for the tool. + * Build the menu that renders the navigation links for the tool. * - * @return \Illuminate\View\View + * @param \Illuminate\Http\Request $request + * @return mixed */ - public function renderNavigation() + public function menu(Request $request) { - return view('nova-stripe::navigation'); + return MenuSection::make( + 'Nova Stripe', + [ + MenuItem::make(__('Customers'), '/nova-stripe/customers'), + ], + 'credit-card' + ) + ->path('/nova-stripe'); } } diff --git a/src/ToolServiceProvider.php b/src/ToolServiceProvider.php index 41dad20..96eb07c 100644 --- a/src/ToolServiceProvider.php +++ b/src/ToolServiceProvider.php @@ -17,8 +17,6 @@ class ToolServiceProvider extends ServiceProvider */ public function boot() { - $this->loadViewsFrom(__DIR__ . '/../resources/views', 'nova-stripe'); - $this->app->booted(function () { $this->routes(); }); @@ -39,6 +37,9 @@ protected function routes() return; } + Nova::router(['nova', Authorize::class], 'nova-stripe') + ->group(__DIR__ . '/../routes/inertia.php'); + Route::middleware(['nova', Authorize::class]) ->prefix('nova-vendor/nova-stripe') ->group(__DIR__ . '/../routes/api.php'); diff --git a/tailwind.config.js b/tailwind.config.js new file mode 100644 index 0000000..a1597ad --- /dev/null +++ b/tailwind.config.js @@ -0,0 +1,12 @@ +/** @type {import('tailwindcss').Config} */ +module.exports = { + content: [ + "./resources/**/*.blade.php", + "./resources/**/*.js", + "./resources/**/*.vue", + ], + theme: { + extend: {}, + }, + plugins: [], +} diff --git a/tests/StripeChargeControllerTest.php b/tests/StripeChargeControllerTest.php index b13dd3e..34a1188 100644 --- a/tests/StripeChargeControllerTest.php +++ b/tests/StripeChargeControllerTest.php @@ -10,20 +10,12 @@ class StripeChargeControllerTest extends TestCase use WithFaker; protected $stripe; - protected $charge; public function setUp(): void { parent::setUp(); - $this->stripe = new StripeClient; - $this->charge = $this->findSuccessfulNonRefundedCharge() - ?: $this->stripe->createCharge([ - 'amount' => $this->faker->numberBetween(50, 1000), - 'currency' => 'usd', - 'source' => 'tok_mastercard', - 'description' => $this->faker->sentence, - ]); + $this->stripe = new StripeClient; } /** @test */ @@ -35,7 +27,13 @@ public function it_can_can_return_a_response() $this->get('nova-vendor/nova-stripe/stripe/balance') ->assertSuccessful(); - $this->get('nova-vendor/nova-stripe/stripe/charges/' . $this->charge->id) + $this->get('nova-vendor/nova-stripe/stripe/charges/' . 1) + ->assertSuccessful(); + + $this->get('nova-vendor/nova-stripe/stripe/customers') + ->assertSuccessful(); + + $this->get('nova-vendor/nova-stripe/stripe/customers/' . 1) ->assertSuccessful(); } @@ -43,78 +41,109 @@ public function it_can_can_return_a_response() public function it_returns_a_list_of_charges() { $this->get('nova-vendor/nova-stripe/stripe/charges') - ->assertJsonFragment(['description' => $this->charge->description]) - ->assertJsonFragment(['amount' => $this->charge->amount]); + ->assertJsonStructure([ + 'charges' => [ + 'data' => [ + '*' => [], + ], + ], + ]); } /** @test */ public function it_returns_charge_details() { - $response = $this->get('nova-vendor/nova-stripe/stripe/charges/' . $this->charge->id); - $stripeCharge = $this->stripe->getCharge($this->charge->id); - - $response->assertJsonFragment([ - 'id' => $stripeCharge->id, - 'amount' => $stripeCharge->amount, - 'status' => $stripeCharge->status, - 'created' => $stripeCharge->created, - 'metadata' => $stripeCharge->metadata, - 'livemode' => $stripeCharge->livemode, - 'captured' => $stripeCharge->captured, - 'paid' => $stripeCharge->paid, - 'refunded' => $stripeCharge->refunded, - 'dispute' => $stripeCharge->dispute, - 'fraud_details' => $stripeCharge->fraud_details, - 'transfer_group' => $stripeCharge->transfer_group, + $this->get('nova-vendor/nova-stripe/stripe/charges/' . 1) + ->assertJsonStructure([ + 'charge' => [ + 'id', + 'amount', + 'status', + 'created', + 'metadata', + 'livemode', + 'captured', + 'paid', + 'refunded', + 'disputed', + 'fraud_details', + 'transfer_group', + ], ]); - - $response->assertSee($stripeCharge->id) - ->assertSee($stripeCharge->amount) - ->assertSee($stripeCharge->status) - ->assertSee($stripeCharge->created) - ->assertSee($stripeCharge->livemode) - ->assertSee($stripeCharge->captured) - ->assertSee($stripeCharge->paid) - ->assertSee($stripeCharge->refunded) - ->assertSee($stripeCharge->dispute) - ->assertSee($stripeCharge->transfer_group); } /** @test */ public function it_shows_the_current_balance() { - $balance = $this->stripe->getBalance(); - $this->get('nova-vendor/nova-stripe/stripe/balance') - ->assertJsonFragment([ - 'available' => $balance->available, - 'pending' => $balance->pending, + ->assertJsonStructure([ + 'balance' => [ + 'available' => [ + '*' => [ + 'amount', + 'currency', + ], + ], + 'pending' => [ + '*' => [ + 'amount', + 'currency', + ], + ], + ], ]); } /** @test */ public function it_can_refund_a_charge_successfully() { - $this->post('nova-vendor/nova-stripe/stripe/charges/' . $this->charge->id . '/refund') + $this->post('nova-vendor/nova-stripe/stripe/charges/' . 1 . '/refund') ->assertSuccessful() ->assertJsonFragment([ - 'charge' => $this->charge->id, 'status' => 'succeeded', ]); - - $this->assertTrue($this->stripe->getCharge($this->charge->id)->refunded); } - public function findSuccessfulNonRefundedCharge() + /** @test */ + public function it_returns_a_list_of_customers() { - $charges = $this->stripe->listCharges(); - - foreach ($charges as $charge) { - if (! $charge->refunded && $charge->status === 'succeeded') { - return $charge; - } - } + $this->get('nova-vendor/nova-stripe/stripe/customers') + ->assertJsonStructure([ + 'customers' => [ + 'data' => [ + '*' => [], + ], + ], + ]); + } - return null; + /** @test */ + public function it_returns_customer_details() + { + $this->get('nova-vendor/nova-stripe/stripe/customers/' . 1) + ->assertJsonStructure([ + 'customer' => [ + 'id', + 'object', + 'address', + 'balance', + 'created', + 'currency', + 'default_source', + 'delinquent', + 'description', + 'discount', + 'email', + 'invoice_prefix', + 'livemode', + 'metadata', + 'name', + 'next_invoice_sequence', + 'phone', + 'preferred_locales', + 'shipping', + 'tax_exempt', + ], + ]); } } diff --git a/tests/TestCase.php b/tests/TestCase.php index f612d90..5311f6c 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -5,6 +5,7 @@ use Illuminate\Foundation\Bootstrap\LoadEnvironmentVariables; use Illuminate\Support\Facades\Route; use Orchestra\Testbench\TestCase as Orchestra; +use Stripe\Stripe; use Tighten\NovaStripe\ToolServiceProvider; abstract class TestCase extends Orchestra @@ -21,6 +22,8 @@ protected function getEnvironmentSetUp($app) $app->useEnvironmentPath(__DIR__ . '/..'); $app->bootstrapWith([LoadEnvironmentVariables::class]); $app->config->set('services.stripe.secret', getenv('STRIPE_TEST_SECRET')); + Stripe::$apiBase = getenv('STRIPE_API_BASE'); + parent::getEnvironmentSetUp($app); } diff --git a/webpack.mix.js b/webpack.mix.js index 788d402..55865a3 100644 --- a/webpack.mix.js +++ b/webpack.mix.js @@ -1,4 +1,11 @@ -let mix = require('laravel-mix') +let mix = require('laravel-mix'); +require('./nova.mix'); -mix.js('resources/js/tool.js', 'dist/js') - .sass('resources/sass/tool.scss', 'dist/css') +mix.setPublicPath('dist') + .copy('resources/lang/**/!(_lang.json)', 'dist/lang') + .js('resources/js/tool.js', 'js') + .vue({ version: 3 }) + .postCss('resources/css/tool.css', '/css/', [ + require("tailwindcss"), + ]) + .nova('tightenco/nova-stripe');