diff --git a/.gitignore b/.gitignore index e7dd4ef0..01ad6209 100755 --- a/.gitignore +++ b/.gitignore @@ -652,4 +652,6 @@ api/lightning/router* api/lightning/googleapis* frontend/static/admin* frontend/static/rest_framework* -frontend/static/import_export* \ No newline at end of file +frontend/static/import_export* +frontend/src/components/payment-method-images/code* +frontend/src/components/payment-method-images/webp* \ No newline at end of file diff --git a/api/logics.py b/api/logics.py index c0dbb5b4..94274bc0 100644 --- a/api/logics.py +++ b/api/logics.py @@ -709,12 +709,14 @@ class Logics: order.save() return - def publish_order(order): + @classmethod + def publish_order(cls, order): order.status = Order.Status.PUB order.expires_at = order.created_at + timedelta( seconds=order.t_to_expire(Order.Status.PUB)) if order.has_range: order.amount = None + order.last_satoshis = cls.satoshis_now(order) order.save() # send_message.delay(order.id,'order_published') # too spammy return diff --git a/api/models.py b/api/models.py index d7094ca2..82f854cc 100644 --- a/api/models.py +++ b/api/models.py @@ -196,7 +196,7 @@ class Order(models.Model): has_range = models.BooleanField(default=False, null=False, blank=False) min_amount = models.DecimalField(max_digits=18, decimal_places=8, null=True, blank=True) max_amount = models.DecimalField(max_digits=18, decimal_places=8, null=True, blank=True) - payment_method = models.CharField(max_length=35, + payment_method = models.CharField(max_length=70, null=False, default="not specified", blank=True) diff --git a/control/admin.py b/control/admin.py index c7416eab..9e5a49af 100755 --- a/control/admin.py +++ b/control/admin.py @@ -21,7 +21,6 @@ class AccountingDayAdmin(ImportExportModelAdmin): "outstanding_earned_rewards", "outstanding_pending_disputes", "lifetime_rewards_claimed", - "outstanding_earned_rewards", "earned_rewards", "disputes", "rewards_claimed", diff --git a/frontend/package-lock.json b/frontend/package-lock.json index a057ccff..26724235 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -3393,6 +3393,11 @@ "yaml": "^1.7.2" } }, + "country-flag-icons": { + "version": "1.4.25", + "resolved": "https://registry.npmjs.org/country-flag-icons/-/country-flag-icons-1.4.25.tgz", + "integrity": "sha512-1sF/6cit7MYfmxrqNiVN0ijLGv10xtV8egAUwUgIW6Q/Y6d7SuuVw5TOBnG7qIFqrNjxaPNoIAZmx7yOEuZvDA==" + }, "cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", @@ -6350,11 +6355,6 @@ "scheduler": "^0.20.2" } }, - "react-flagkit": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/react-flagkit/-/react-flagkit-2.0.4.tgz", - "integrity": "sha512-e0Rak6VG1+KemBFqLqTPzFDLYS40lEW1YOpG9s68WDoEoQiC0YPEXDkIGLorNgP6omJztcg/OtcjSqAKM2O1cw==" - }, "react-is": { "version": "17.0.2", "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz", @@ -6693,6 +6693,15 @@ "prop-types": "^15.6.2" } }, + "react-world-flags": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/react-world-flags/-/react-world-flags-1.4.0.tgz", + "integrity": "sha512-SkOzl/v6LYBphJNSeeQXTogAiLZN1Yy2HFx2Qjda/82MCWFimj9cenmOXASbfbKeqFbo/17M8HauY6mfzWmTDw==", + "requires": { + "svg-country-flags": "^1.2.7", + "world-countries": "^4.0.0" + } + }, "readable-stream": { "version": "2.3.7", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", @@ -7649,6 +7658,11 @@ "has-flag": "^4.0.0" } }, + "svg-country-flags": { + "version": "1.2.10", + "resolved": "https://registry.npmjs.org/svg-country-flags/-/svg-country-flags-1.2.10.tgz", + "integrity": "sha512-xrqwo0TYf/h2cfPvGpjdSuSguUbri4vNNizBnwzoZnX0xGo3O5nGJMlbYEp7NOYcnPGBm6LE2axqDWSB847bLw==" + }, "tapable": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz", @@ -8157,6 +8171,11 @@ "integrity": "sha512-JcKqAHLPxcdb9KM49dufGXn2x3ssnfjbcaQdLlfZsL9rH9wgDQjUtDxbo8NE0F6SFvydeu1VhZe7hZuHsB2/pw==", "dev": true }, + "world-countries": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/world-countries/-/world-countries-4.0.0.tgz", + "integrity": "sha512-LsFFYmggquj0U+i7VUaJOZYz5F4QNu+oceGw8odnyVHMT2LxYSdVncqdouOEnq1esr7yCakp9+3BZTztuSw1Pg==" + }, "wrap-ansi": { "version": "6.2.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", diff --git a/frontend/package.json b/frontend/package.json index 4c06909c..73e16d2a 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -31,16 +31,17 @@ "@mui/material": "^5.2.7", "@mui/system": "^5.2.6", "@mui/x-data-grid": "^5.2.2", + "country-flag-icons": "^1.4.25", "date-fns": "^2.28.0", "material-ui-image": "^3.3.2", "react-countdown": "^2.3.2", - "react-flagkit": "^2.0.4", "react-native": "^0.66.4", "react-native-svg": "^12.1.1", "react-qr-code": "^2.0.3", "react-qr-reader": "^2.2.1", "react-responsive": "^9.0.0-beta.6", "react-router-dom": "^5.2.0", + "react-world-flags": "^1.4.0", "reconnecting-websocket": "^4.4.0", "websocket": "^1.0.34" } diff --git a/frontend/src/components/BookPage.js b/frontend/src/components/BookPage.js index f059db6c..90d667b1 100644 --- a/frontend/src/components/BookPage.js +++ b/frontend/src/components/BookPage.js @@ -5,6 +5,7 @@ import { DataGrid } from '@mui/x-data-grid'; import MediaQuery from 'react-responsive' import Image from 'material-ui-image' import getFlags from './getFlags' +import PaymentText from './PaymentText' export default class BookPage extends Component { constructor(props) { @@ -149,7 +150,11 @@ export default class BookPage extends Component { renderCell: (params) => {return (