Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Move payment actions logic to the model; adjust Dashboard 2.0 to backend changes

Marcin Gębala9d9766ad8a2f
diff --git a/saleor/core/__init__.py b/saleor/core/__init__.py
index a3999287dd..8870465617 100644
--- a/saleor/core/__init__.py
+++ b/saleor/core/__init__.py
@@ -87,6 +87,7 @@ class TaxRateType:
(WATER, pgettext_lazy('VAT rate type', 'water')))
+# FIXME: duplicate of saleor.core.taxes.ZERO_MONEY
def zero_money():
"""Function used as a model's default."""
return Money(0, currency=settings.DEFAULT_CURRENCY)
diff --git a/saleor/dashboard/order/views.py b/saleor/dashboard/order/views.py
index 520c01b952..7fd186db51 100644
--- a/saleor/dashboard/order/views.py
+++ b/saleor/dashboard/order/views.py
@@ -14,16 +14,13 @@ from django_prices.templatetags import prices_i18n
from ...core.exceptions import InsufficientStock
from ...core.utils import get_paginator_items
-from ...core.utils.taxes import (
- ZERO_MONEY, ZERO_TAXED_MONEY, get_taxes_for_address)
-from ...order import (
- CustomPaymentChoices, OrderEvents, OrderEventsEmails, OrderStatus)
+from ...core.utils.taxes import get_taxes_for_address
+from ...order import OrderEvents, OrderEventsEmails, OrderStatus
from ...order.emails import (
send_fulfillment_confirmation, send_fulfillment_update,
send_order_confirmation)
from ...order.models import Fulfillment, FulfillmentLine, Order
from ...order.utils import update_order_prices, update_order_status
-from ...payment import ChargeStatus
from ...shipping.models import ShippingMethod
from ..views import staff_member_required
from .filters import OrderFilter
@@ -124,36 +121,10 @@ def order_details(request, order_pk):
order = get_object_or_404(qs, pk=order_pk)
all_payments = order.payments.all()
payment = order.get_last_payment()
- preauthorized = ZERO_TAXED_MONEY
- captured = ZERO_MONEY
- balance = captured - order.total.gross
- if payment:
- can_capture = (
- payment.is_active and
- payment.charge_status == ChargeStatus.NOT_CHARGED and
- order.status not in {OrderStatus.DRAFT, OrderStatus.CANCELED})
- can_void = (
- payment.is_active and
- payment.charge_status == ChargeStatus.NOT_CHARGED)
- can_refund = (
- payment.is_active and
- payment.charge_status == ChargeStatus.CHARGED and
- payment.variant != CustomPaymentChoices.MANUAL)
- preauthorized = payment.total
- if payment.charge_status == ChargeStatus.CHARGED:
- captured = payment.captured_amount
- balance = captured - order.total.gross
- else:
- can_capture = can_void = can_refund = False
- can_mark_as_paid = not order.payments.exists()
ctx = {
'order': order, 'all_payments': all_payments, 'payment': payment,
'notes': order.events.filter(type=OrderEvents.NOTE_ADDED.value),
'events': order.events.all(),
- 'captured': captured, 'balance': balance,
- 'preauthorized': preauthorized,
- 'can_capture': can_capture, 'can_void': can_void,
- 'can_refund': can_refund, 'can_mark_as_paid': can_mark_as_paid,
'order_fulfillments': order.fulfillments.all()}
return TemplateResponse(request, 'dashboard/order/detail.html', ctx)
diff --git a/saleor/graphql/order/types.py b/saleor/graphql/order/types.py
index 9385c93475..36ce029e7b 100644
--- a/saleor/graphql/order/types.py
+++ b/saleor/graphql/order/types.py
@@ -3,14 +3,12 @@ import graphene_django_optimizer as gql_optimizer
from graphene import relay
from ...order import OrderEvents, OrderEventsEmails, models
-from ...payment import ChargeStatus
from ...product.templatetags.product_images import get_thumbnail
from ...shipping import models as shipping_models
from ..account.types import User
from ..core.fields import PrefetchingConnectionField
from ..core.types.common import CountableDjangoObjectType
from ..core.types.money import Money, TaxedMoney
-from ..core.utils import str_to_enum
from ..payment.types import PaymentChargeStatusEnum
from ..shipping.types import ShippingMethod
@@ -141,6 +139,24 @@ class OrderLine(CountableDjangoObjectType):
return obj.unit_price
+class OrderAction(graphene.Enum):
+ CAPTURE = 'CAPTURE'
+ MARK_AS_PAID = 'MARK_AS_PAID'
+ REFUND = 'REFUND'
+ VOID = 'VOID'
+
+ @property
+ def description(self):
+ if self == OrderAction.CAPTURE:
+ return 'Represents the capture action.'
+ if self == OrderAction.MARK_AS_PAID:
+ return 'Represents a mark-as-paid action.'
+ if self == OrderAction.REFUND:
+ return 'Represents a refund action.'
+ if self == OrderAction.VOID:
+ return 'Represents a void action.'
+
+
class Order(CountableDjangoObjectType):
fulfillments = gql_optimizer.field(
graphene.List(
@@ -152,9 +168,15 @@ class Order(CountableDjangoObjectType):
lambda: OrderLine, required=True,
description='List of order lines.'),
model_field='lines')
+ actions = graphene.List(
+ OrderAction, description='''List of actions that can be performed in
+ the current state of an order.''', required=True)
+ available_shipping_methods = graphene.List(
+ ShippingMethod, required=False,
+ description='Shipping methods that can be used with this order.')
+ number = graphene.String(description='User-friendly number of an order.')
is_paid = graphene.Boolean(
description='Informs if an order is fully paid.')
- number = graphene.String(description='User-friendly number of an order.')
payment_status = PaymentChargeStatusEnum(
description='Internal payment status.')
payment_status_display = graphene.String(
@@ -176,11 +198,12 @@ class Order(CountableDjangoObjectType):
OrderEvent,
description='List of events associated with the order.'),
model_field='events')
+ balance_amount = graphene.Field(
+ Money,
+ description='''The difference between the paid and the order total
+ amount.''', required=True)
user_email = graphene.String(
required=False, description='Email address of the customer.')
- available_shipping_methods = graphene.List(
- ShippingMethod, required=False,
- description='Shipping methods that can be used with this order.')
class Meta:
description = 'Represents an order in the shop.'
@@ -194,6 +217,19 @@ class Order(CountableDjangoObjectType):
def resolve_shipping_price(obj, info):
return obj.shipping_price
+ def resolve_actions(obj, info):
+ actions = []
+ payment = obj.get_last_payment()
+ if obj.can_capture(payment):
+ actions.append(OrderAction.CAPTURE)
+ if obj.can_mark_as_paid():
+ actions.append(OrderAction.MARK_AS_PAID)
+ if obj.can_refund(payment):
+ actions.append(OrderAction.REFUND)
+ if obj.can_void(payment):
+ actions.append(OrderAction.VOID)
+ return actions
+
@staticmethod
def resolve_subtotal(obj, info):
return obj.get_subtotal()
@@ -217,6 +253,10 @@ class Order(CountableDjangoObjectType):
payment = obj.get_last_payment()
if payment:
return payment.captured_amount
+ @staticmethod
+ def resolve_balance_amount(obj, info):
+ return obj.balance_amount
+
@staticmethod
def resolve_fulfillments(obj, info):
diff --git a/saleor/graphql/schema.graphql b/saleor/graphql/schema.graphql
index 0bc6dee35d..869a09debb 100644
--- a/saleor/graphql/schema.graphql
+++ b/saleor/graphql/schema.graphql
@@ -964,15 +964,24 @@ type Order implements Node {
fulfillments: [Fulfillment]!
events: [OrderEvent]
payments(before: String, after: String, first: Int, last: Int, id: ID): PaymentCountableConnection
- isPaid: Boolean
+ actions: [OrderAction]!
+ availableShippingMethods: [ShippingMethod]
number: String
+ isPaid: Boolean
paymentStatus: PaymentChargeStatusEnum
paymentStatusDisplay: String
subtotal: TaxedMoney
statusDisplay: String
- totalAuthorized: Money
- totalCaptured: Money
- availableShippingMethods: [ShippingMethod]
+ authorizedAmount: Money!
+ balanceAmount: Money!
+ capturedAmount: Money!
+}
+
+enum OrderAction {
+ CAPTURE
+ MARK_AS_PAID
+ REFUND
+ VOID
}
type OrderAddNote {
diff --git a/saleor/order/models.py b/saleor/order/models.py
index 42b33310bd..c0e405bcc0 100644
--- a/saleor/order/models.py
+++ b/saleor/order/models.py
@@ -1,4 +1,3 @@
-from decimal import Decimal
from operator import attrgetter
from uuid import uuid4
@@ -13,12 +12,12 @@ from django.utils.translation import pgettext_lazy
from django_measurement.models import MeasurementField
from django_prices.models import MoneyField, TaxedMoneyField
from measurement.measures import Weight
-from prices import Money, TaxedMoney
-from . import FulfillmentStatus, OrderEvents, OrderStatus, display_order_event
+from . import (
+ CustomPaymentChoices, FulfillmentStatus, OrderEvents, OrderStatus,
+ display_order_event)
from ..account.models import Address
from ..core import zero_money
-from ..core.utils import build_absolute_uri
from ..core.utils.json_serializer import CustomJsonEncoder
from ..core.utils.taxes import ZERO_TAXED_MONEY
from ..core.weight import WeightUnits, zero_weight
@@ -178,7 +177,10 @@ class Order(models.Model):
# FIXME for Braintree, payment is preauthorized if it was added
# properly and set to active. This might need to be adjusted for other
# payment gateways in the future.
- return self.payments.filter(is_active=True).exists()
+ for payment in self.payments.all():
+ if payment.is_active:
+ return True
+ return False
@property
def quantity_fulfilled(self):
@@ -204,6 +206,58 @@ class Order(models.Model):
def can_cancel(self):
return self.status not in {OrderStatus.CANCELED, OrderStatus.DRAFT}
+ def can_capture(self, payment=None):
+ if not payment:
+ payment = self.get_last_payment()
+ if not payment:
+ return False
+ order_status_ok = self.status not in {
+ OrderStatus.DRAFT, OrderStatus.CANCELED}
+ return (
+ payment.is_active and
+ payment.charge_status == ChargeStatus.NOT_CHARGED and
+ order_status_ok)
+
+ def can_void(self, payment=None):
+ if not payment:
+ payment = self.get_last_payment()
+ if not payment:
+ return False
+ return (
+ payment.is_active and
+ payment.charge_status == ChargeStatus.NOT_CHARGED)
+
+ def can_refund(self, payment=None):
+ if not payment:
+ payment = self.get_last_payment()
+ if not payment:
+ return False
+ return (
+ payment.is_active and
+ payment.charge_status == ChargeStatus.CHARGED and
+ payment.variant != CustomPaymentChoices.MANUAL)
+
+ def can_mark_as_paid(self):
+ return len(self.payments.all()) == 0
+
+ @property
+ def authorized_amount(self):
+ payment = self.get_last_payment()
+ if payment:
+ return payment.total
+ return zero_money()
+
+ @property
+ def captured_amount(self):
+ payment = self.get_last_payment()
+ if payment and payment.charge_status == ChargeStatus.CHARGED:
+ return payment.captured_amount
+ return zero_money()
+
+ @property
+ def balance_amount(self):
+ return self.captured_amount - self.total.gross
+
def get_total_weight(self):
# Cannot use `sum` as it parses an empty Weight to an int
weights = Weight(kg=0)
diff --git a/saleor/payment/models.py b/saleor/payment/models.py
index a8fe6efa1e..d783ee0575 100644
--- a/saleor/payment/models.py
+++ b/saleor/payment/models.py
@@ -3,7 +3,7 @@ from operator import attrgetter
from django.conf import settings
from django.contrib.postgres.fields import JSONField
from django.db import models
-from django_prices.models import MoneyField, TaxedMoneyField
+from django_prices.models import MoneyField
from . import ChargeStatus, TransactionType
from ..checkout.models import Cart
@@ -68,9 +68,8 @@ class Payment(models.Model):
Order, null=True, related_name='payments', on_delete=models.PROTECT)
def __repr__(self):
- return """
- Payment(variant=%s, is_active=%s, created=%s, charge_status=%s)
- """ % (self.variant, self.is_active, self.created, self.charge_status)
+ return 'Payment(variant=%s, is_active=%s, created=%s, charge_status=%s)' % (
+ self.variant, self.is_active, self.created, self.charge_status)
def __iter__(self):
return iter(self.transactions.all())
diff --git a/saleor/static/dashboard-next/gql-types.ts b/saleor/static/dashboard-next/gql-types.ts
index 72331852f8..55057b8c5e 100644
--- a/saleor/static/dashboard-next/gql-types.ts
+++ b/saleor/static/dashboard-next/gql-types.ts
@@ -727,14 +727,14 @@ export interface OrderCancelMutation {
};
} | null;
// Amount authorized for the order.
- totalAuthorized: {
+ authorizedAmount: {
// Amount of money.
amount: number;
// Currency code.
currency: string;
} | null;
// Amount captured by payment.
- totalCaptured: {
+ capturedAmount: {
// Amount of money.
amount: number;
// Currency code.
@@ -920,14 +920,14 @@ export interface OrderRefundMutation {
};
} | null;
// Amount authorized for the order.
- totalAuthorized: {
+ authorizedAmount: {
// Amount of money.
amount: number;
// Currency code.
currency: string;
} | null;
// Amount captured by payment.
- totalCaptured: {
+ capturedAmount: {
// Amount of money.
amount: number;
// Currency code.
@@ -1103,14 +1103,14 @@ export interface OrderVoidMutation {
};
} | null;
// Amount authorized for the order.
- totalAuthorized: {
+ authorizedAmount: {
// Amount of money.
amount: number;
// Currency code.
currency: string;
} | null;
// Amount captured by payment.
- totalCaptured: {
+ capturedAmount: {
// Amount of money.
amount: number;
// Currency code.
@@ -1296,14 +1296,14 @@ export interface OrderCaptureMutation {
};
} | null;
// Amount authorized for the order.
- totalAuthorized: {
+ authorizedAmount: {
// Amount of money.
amount: number;
// Currency code.
currency: string;
} | null;
// Amount captured by payment.
- totalCaptured: {
+ capturedAmount: {
// Amount of money.
amount: number;
// Currency code.
@@ -1544,14 +1544,14 @@ export interface OrderDetailsQuery {
};
} | null;
// Amount authorized for the order.
- totalAuthorized: {
+ authorizedAmount: {
// Amount of money.
amount: number;
// Currency code.
currency: string;
} | null;
// Amount captured by payment.
- totalCaptured: {
+ capturedAmount: {
// Amount of money.
amount: number;
// Currency code.
@@ -3729,14 +3729,14 @@ export interface OrderDetailsFragment {
};
} | null;
// Amount authorized for the order.
- totalAuthorized: {
+ authorizedAmount: {
// Amount of money.
amount: number;
// Currency code.
currency: string;
} | null;
// Amount captured by payment.
- totalCaptured: {
+ capturedAmount: {
// Amount of money.
amount: number;
// Currency code.
diff --git a/saleor/static/dashboard-next/orders/components/OrderPayment/OrderPayment.tsx b/saleor/static/dashboard-next/orders/components/OrderPayment/OrderPayment.tsx
index 2002fb425a..8f40086021 100644
--- a/saleor/static/dashboard-next/orders/components/OrderPayment/OrderPayment.tsx
+++ b/saleor/static/dashboard-next/orders/components/OrderPayment/OrderPayment.tsx
@@ -13,7 +13,7 @@ import Skeleton from "../../../components/Skeleton";
import StatusLabel from "../../../components/StatusLabel";
import i18n from "../../../i18n";
import { maybe } from "../../../misc";
-import { OrderStatus, PaymentChargeStatusEnum } from "../../../types/globalTypes";
+import { OrderAction, OrderStatus } from "../../../types/globalTypes";
import { OrderDetails_order } from "../../types/OrderDetails";
interface OrderPaymentProps {
@@ -39,23 +39,18 @@ const decorate = withStyles(theme => ({
}));
const OrderPayment = decorate<OrderPaymentProps>(
({ classes, order, onCapture, onMarkAsPaid, onRefund, onVoid }) => {
- const canCapture = maybe(() => order.paymentStatus)
- ? order.paymentStatus === PaymentChargeStatusEnum.PREAUTH &&
- order.status !== OrderStatus.CANCELED
+ const canCapture = maybe(() => order.actions)
+ ? order.actions.includes(OrderAction.CAPTURE)
: false;
- const canVoid = maybe(() => order.paymentStatus)
- ? order.paymentStatus === PaymentChargeStatusEnum.PREAUTH
+ const canVoid = maybe(() => order.actions)
+ ? order.actions.includes(OrderAction.VOID)
: false;
- const canRefund = maybe(() => order.paymentStatus)
- ? order.paymentStatus === PaymentChargeStatusEnum.CONFIRMED &&
- order.status !== OrderStatus.CANCELED
+ const canRefund = maybe(() => order.actions)
+ ? order.actions.includes(OrderAction.REFUND)
+ : false;
+ const canMarkAsPaid = maybe(() => order.actions)
+ ? order.actions.includes(OrderAction.MARK_AS_PAID)
: false;
- const canMarkAsPaid =
- maybe(() => order.paymentStatus) !== undefined
- ? [null, PaymentChargeStatusEnum.ERROR, PaymentChargeStatusEnum.REJECTED].includes(
- order.paymentStatus
- )
- : false;
const payment = transformPaymentStatus(maybe(() => order.paymentStatus));
return (
<Card>
diff --git a/saleor/static/dashboard-next/orders/components/OrderPaymentReleaseDialog/OrderPaymentVoidDialog.tsx b/saleor/static/dashboard-next/orders/components/OrderPaymentVoidDialog/OrderPaymentVoidDialog.tsx
similarity index 100%
rename from saleor/static/dashboard-next/orders/components/OrderPaymentReleaseDialog/OrderPaymentVoidDialog.tsx
rename to saleor/static/dashboard-next/orders/components/OrderPaymentVoidDialog/OrderPaymentVoidDialog.tsx
diff --git a/saleor/static/dashboard-next/orders/components/OrderPaymentReleaseDialog/index.ts b/saleor/static/dashboard-next/orders/components/OrderPaymentVoidDialog/index.ts
similarity index 100%
rename from saleor/static/dashboard-next/orders/components/OrderPaymentReleaseDialog/index.ts
rename to saleor/static/dashboard-next/orders/components/OrderPaymentVoidDialog/index.ts
diff --git a/saleor/static/dashboard-next/orders/fixtures.ts b/saleor/static/dashboard-next/orders/fixtures.ts
index 8d615f8168..0458c94d60 100644
--- a/saleor/static/dashboard-next/orders/fixtures.ts
+++ b/saleor/static/dashboard-next/orders/fixtures.ts
@@ -2,7 +2,8 @@ import {
FulfillmentStatus,
OrderEvents,
OrderStatus,
- PaymentChargeStatusEnum
+ PaymentChargeStatusEnum,
+ OrderAction
} from "../types/globalTypes";
import { transformOrderStatus, transformPaymentStatus } from "./";
import { OrderDetails_order } from "./types/OrderDetails";
@@ -56,7 +57,7 @@ export const orders: OrderList_orders_edges_node[] = [
created: "2018-09-11T09:37:30.376876+00:00",
id: "T3JkZXI6MjA=",
number: "20",
- paymentStatus: PaymentChargeStatusEnum.CONFIRMED,
+ paymentStatus: PaymentChargeStatusEnum.CHARGED,
status: OrderStatus.CANCELED,
total: {
__typename: "TaxedMoney",
@@ -92,7 +93,7 @@ export const orders: OrderList_orders_edges_node[] = [
created: "2018-09-11T09:37:30.124154+00:00",
id: "T3JkZXI6MTk=",
number: "19",
- paymentStatus: PaymentChargeStatusEnum.CONFIRMED,
+ paymentStatus: PaymentChargeStatusEnum.CHARGED,
status: OrderStatus.CANCELED,
total: {
__typename: "TaxedMoney",
@@ -110,7 +111,7 @@ export const orders: OrderList_orders_edges_node[] = [
created: "2018-09-11T09:37:30.019749+00:00",
id: "T3JkZXI6MTg=",
number: "18",
- paymentStatus: PaymentChargeStatusEnum.PREAUTH,
+ paymentStatus: PaymentChargeStatusEnum.NOT_CHARGED,
status: OrderStatus.DRAFT,
total: {
__typename: "TaxedMoney",
@@ -146,7 +147,7 @@ export const orders: OrderList_orders_edges_node[] = [
created: "2018-09-11T09:37:29.864391+00:00",
id: "T3JkZXI6MTc=",
number: "17",
- paymentStatus: PaymentChargeStatusEnum.PREAUTH,
+ paymentStatus: PaymentChargeStatusEnum.NOT_CHARGED,
status: OrderStatus.CANCELED,
total: {
__typename: "TaxedMoney",
@@ -182,7 +183,7 @@ export const orders: OrderList_orders_edges_node[] = [
created: "2018-09-11T09:37:29.610339+00:00",
id: "T3JkZXI6MTY=",
number: "16",
- paymentStatus: PaymentChargeStatusEnum.PREAUTH,
+ paymentStatus: PaymentChargeStatusEnum.NOT_CHARGED,
status: OrderStatus.CANCELED,
total: {
__typename: "TaxedMoney",
@@ -218,7 +219,7 @@ export const orders: OrderList_orders_edges_node[] = [
created: "2018-09-11T09:37:29.336209+00:00",
id: "T3JkZXI6MTU=",
number: "15",
- paymentStatus: PaymentChargeStatusEnum.REJECTED,
+ paymentStatus: PaymentChargeStatusEnum.NOT_CHARGED,
status: OrderStatus.CANCELED,
total: {
__typename: "TaxedMoney",
@@ -254,7 +255,7 @@ export const orders: OrderList_orders_edges_node[] = [
created: "2018-09-11T09:37:29.103651+00:00",
id: "T3JkZXI6MTQ=",
number: "14",
- paymentStatus: PaymentChargeStatusEnum.WAITING,
+ paymentStatus: PaymentChargeStatusEnum.NOT_CHARGED,
status: OrderStatus.CANCELED,
total: {
__typename: "TaxedMoney",
@@ -290,7 +291,7 @@ export const orders: OrderList_orders_edges_node[] = [
created: "2018-09-11T09:37:28.921956+00:00",
id: "T3JkZXI6MTM=",
number: "13",
- paymentStatus: PaymentChargeStatusEnum.WAITING,
+ paymentStatus: PaymentChargeStatusEnum.NOT_CHARGED,
status: OrderStatus.CANCELED,
total: {
__typename: "TaxedMoney",
@@ -326,7 +327,7 @@ export const orders: OrderList_orders_edges_node[] = [
created: "2018-09-11T09:37:28.750718+00:00",
id: "T3JkZXI6MTI=",
number: "12",
- paymentStatus: PaymentChargeStatusEnum.PREAUTH,
+ paymentStatus: PaymentChargeStatusEnum.NOT_CHARGED,
status: OrderStatus.CANCELED,
total: {
__typename: "TaxedMoney",
@@ -362,7 +363,7 @@ export const orders: OrderList_orders_edges_node[] = [
created: "2018-09-11T09:37:28.598246+00:00",
id: "T3JkZXI6MTE=",
number: "11",
- paymentStatus: PaymentChargeStatusEnum.CONFIRMED,
+ paymentStatus: PaymentChargeStatusEnum.CHARGED,
status: OrderStatus.UNFULFILLED,
total: {
__typename: "TaxedMoney",
@@ -398,7 +399,7 @@ export const orders: OrderList_orders_edges_node[] = [
created: "2018-09-11T09:37:28.409836+00:00",
id: "T3JkZXI6MTA=",
number: "10",
- paymentStatus: PaymentChargeStatusEnum.PREAUTH,
+ paymentStatus: PaymentChargeStatusEnum.NOT_CHARGED,
status: OrderStatus.CANCELED,
total: {
__typename: "TaxedMoney",
@@ -434,7 +435,7 @@ export const orders: OrderList_orders_edges_node[] = [
created: "2018-09-11T09:37:28.185874+00:00",
id: "T3JkZXI6OQ==",
number: "9",
- paymentStatus: PaymentChargeStatusEnum.PREAUTH,
+ paymentStatus: PaymentChargeStatusEnum.NOT_CHARGED,
status: OrderStatus.PARTIALLY_FULFILLED,
total: {
__typename: "TaxedMoney",
@@ -470,7 +471,7 @@ export const orders: OrderList_orders_edges_node[] = [
created: "2018-09-11T09:37:27.953588+00:00",
id: "T3JkZXI6OA==",
number: "8",
- paymentStatus: PaymentChargeStatusEnum.WAITING,
+ paymentStatus: PaymentChargeStatusEnum.NOT_CHARGED,
status: OrderStatus.PARTIALLY_FULFILLED,
total: {
__typename: "TaxedMoney",
@@ -506,7 +507,7 @@ export const orders: OrderList_orders_edges_node[] = [
created: "2018-09-11T09:37:27.828033+00:00",
id: "T3JkZXI6Nw==",
number: "7",
- paymentStatus: PaymentChargeStatusEnum.CONFIRMED,
+ paymentStatus: PaymentChargeStatusEnum.CHARGED,
status: OrderStatus.PARTIALLY_FULFILLED,
total: {
__typename: "TaxedMoney",
@@ -542,7 +543,7 @@ export const orders: OrderList_orders_edges_node[] = [
created: "2018-09-11T09:37:27.636741+00:00",
id: "T3JkZXI6Ng==",
number: "6",
- paymentStatus: PaymentChargeStatusEnum.WAITING,
+ paymentStatus: PaymentChargeStatusEnum.NOT_CHARGED,
status: OrderStatus.FULFILLED,
total: {
__typename: "TaxedMoney",
@@ -578,7 +579,7 @@ export const orders: OrderList_orders_edges_node[] = [
created: "2018-09-11T09:37:27.420590+00:00",
id: "T3JkZXI6NQ==",
number: "5",
- paymentStatus: PaymentChargeStatusEnum.WAITING,
+ paymentStatus: PaymentChargeStatusEnum.NOT_CHARGED,
status: OrderStatus.PARTIALLY_FULFILLED,
total: {
__typename: "TaxedMoney",
@@ -614,7 +615,7 @@ export const orders: OrderList_orders_edges_node[] = [
created: "2018-09-11T09:37:27.230990+00:00",
id: "T3JkZXI6NA==",
number: "4",
- paymentStatus: PaymentChargeStatusEnum.WAITING,
+ paymentStatus: PaymentChargeStatusEnum.NOT_CHARGED,
status: OrderStatus.PARTIALLY_FULFILLED,
total: {
__typename: "TaxedMoney",
@@ -650,7 +651,7 @@ export const orders: OrderList_orders_edges_node[] = [
created: "2018-09-11T09:37:26.972507+00:00",
id: "T3JkZXI6Mw==",
number: "3",
- paymentStatus: PaymentChargeStatusEnum.WAITING,
+ paymentStatus: PaymentChargeStatusEnum.NOT_CHARGED,
status: OrderStatus.PARTIALLY_FULFILLED,
total: {
__typename: "TaxedMoney",
@@ -686,7 +687,7 @@ export const orders: OrderList_orders_edges_node[] = [
created: "2018-09-11T09:37:26.751359+00:00",
id: "T3JkZXI6Mg==",
number: "2",
- paymentStatus: PaymentChargeStatusEnum.CONFIRMED,
+ paymentStatus: PaymentChargeStatusEnum.CHARGED,
status: OrderStatus.PARTIALLY_FULFILLED,
total: {
__typename: "TaxedMoney",
@@ -722,7 +723,7 @@ export const orders: OrderList_orders_edges_node[] = [
created: "2018-09-11T09:37:26.314968+00:00",
id: "T3JkZXI6MQ==",
number: "1",
- paymentStatus: PaymentChargeStatusEnum.WAITING,
+ paymentStatus: PaymentChargeStatusEnum.CHARGED,
status: OrderStatus.PARTIALLY_FULFILLED,
total: {
__typename: "TaxedMoney",
@@ -737,6 +738,17 @@ export const orders: OrderList_orders_edges_node[] = [
];
export const order = (placeholder: string): OrderDetails_order => ({
__typename: "Order",
+ actions: [
+ OrderAction.CAPTURE,
+ OrderAction.MARK_AS_PAID,
+ OrderAction.REFUND,
+ OrderAction.VOID
+ ],
+ authorizedAmount: {
+ __typename: "Money",
+ amount: 234.93,
+ currency: "USD"
+ },
availableShippingMethods: [
{
__typename: "ShippingMethod",
@@ -788,6 +800,11 @@ export const order = (placeholder: string): OrderDetails_order => ({
streetAddress1: "487 Roberto Shores",
streetAddress2: ""
},
+ capturedAmount: {
+ __typename: "Money",
+ amount: 0,
+ currency: "USD"
+ },
created: "2018-09-11T09:37:28.185874+00:00",
events: [
{
@@ -940,7 +957,7 @@ export const order = (placeholder: string): OrderDetails_order => ({
}
],
number: "9",
- paymentStatus: PaymentChargeStatusEnum.PREAUTH,
+ paymentStatus: PaymentChargeStatusEnum.NOT_CHARGED,
shippingAddress: {
__typename: "Address",
city: "West Patriciastad",
@@ -992,23 +1009,15 @@ export const order = (placeholder: string): OrderDetails_order => ({
currency: "USD"
}
},
- totalAuthorized: {
- __typename: "Money",
- amount: 234.93,
- currency: "USD"
- },
- totalCaptured: {
- __typename: "Money",
- amount: 0,
- currency: "USD"
- },
user: null,
userEmail: "[email protected]"
});
export const draftOrder = (placeholder: string) => ({
__typename: "Order" as "Order",
+ authorizedAmount: null,
availableShippingMethods: null,
billingAddress: null,
+ capturedAmount: null,
created: "2018-09-20T23:23:39.811428+00:00",
events: [],
fulfillments: [],
@@ -1094,8 +1103,6 @@ export const draftOrder = (placeholder: string) => ({
currency: "USD"
}
},
- totalAuthorized: null,
- totalCaptured: null,
user: null,
userEmail: null
});
diff --git a/saleor/static/dashboard-next/orders/index.tsx b/saleor/static/dashboard-next/orders/index.tsx
index d0990c1f7a..9dc42f8716 100644
--- a/saleor/static/dashboard-next/orders/index.tsx
+++ b/saleor/static/dashboard-next/orders/index.tsx
@@ -52,23 +52,10 @@ export interface AddressType {
export const transformPaymentStatus = (status: string) => {
switch (status) {
- case PaymentChargeStatusEnum.CONFIRMED:
+ case PaymentChargeStatusEnum.CHARGED:
return { localized: i18n.t("Paid"), status: "success" };
- case PaymentChargeStatusEnum.REFUNDED:
+ case PaymentChargeStatusEnum.FULLY_REFUNDED:
return { localized: i18n.t("Refunded"), status: "success" };
- case PaymentChargeStatusEnum.WAITING:
- return {
- localized: i18n.t("Pending"),
- status: "neutral"
- };
- case PaymentChargeStatusEnum.PREAUTH:
- return { localized: i18n.t("Pending"), status: "neutral" };
- case PaymentChargeStatusEnum.INPUT:
- return { localized: i18n.t("Pending"), status: "neutral" };
- case PaymentChargeStatusEnum.REJECTED:
- return { localized: i18n.t("Unpaid"), status: "error" };
- case PaymentChargeStatusEnum.ERROR:
- return { localized: i18n.t("Unpaid"), status: "error" };
default:
return { localized: i18n.t("Unpaid"), status: "error" };
}
diff --git a/saleor/static/dashboard-next/orders/queries.ts b/saleor/static/dashboard-next/orders/queries.ts
index 84c8b403ca..7058bfc2b2 100644
--- a/saleor/static/dashboard-next/orders/queries.ts
+++ b/saleor/static/dashboard-next/orders/queries.ts
@@ -130,11 +130,12 @@ export const fragmentOrderDetails = gql`
currency
}
}
- totalAuthorized {
+ actions
+ authorizedAmount {
amount
currency
}
- totalCaptured {
+ capturedAmount {
amount
currency
}
diff --git a/saleor/static/dashboard-next/orders/types/OrderCancel.ts b/saleor/static/dashboard-next/orders/types/OrderCancel.ts
index ae7613007e..a0fb083b99 100644
--- a/saleor/static/dashboard-next/orders/types/OrderCancel.ts
+++ b/saleor/static/dashboard-next/orders/types/OrderCancel.ts
@@ -1,7 +1,7 @@
/* tslint:disable */
// This file was automatically generated and should not be edited.
-import { OrderEventsEmails, OrderEvents, FulfillmentStatus, PaymentChargeStatusEnum, OrderStatus } from "./../../types/globalTypes";
+import { OrderEventsEmails, OrderEvents, FulfillmentStatus, PaymentChargeStatusEnum, OrderStatus, OrderAction } from "./../../types/globalTypes";
// ====================================================
// GraphQL mutation operation: OrderCancel
@@ -198,13 +198,13 @@ export interface OrderCancel_orderCancel_order_total {
tax: OrderCancel_orderCancel_order_total_tax;
}
-export interface OrderCancel_orderCancel_order_totalAuthorized {
+export interface OrderCancel_orderCancel_order_authorizedAmount {
__typename: "Money";
amount: number;
currency: string;
}
-export interface OrderCancel_orderCancel_order_totalCaptured {
+export interface OrderCancel_orderCancel_order_capturedAmount {
__typename: "Money";
amount: number;
currency: string;
@@ -246,8 +246,9 @@ export interface OrderCancel_orderCancel_order {
status: OrderStatus;
subtotal: OrderCancel_orderCancel_order_subtotal | null;
total: OrderCancel_orderCancel_order_total | null;
- totalAuthorized: OrderCancel_orderCancel_order_totalAuthorized | null;
- totalCaptured: OrderCancel_orderCancel_order_totalCaptured | null;
+ actions: (OrderAction | null)[];
+ authorizedAmount: OrderCancel_orderCancel_order_authorizedAmount;
+ capturedAmount: OrderCancel_orderCancel_order_capturedAmount;
user: OrderCancel_orderCancel_order_user | null;
userEmail: string | null;
availableShippingMethods: (OrderCancel_orderCancel_order_availableShippingMethods | null)[] | null;
diff --git a/saleor/static/dashboard-next/orders/types/OrderCapture.ts b/saleor/static/dashboard-next/orders/types/OrderCapture.ts
index c740180b87..0cd4053bf3 100644
--- a/saleor/static/dashboard-next/orders/types/OrderCapture.ts
+++ b/saleor/static/dashboard-next/orders/types/OrderCapture.ts
@@ -1,7 +1,7 @@
/* tslint:disable */
// This file was automatically generated and should not be edited.
-import { OrderEventsEmails, OrderEvents, FulfillmentStatus, PaymentChargeStatusEnum, OrderStatus } from "./../../types/globalTypes";
+import { OrderEventsEmails, OrderEvents, FulfillmentStatus, PaymentChargeStatusEnum, OrderStatus, OrderAction } from "./../../types/globalTypes";
// ====================================================
// GraphQL mutation operation: OrderCapture
@@ -204,13 +204,13 @@ export interface OrderCapture_orderCapture_order_total {
tax: OrderCapture_orderCapture_order_total_tax;
}
-export interface OrderCapture_orderCapture_order_totalAuthorized {
+export interface OrderCapture_orderCapture_order_authorizedAmount {
__typename: "Money";
amount: number;
currency: string;
}
-export interface OrderCapture_orderCapture_order_totalCaptured {
+export interface OrderCapture_orderCapture_order_capturedAmount {
__typename: "Money";
amount: number;
currency: string;
@@ -252,8 +252,9 @@ export interface OrderCapture_orderCapture_order {
status: OrderStatus;
subtotal: OrderCapture_orderCapture_order_subtotal | null;
total: OrderCapture_orderCapture_order_total | null;
- totalAuthorized: OrderCapture_orderCapture_order_totalAuthorized | null;
- totalCaptured: OrderCapture_orderCapture_order_totalCaptured | null;
+ actions: (OrderAction | null)[];
+ authorizedAmount: OrderCapture_orderCapture_order_authorizedAmount;
+ capturedAmount: OrderCapture_orderCapture_order_capturedAmount;
user: OrderCapture_orderCapture_order_user | null;
userEmail: string | null;
availableShippingMethods: (OrderCapture_orderCapture_order_availableShippingMethods | null)[] | null;
diff --git a/saleor/static/dashboard-next/orders/types/OrderCreateFulfillment.ts b/saleor/static/dashboard-next/orders/types/OrderCreateFulfillment.ts
index 81c910fd36..dc8dde84d5 100644
--- a/saleor/static/dashboard-next/orders/types/OrderCreateFulfillment.ts
+++ b/saleor/static/dashboard-next/orders/types/OrderCreateFulfillment.ts
@@ -1,7 +1,7 @@
/* tslint:disable */
// This file was automatically generated and should not be edited.
-import { FulfillmentCreateInput, OrderEventsEmails, OrderEvents, FulfillmentStatus, PaymentChargeStatusEnum, OrderStatus } from "./../../types/globalTypes";
+import { FulfillmentCreateInput, OrderEventsEmails, OrderEvents, FulfillmentStatus, PaymentChargeStatusEnum, OrderStatus, OrderAction } from "./../../types/globalTypes";
// ====================================================
// GraphQL mutation operation: OrderCreateFulfillment
@@ -204,13 +204,13 @@ export interface OrderCreateFulfillment_orderFulfillmentCreate_order_total {
tax: OrderCreateFulfillment_orderFulfillmentCreate_order_total_tax;
}
-export interface OrderCreateFulfillment_orderFulfillmentCreate_order_totalAuthorized {
+export interface OrderCreateFulfillment_orderFulfillmentCreate_order_authorizedAmount {
__typename: "Money";
amount: number;
currency: string;
}
-export interface OrderCreateFulfillment_orderFulfillmentCreate_order_totalCaptured {
+export interface OrderCreateFulfillment_orderFulfillmentCreate_order_capturedAmount {
__typename: "Money";
amount: number;
currency: string;
@@ -252,8 +252,9 @@ export interface OrderCreateFulfillment_orderFulfillmentCreate_order {
status: OrderStatus;
subtotal: OrderCreateFulfillment_orderFulfillmentCreate_order_subtotal | null;
total: OrderCreateFulfillment_orderFulfillmentCreate_order_total | null;
- totalAuthorized: OrderCreateFulfillment_orderFulfillmentCreate_order_totalAuthorized | null;
- totalCaptured: OrderCreateFulfillment_orderFulfillmentCreate_order_totalCaptured | null;
+ actions: (OrderAction | null)[];
+ authorizedAmount: OrderCreateFulfillment_orderFulfillmentCreate_order_authorizedAmount;
+ capturedAmount: OrderCreateFulfillment_orderFulfillmentCreate_order_capturedAmount;
user: OrderCreateFulfillment_orderFulfillmentCreate_order_user | null;
userEmail: string | null;
availableShippingMethods: (OrderCreateFulfillment_orderFulfillmentCreate_order_availableShippingMethods | null)[] | null;
diff --git a/saleor/static/dashboard-next/orders/types/OrderDetails.ts b/saleor/static/dashboard-next/orders/types/OrderDetails.ts
index b28aac1e37..5566010389 100644
--- a/saleor/static/dashboard-next/orders/types/OrderDetails.ts
+++ b/saleor/static/dashboard-next/orders/types/OrderDetails.ts
@@ -1,7 +1,7 @@
/* tslint:disable */
// This file was automatically generated and should not be edited.
-import { OrderEventsEmails, OrderEvents, FulfillmentStatus, PaymentChargeStatusEnum, OrderStatus, WeightUnitsEnum } from "./../../types/globalTypes";
+import { OrderEventsEmails, OrderEvents, FulfillmentStatus, PaymentChargeStatusEnum, OrderStatus, OrderAction, WeightUnitsEnum } from "./../../types/globalTypes";
// ====================================================
// GraphQL query operation: OrderDetails
@@ -198,13 +198,13 @@ export interface OrderDetails_order_total {
tax: OrderDetails_order_total_tax;
}
-export interface OrderDetails_order_totalAuthorized {
+export interface OrderDetails_order_authorizedAmount {
__typename: "Money";
amount: number;
currency: string;
}
-export interface OrderDetails_order_totalCaptured {
+export interface OrderDetails_order_capturedAmount {
__typename: "Money";
amount: number;
currency: string;
@@ -246,8 +246,9 @@ export interface OrderDetails_order {
status: OrderStatus;
subtotal: OrderDetails_order_subtotal | null;
total: OrderDetails_order_total | null;
- totalAuthorized: OrderDetails_order_totalAuthorized | null;
- totalCaptured: OrderDetails_order_totalCaptured | null;
+ actions: (OrderAction | null)[];
+ authorizedAmount: OrderDetails_order_authorizedAmount;
+ capturedAmount: OrderDetails_order_capturedAmount;
user: OrderDetails_order_user | null;
userEmail: string | null;
availableShippingMethods: (OrderDetails_order_availableShippingMethods | null)[] | null;
diff --git a/saleor/static/dashboard-next/orders/types/OrderDetailsFragment.ts b/saleor/static/dashboard-next/orders/types/OrderDetailsFragment.ts
index 104ce4682b..3f7885e17a 100644
--- a/saleor/static/dashboard-next/orders/types/OrderDetailsFragment.ts
+++ b/saleor/static/dashboard-next/orders/types/OrderDetailsFragment.ts
@@ -1,7 +1,7 @@
/* tslint:disable */
// This file was automatically generated and should not be edited.
-import { OrderEventsEmails, OrderEvents, FulfillmentStatus, PaymentChargeStatusEnum, OrderStatus } from "./../../types/globalTypes";
+import { OrderEventsEmails, OrderEvents, FulfillmentStatus, PaymentChargeStatusEnum, OrderStatus, OrderAction } from "./../../types/globalTypes";
// ====================================================
// GraphQL fragment: OrderDetailsFragment
@@ -198,13 +198,13 @@ export interface OrderDetailsFragment_total {
tax: OrderDetailsFragment_total_tax;
}
-export interface OrderDetailsFragment_totalAuthorized {
+export interface OrderDetailsFragment_authorizedAmount {
__typename: "Money";
amount: number;
currency: string;
}
-export interface OrderDetailsFragment_totalCaptured {
+export interface OrderDetailsFragment_capturedAmount {
__typename: "Money";
amount: number;
currency: string;
@@ -246,8 +246,9 @@ export interface OrderDetailsFragment {
status: OrderStatus;
subtotal: OrderDetailsFragment_subtotal | null;
total: OrderDetailsFragment_total | null;
- totalAuthorized: OrderDetailsFragment_totalAuthorized | null;
- totalCaptured: OrderDetailsFragment_totalCaptured | null;
+ actions: (OrderAction | null)[];
+ authorizedAmount: OrderDetailsFragment_authorizedAmount;
+ capturedAmount: OrderDetailsFragment_capturedAmount;
user: OrderDetailsFragment_user | null;
userEmail: string | null;
availableShippingMethods: (OrderDetailsFragment_availableShippingMethods | null)[] | null;
diff --git a/saleor/static/dashboard-next/orders/types/OrderDraftCancel.ts b/saleor/static/dashboard-next/orders/types/OrderDraftCancel.ts
index ea57862416..2b2942324c 100644
--- a/saleor/static/dashboard-next/orders/types/OrderDraftCancel.ts
+++ b/saleor/static/dashboard-next/orders/types/OrderDraftCancel.ts
@@ -1,7 +1,7 @@
/* tslint:disable */
// This file was automatically generated and should not be edited.
-import { OrderEventsEmails, OrderEvents, FulfillmentStatus, PaymentChargeStatusEnum, OrderStatus } from "./../../types/globalTypes";
+import { OrderEventsEmails, OrderEvents, FulfillmentStatus, PaymentChargeStatusEnum, OrderStatus, OrderAction } from "./../../types/globalTypes";
// ====================================================
// GraphQL mutation operation: OrderDraftCancel
@@ -198,13 +198,13 @@ export interface OrderDraftCancel_draftOrderDelete_order_total {
tax: OrderDraftCancel_draftOrderDelete_order_total_tax;
}
-export interface OrderDraftCancel_draftOrderDelete_order_totalAuthorized {
+export interface OrderDraftCancel_draftOrderDelete_order_authorizedAmount {
__typename: "Money";
amount: number;
currency: string;
}
-export interface OrderDraftCancel_draftOrderDelete_order_totalCaptured {
+export interface OrderDraftCancel_draftOrderDelete_order_capturedAmount {
__typename: "Money";
amount: number;
currency: string;
@@ -246,8 +246,9 @@ export interface OrderDraftCancel_draftOrderDelete_order {
status: OrderStatus;
subtotal: OrderDraftCancel_draftOrderDelete_order_subtotal | null;
total: OrderDraftCancel_draftOrderDelete_order_total | null;
- totalAuthorized: OrderDraftCancel_draftOrderDelete_order_totalAuthorized | null;
- totalCaptured: OrderDraftCancel_draftOrderDelete_order_totalCaptured | null;
+ actions: (OrderAction | null)[];
+ authorizedAmount: OrderDraftCancel_draftOrderDelete_order_authorizedAmount;
+ capturedAmount: OrderDraftCancel_draftOrderDelete_order_capturedAmount;
user: OrderDraftCancel_draftOrderDelete_order_user | null;
userEmail: string | null;
availableShippingMethods: (OrderDraftCancel_draftOrderDelete_order_availableShippingMethods | null)[] | null;
diff --git a/saleor/static/dashboard-next/orders/types/OrderDraftFinalize.ts b/saleor/static/dashboard-next/orders/types/OrderDraftFinalize.ts
index 45d5fdbad6..b63a06373e 100644
--- a/saleor/static/dashboard-next/orders/types/OrderDraftFinalize.ts
+++ b/saleor/static/dashboard-next/orders/types/OrderDraftFinalize.ts
@@ -1,7 +1,7 @@
/* tslint:disable */
// This file was automatically generated and should not be edited.
-import { OrderEventsEmails, OrderEvents, FulfillmentStatus, PaymentChargeStatusEnum, OrderStatus } from "./../../types/globalTypes";
+import { OrderEventsEmails, OrderEvents, FulfillmentStatus, PaymentChargeStatusEnum, OrderStatus, OrderAction } from "./../../types/globalTypes";
// ====================================================
// GraphQL mutation operation: OrderDraftFinalize
@@ -204,13 +204,13 @@ export interface OrderDraftFinalize_draftOrderComplete_order_total {
tax: OrderDraftFinalize_draftOrderComplete_order_total_tax;
}
-export interface OrderDraftFinalize_draftOrderComplete_order_totalAuthorized {
+export interface OrderDraftFinalize_draftOrderComplete_order_authorizedAmount {
__typename: "Money";
amount: number;
currency: string;
}
-export interface OrderDraftFinalize_draftOrderComplete_order_totalCaptured {
+export interface OrderDraftFinalize_draftOrderComplete_order_capturedAmount {
__typename: "Money";
amount: number;
currency: string;
@@ -252,8 +252,9 @@ export interface OrderDraftFinalize_draftOrderComplete_order {
status: OrderStatus;
subtotal: OrderDraftFinalize_draftOrderComplete_order_subtotal | null;
total: OrderDraftFinalize_draftOrderComplete_order_total | null;
- totalAuthorized: OrderDraftFinalize_draftOrderComplete_order_totalAuthorized | null;
- totalCaptured: OrderDraftFinalize_draftOrderComplete_order_totalCaptured | null;
+ actions: (OrderAction | null)[];
+ authorizedAmount: OrderDraftFinalize_draftOrderComplete_order_authorizedAmount;
+ capturedAmount: OrderDraftFinalize_draftOrderComplete_order_capturedAmount;
user: OrderDraftFinalize_draftOrderComplete_order_user | null;
userEmail: string | null;
availableShippingMethods: (OrderDraftFinalize_draftOrderComplete_order_availableShippingMethods | null)[] | null;
diff --git a/saleor/static/dashboard-next/orders/types/OrderDraftUpdate.ts b/saleor/static/dashboard-next/orders/types/OrderDraftUpdate.ts
index f804b0346a..33c5a3dfa1 100644
--- a/saleor/static/dashboard-next/orders/types/OrderDraftUpdate.ts
+++ b/saleor/static/dashboard-next/orders/types/OrderDraftUpdate.ts
@@ -1,7 +1,7 @@
/* tslint:disable */
// This file was automatically generated and should not be edited.
-import { DraftOrderInput, OrderEventsEmails, OrderEvents, FulfillmentStatus, PaymentChargeStatusEnum, OrderStatus } from "./../../types/globalTypes";
+import { DraftOrderInput, OrderEventsEmails, OrderEvents, FulfillmentStatus, PaymentChargeStatusEnum, OrderStatus, OrderAction } from "./../../types/globalTypes";
// ====================================================
// GraphQL mutation operation: OrderDraftUpdate
@@ -204,13 +204,13 @@ export interface OrderDraftUpdate_draftOrderUpdate_order_total {
tax: OrderDraftUpdate_draftOrderUpdate_order_total_tax;
}
-export interface OrderDraftUpdate_draftOrderUpdate_order_totalAuthorized {
+export interface OrderDraftUpdate_draftOrderUpdate_order_authorizedAmount {
__typename: "Money";
amount: number;
currency: string;
}
-export interface OrderDraftUpdate_draftOrderUpdate_order_totalCaptured {
+export interface OrderDraftUpdate_draftOrderUpdate_order_capturedAmount {
__typename: "Money";
amount: number;
currency: string;
@@ -252,8 +252,9 @@ export interface OrderDraftUpdate_draftOrderUpdate_order {
status: OrderStatus;
subtotal: OrderDraftUpdate_draftOrderUpdate_order_subtotal | null;
total: OrderDraftUpdate_draftOrderUpdate_order_total | null;
- totalAuthorized: OrderDraftUpdate_draftOrderUpdate_order_totalAuthorized | null;
- totalCaptured: OrderDraftUpdate_draftOrderUpdate_order_totalCaptured | null;
+ actions: (OrderAction | null)[];
+ authorizedAmount: OrderDraftUpdate_draftOrderUpdate_order_authorizedAmount;
+ capturedAmount: OrderDraftUpdate_draftOrderUpdate_order_capturedAmount;
user: OrderDraftUpdate_draftOrderUpdate_order_user | null;
userEmail: string | null;
availableShippingMethods: (OrderDraftUpdate_draftOrderUpdate_order_availableShippingMethods | null)[] | null;
diff --git a/saleor/static/dashboard-next/orders/types/OrderFulfillmentCancel.ts b/saleor/static/dashboard-next/orders/types/OrderFulfillmentCancel.ts
index d61c76e4e8..64438e5119 100644
--- a/saleor/static/dashboard-next/orders/types/OrderFulfillmentCancel.ts
+++ b/saleor/static/dashboard-next/orders/types/OrderFulfillmentCancel.ts
@@ -1,7 +1,7 @@
/* tslint:disable */
// This file was automatically generated and should not be edited.
-import { FulfillmentCancelInput, OrderEventsEmails, OrderEvents, FulfillmentStatus, PaymentChargeStatusEnum, OrderStatus } from "./../../types/globalTypes";
+import { FulfillmentCancelInput, OrderEventsEmails, OrderEvents, FulfillmentStatus, PaymentChargeStatusEnum, OrderStatus, OrderAction } from "./../../types/globalTypes";
// ====================================================
// GraphQL mutation operation: OrderFulfillmentCancel
@@ -204,13 +204,13 @@ export interface OrderFulfillmentCancel_orderFulfillmentCancel_order_total {
tax: OrderFulfillmentCancel_orderFulfillmentCancel_order_total_tax;
}
-export interface OrderFulfillmentCancel_orderFulfillmentCancel_order_totalAuthorized {
+export interface OrderFulfillmentCancel_orderFulfillmentCancel_order_authorizedAmount {
__typename: "Money";
amount: number;
currency: string;
}
-export interface OrderFulfillmentCancel_orderFulfillmentCancel_order_totalCaptured {
+export interface OrderFulfillmentCancel_orderFulfillmentCancel_order_capturedAmount {
__typename: "Money";
amount: number;
currency: string;
@@ -252,8 +252,9 @@ export interface OrderFulfillmentCancel_orderFulfillmentCancel_order {
status: OrderStatus;
subtotal: OrderFulfillmentCancel_orderFulfillmentCancel_order_subtotal | null;
total: OrderFulfillmentCancel_orderFulfillmentCancel_order_total | null;
- totalAuthorized: OrderFulfillmentCancel_orderFulfillmentCancel_order_totalAuthorized | null;
- totalCaptured: OrderFulfillmentCancel_orderFulfillmentCancel_order_totalCaptured | null;
+ actions: (OrderAction | null)[];
+ authorizedAmount: OrderFulfillmentCancel_orderFulfillmentCancel_order_authorizedAmount;
+ capturedAmount: OrderFulfillmentCancel_orderFulfillmentCancel_order_capturedAmount;
user: OrderFulfillmentCancel_orderFulfillmentCancel_order_user | null;
userEmail: string | null;
availableShippingMethods: (OrderFulfillmentCancel_orderFulfillmentCancel_order_availableShippingMethods | null)[] | null;
diff --git a/saleor/static/dashboard-next/orders/types/OrderFulfillmentUpdateTracking.ts b/saleor/static/dashboard-next/orders/types/OrderFulfillmentUpdateTracking.ts
index 8748115113..ae06852746 100644
--- a/saleor/static/dashboard-next/orders/types/OrderFulfillmentUpdateTracking.ts
+++ b/saleor/static/dashboard-next/orders/types/OrderFulfillmentUpdateTracking.ts
@@ -1,7 +1,7 @@
/* tslint:disable */
// This file was automatically generated and should not be edited.
-import { FulfillmentUpdateTrackingInput, OrderEventsEmails, OrderEvents, FulfillmentStatus, PaymentChargeStatusEnum, OrderStatus } from "./../../types/globalTypes";
+import { FulfillmentUpdateTrackingInput, OrderEventsEmails, OrderEvents, FulfillmentStatus, PaymentChargeStatusEnum, OrderStatus, OrderAction } from "./../../types/globalTypes";
// ====================================================
// GraphQL mutation operation: OrderFulfillmentUpdateTracking
@@ -204,13 +204,13 @@ export interface OrderFulfillmentUpdateTracking_orderFulfillmentUpdateTracking_o
tax: OrderFulfillmentUpdateTracking_orderFulfillmentUpdateTracking_order_total_tax;
}
-export interface OrderFulfillmentUpdateTracking_orderFulfillmentUpdateTracking_order_totalAuthorized {
+export interface OrderFulfillmentUpdateTracking_orderFulfillmentUpdateTracking_order_authorizedAmount {
__typename: "Money";
amount: number;
currency: string;
}
-export interface OrderFulfillmentUpdateTracking_orderFulfillmentUpdateTracking_order_totalCaptured {
+export interface OrderFulfillmentUpdateTracking_orderFulfillmentUpdateTracking_order_capturedAmount {
__typename: "Money";
amount: number;
currency: string;
@@ -252,8 +252,9 @@ export interface OrderFulfillmentUpdateTracking_orderFulfillmentUpdateTracking_o
status: OrderStatus;
subtotal: OrderFulfillmentUpdateTracking_orderFulfillmentUpdateTracking_order_subtotal | null;
total: OrderFulfillmentUpdateTracking_orderFulfillmentUpdateTracking_order_total | null;
- totalAuthorized: OrderFulfillmentUpdateTracking_orderFulfillmentUpdateTracking_order_totalAuthorized | null;
- totalCaptured: OrderFulfillmentUpdateTracking_orderFulfillmentUpdateTracking_order_totalCaptured | null;
+ actions: (OrderAction | null)[];
+ authorizedAmount: OrderFulfillmentUpdateTracking_orderFulfillmentUpdateTracking_order_authorizedAmount;
+ capturedAmount: OrderFulfillmentUpdateTracking_orderFulfillmentUpdateTracking_order_capturedAmount;
user: OrderFulfillmentUpdateTracking_orderFulfillmentUpdateTracking_order_user | null;
userEmail: string | null;
availableShippingMethods: (OrderFulfillmentUpdateTracking_orderFulfillmentUpdateTracking_order_availableShippingMethods | null)[] | null;
diff --git a/saleor/static/dashboard-next/orders/types/OrderLineAdd.ts b/saleor/static/dashboard-next/orders/types/OrderLineAdd.ts
index cb04aaf798..cf4ab3535e 100644
--- a/saleor/static/dashboard-next/orders/types/OrderLineAdd.ts
+++ b/saleor/static/dashboard-next/orders/types/OrderLineAdd.ts
@@ -1,7 +1,7 @@
/* tslint:disable */
// This file was automatically generated and should not be edited.
-import { OrderLineCreateInput, OrderEventsEmails, OrderEvents, FulfillmentStatus, PaymentChargeStatusEnum, OrderStatus } from "./../../types/globalTypes";
+import { OrderLineCreateInput, OrderEventsEmails, OrderEvents, FulfillmentStatus, PaymentChargeStatusEnum, OrderStatus, OrderAction } from "./../../types/globalTypes";
// ====================================================
// GraphQL mutation operation: OrderLineAdd
@@ -204,13 +204,13 @@ export interface OrderLineAdd_draftOrderLineCreate_order_total {
tax: OrderLineAdd_draftOrderLineCreate_order_total_tax;
}
-export interface OrderLineAdd_draftOrderLineCreate_order_totalAuthorized {
+export interface OrderLineAdd_draftOrderLineCreate_order_authorizedAmount {
__typename: "Money";
amount: number;
currency: string;
}
-export interface OrderLineAdd_draftOrderLineCreate_order_totalCaptured {
+export interface OrderLineAdd_draftOrderLineCreate_order_capturedAmount {
__typename: "Money";
amount: number;
currency: string;
@@ -252,8 +252,9 @@ export interface OrderLineAdd_draftOrderLineCreate_order {
status: OrderStatus;
subtotal: OrderLineAdd_draftOrderLineCreate_order_subtotal | null;
total: OrderLineAdd_draftOrderLineCreate_order_total | null;
- totalAuthorized: OrderLineAdd_draftOrderLineCreate_order_totalAuthorized | null;
- totalCaptured: OrderLineAdd_draftOrderLineCreate_order_totalCaptured | null;
+ actions: (OrderAction | null)[];
+ authorizedAmount: OrderLineAdd_draftOrderLineCreate_order_authorizedAmount;
+ capturedAmount: OrderLineAdd_draftOrderLineCreate_order_capturedAmount;
user: OrderLineAdd_draftOrderLineCreate_order_user | null;
userEmail: string | null;
availableShippingMethods: (OrderLineAdd_draftOrderLineCreate_order_availableShippingMethods | null)[] | null;
diff --git a/saleor/static/dashboard-next/orders/types/OrderLineDelete.ts b/saleor/static/dashboard-next/orders/types/OrderLineDelete.ts
index 2fdd74a3a2..a05a0fb368 100644
--- a/saleor/static/dashboard-next/orders/types/OrderLineDelete.ts
+++ b/saleor/static/dashboard-next/orders/types/OrderLineDelete.ts
@@ -1,7 +1,7 @@
/* tslint:disable */
// This file was automatically generated and should not be edited.
-import { OrderEventsEmails, OrderEvents, FulfillmentStatus, PaymentChargeStatusEnum, OrderStatus } from "./../../types/globalTypes";
+import { OrderEventsEmails, OrderEvents, FulfillmentStatus, PaymentChargeStatusEnum, OrderStatus, OrderAction } from "./../../types/globalTypes";
// ====================================================
// GraphQL mutation operation: OrderLineDelete
@@ -204,13 +204,13 @@ export interface OrderLineDelete_draftOrderLineDelete_order_total {
tax: OrderLineDelete_draftOrderLineDelete_order_total_tax;
}
-export interface OrderLineDelete_draftOrderLineDelete_order_totalAuthorized {
+export interface OrderLineDelete_draftOrderLineDelete_order_authorizedAmount {
__typename: "Money";
amount: number;
currency: string;
}
-export interface OrderLineDelete_draftOrderLineDelete_order_totalCaptured {
+export interface OrderLineDelete_draftOrderLineDelete_order_capturedAmount {
__typename: "Money";
amount: number;
currency: string;
@@ -252,8 +252,9 @@ export interface OrderLineDelete_draftOrderLineDelete_order {
status: OrderStatus;
subtotal: OrderLineDelete_draftOrderLineDelete_order_subtotal | null;
total: OrderLineDelete_draftOrderLineDelete_order_total | null;
- totalAuthorized: OrderLineDelete_draftOrderLineDelete_order_totalAuthorized | null;
- totalCaptured: OrderLineDelete_draftOrderLineDelete_order_totalCaptured | null;
+ actions: (OrderAction | null)[];
+ authorizedAmount: OrderLineDelete_draftOrderLineDelete_order_authorizedAmount;
+ capturedAmount: OrderLineDelete_draftOrderLineDelete_order_capturedAmount;
user: OrderLineDelete_draftOrderLineDelete_order_user | null;
userEmail: string | null;
availableShippingMethods: (OrderLineDelete_draftOrderLineDelete_order_availableShippingMethods | null)[] | null;
diff --git a/saleor/static/dashboard-next/orders/types/OrderLineUpdate.ts b/saleor/static/dashboard-next/orders/types/OrderLineUpdate.ts
index 4622697e09..5548ef3f9f 100644
--- a/saleor/static/dashboard-next/orders/types/OrderLineUpdate.ts
+++ b/saleor/static/dashboard-next/orders/types/OrderLineUpdate.ts
@@ -1,7 +1,7 @@
/* tslint:disable */
// This file was automatically generated and should not be edited.
-import { OrderLineInput, OrderEventsEmails, OrderEvents, FulfillmentStatus, PaymentChargeStatusEnum, OrderStatus } from "./../../types/globalTypes";
+import { OrderLineInput, OrderEventsEmails, OrderEvents, FulfillmentStatus, PaymentChargeStatusEnum, OrderStatus, OrderAction } from "./../../types/globalTypes";
// ====================================================
// GraphQL mutation operation: OrderLineUpdate
@@ -204,13 +204,13 @@ export interface OrderLineUpdate_draftOrderLineUpdate_order_total {
tax: OrderLineUpdate_draftOrderLineUpdate_order_total_tax;
}
-export interface OrderLineUpdate_draftOrderLineUpdate_order_totalAuthorized {
+export interface OrderLineUpdate_draftOrderLineUpdate_order_authorizedAmount {
__typename: "Money";
amount: number;
currency: string;
}
-export interface OrderLineUpdate_draftOrderLineUpdate_order_totalCaptured {
+export interface OrderLineUpdate_draftOrderLineUpdate_order_capturedAmount {
__typename: "Money";
amount: number;
currency: string;
@@ -252,8 +252,9 @@ export interface OrderLineUpdate_draftOrderLineUpdate_order {
status: OrderStatus;
subtotal: OrderLineUpdate_draftOrderLineUpdate_order_subtotal | null;
total: OrderLineUpdate_draftOrderLineUpdate_order_total | null;
- totalAuthorized: OrderLineUpdate_draftOrderLineUpdate_order_totalAuthorized | null;
- totalCaptured: OrderLineUpdate_draftOrderLineUpdate_order_totalCaptured | null;
+ actions: (OrderAction | null)[];
+ authorizedAmount: OrderLineUpdate_draftOrderLineUpdate_order_authorizedAmount;
+ capturedAmount: OrderLineUpdate_draftOrderLineUpdate_order_capturedAmount;
user: OrderLineUpdate_draftOrderLineUpdate_order_user | null;
userEmail: string | null;
availableShippingMethods: (OrderLineUpdate_draftOrderLineUpdate_order_availableShippingMethods | null)[] | null;
diff --git a/saleor/static/dashboard-next/orders/types/OrderMarkAsPaid.ts b/saleor/static/dashboard-next/orders/types/OrderMarkAsPaid.ts
index 7bfe132c67..41a6f62bac 100644
--- a/saleor/static/dashboard-next/orders/types/OrderMarkAsPaid.ts
+++ b/saleor/static/dashboard-next/orders/types/OrderMarkAsPaid.ts
@@ -1,7 +1,7 @@
/* tslint:disable */
// This file was automatically generated and should not be edited.
-import { OrderEventsEmails, OrderEvents, FulfillmentStatus, PaymentChargeStatusEnum, OrderStatus } from "./../../types/globalTypes";
+import { OrderEventsEmails, OrderEvents, FulfillmentStatus, PaymentChargeStatusEnum, OrderStatus, OrderAction } from "./../../types/globalTypes";
// ====================================================
// GraphQL mutation operation: OrderMarkAsPaid
@@ -204,13 +204,13 @@ export interface OrderMarkAsPaid_orderMarkAsPaid_order_total {
tax: OrderMarkAsPaid_orderMarkAsPaid_order_total_tax;
}
-export interface OrderMarkAsPaid_orderMarkAsPaid_order_totalAuthorized {
+export interface OrderMarkAsPaid_orderMarkAsPaid_order_authorizedAmount {
__typename: "Money";
amount: number;
currency: string;
}
-export interface OrderMarkAsPaid_orderMarkAsPaid_order_totalCaptured {
+export interface OrderMarkAsPaid_orderMarkAsPaid_order_capturedAmount {
__typename: "Money";
amount: number;
currency: string;
@@ -252,8 +252,9 @@ export interface OrderMarkAsPaid_orderMarkAsPaid_order {
status: OrderStatus;
subtotal: OrderMarkAsPaid_orderMarkAsPaid_order_subtotal | null;
total: OrderMarkAsPaid_orderMarkAsPaid_order_total | null;
- totalAuthorized: OrderMarkAsPaid_orderMarkAsPaid_order_totalAuthorized | null;
- totalCaptured: OrderMarkAsPaid_orderMarkAsPaid_order_totalCaptured | null;
+ actions: (OrderAction | null)[];
+ authorizedAmount: OrderMarkAsPaid_orderMarkAsPaid_order_authorizedAmount;
+ capturedAmount: OrderMarkAsPaid_orderMarkAsPaid_order_capturedAmount;
user: OrderMarkAsPaid_orderMarkAsPaid_order_user | null;
userEmail: string | null;
availableShippingMethods: (OrderMarkAsPaid_orderMarkAsPaid_order_availableShippingMethods | null)[] | null;
diff --git a/saleor/static/dashboard-next/orders/types/OrderRefund.ts b/saleor/static/dashboard-next/orders/types/OrderRefund.ts
index 38eac8eff2..eb8021f9d9 100644
--- a/saleor/static/dashboard-next/orders/types/OrderRefund.ts
+++ b/saleor/static/dashboard-next/orders/types/OrderRefund.ts
@@ -1,7 +1,7 @@
/* tslint:disable */
// This file was automatically generated and should not be edited.
-import { OrderEventsEmails, OrderEvents, FulfillmentStatus, PaymentChargeStatusEnum, OrderStatus } from "./../../types/globalTypes";
+import { OrderEventsEmails, OrderEvents, FulfillmentStatus, PaymentChargeStatusEnum, OrderStatus, OrderAction } from "./../../types/globalTypes";
// ====================================================
// GraphQL mutation operation: OrderRefund
@@ -204,13 +204,13 @@ export interface OrderRefund_orderRefund_order_total {
tax: OrderRefund_orderRefund_order_total_tax;
}
-export interface OrderRefund_orderRefund_order_totalAuthorized {
+export interface OrderRefund_orderRefund_order_authorizedAmount {
__typename: "Money";
amount: number;
currency: string;
}
-export interface OrderRefund_orderRefund_order_totalCaptured {
+export interface OrderRefund_orderRefund_order_capturedAmount {
__typename: "Money";
amount: number;
currency: string;
@@ -252,8 +252,9 @@ export interface OrderRefund_orderRefund_order {
status: OrderStatus;
subtotal: OrderRefund_orderRefund_order_subtotal | null;
total: OrderRefund_orderRefund_order_total | null;
- totalAuthorized: OrderRefund_orderRefund_order_totalAuthorized | null;
- totalCaptured: OrderRefund_orderRefund_order_totalCaptured | null;
+ actions: (OrderAction | null)[];
+ authorizedAmount: OrderRefund_orderRefund_order_authorizedAmount;
+ capturedAmount: OrderRefund_orderRefund_order_capturedAmount;
user: OrderRefund_orderRefund_order_user | null;
userEmail: string | null;
availableShippingMethods: (OrderRefund_orderRefund_order_availableShippingMethods | null)[] | null;
diff --git a/saleor/static/dashboard-next/orders/types/OrderVoid.ts b/saleor/static/dashboard-next/orders/types/OrderVoid.ts
index 951c99fe0b..bebe81fd13 100644
--- a/saleor/static/dashboard-next/orders/types/OrderVoid.ts
+++ b/saleor/static/dashboard-next/orders/types/OrderVoid.ts
@@ -1,7 +1,7 @@
/* tslint:disable */
// This file was automatically generated and should not be edited.
-import { OrderEventsEmails, OrderEvents, FulfillmentStatus, PaymentChargeStatusEnum, OrderStatus } from "./../../types/globalTypes";
+import { OrderEventsEmails, OrderEvents, FulfillmentStatus, PaymentChargeStatusEnum, OrderStatus, OrderAction } from "./../../types/globalTypes";
// ====================================================
// GraphQL mutation operation: OrderVoid
@@ -198,13 +198,13 @@ export interface OrderVoid_orderVoid_order_total {
tax: OrderVoid_orderVoid_order_total_tax;
}
-export interface OrderVoid_orderVoid_order_totalAuthorized {
+export interface OrderVoid_orderVoid_order_authorizedAmount {
__typename: "Money";
amount: number;
currency: string;
}
-export interface OrderVoid_orderVoid_order_totalCaptured {
+export interface OrderVoid_orderVoid_order_capturedAmount {
__typename: "Money";
amount: number;
currency: string;
@@ -246,8 +246,9 @@ export interface OrderVoid_orderVoid_order {
status: OrderStatus;
subtotal: OrderVoid_orderVoid_order_subtotal | null;
total: OrderVoid_orderVoid_order_total | null;
- totalAuthorized: OrderVoid_orderVoid_order_totalAuthorized | null;
- totalCaptured: OrderVoid_orderVoid_order_totalCaptured | null;
+ actions: (OrderAction | null)[];
+ authorizedAmount: OrderVoid_orderVoid_order_authorizedAmount;
+ capturedAmount: OrderVoid_orderVoid_order_capturedAmount;
user: OrderVoid_orderVoid_order_user | null;
userEmail: string | null;
availableShippingMethods: (OrderVoid_orderVoid_order_availableShippingMethods | null)[] | null;
diff --git a/saleor/static/dashboard-next/storybook/__snapshots__/Stories.test.ts.snap b/saleor/static/dashboard-next/storybook/__snapshots__/Stories.test.ts.snap
index 9ffd5b6037..94a6cfd48e 100644
--- a/saleor/static/dashboard-next/storybook/__snapshots__/Stories.test.ts.snap
+++ b/saleor/static/dashboard-next/storybook/__snapshots__/Stories.test.ts.snap
@@ -5341,7 +5341,7 @@ exports[`Storyshots Orders / OrderPaymentDialog capture payment 1`] = `<div />`;
exports[`Storyshots Orders / OrderPaymentDialog refund payment 1`] = `<div />`;
-exports[`Storyshots Orders / OrderPaymentReleaseDialog default 1`] = `<div />`;
+exports[`Storyshots Orders / OrderPaymentVoidDialog default 1`] = `<div />`;
exports[`Storyshots Orders / OrderProductAddDialog default 1`] = `<div />`;
@@ -19547,9 +19547,9 @@ exports[`Storyshots Views / Orders / Order details cancelled 1`] = `
class="MuiTypography-root-id MuiTypography-body1-id Component-title-id"
>
<div
- class="Component-root-id undefined Component-neutralDot-id"
+ class="Component-root-id undefined Component-errorDot-id"
>
- Pending
+ Unpaid
</div>
</span>
<div
@@ -20426,9 +20426,9 @@ exports[`Storyshots Views / Orders / Order details default 1`] = `
class="MuiTypography-root-id MuiTypography-body1-id Component-title-id"
>
<div
- class="Component-root-id undefined Component-neutralDot-id"
+ class="Component-root-id undefined Component-errorDot-id"
>
- Pending
+ Unpaid
</div>
</span>
<div
@@ -20531,7 +20531,35 @@ exports[`Storyshots Views / Orders / Order details default 1`] = `
<span
class="MuiButton-label-id"
>
- Release
+ Refund
+ </span>
+ <span
+ class="MuiTouchRipple-root-id"
+ />
+ </button>
+ <button
+ class="MuiButtonBase-root-id MuiButton-root-id MuiButton-text-id MuiButton-textSecondary-id MuiButton-flat-id MuiButton-flatSecondary-id MuiCardActions-action-id"
+ tabindex="0"
+ type="button"
+ >
+ <span
+ class="MuiButton-label-id"
+ >
+ Void
+ </span>
+ <span
+ class="MuiTouchRipple-root-id"
+ />
+ </button>
+ <button
+ class="MuiButtonBase-root-id MuiButton-root-id MuiButton-text-id MuiButton-textSecondary-id MuiButton-flat-id MuiButton-flatSecondary-id MuiCardActions-action-id"
+ tabindex="0"
+ type="button"
+ >
+ <span
+ class="MuiButton-label-id"
+ >
+ Mark as paid
</span>
<span
class="MuiTouchRipple-root-id"
@@ -21187,6 +21215,20 @@ exports[`Storyshots Views / Orders / Order details fulfilled 1`] = `
<div
class="MuiCardActions-root-id"
>
+ <button
+ class="MuiButtonBase-root-id MuiButton-root-id MuiButton-text-id MuiButton-textSecondary-id MuiButton-flat-id MuiButton-flatSecondary-id MuiCardActions-action-id"
+ tabindex="0"
+ type="button"
+ >
+ <span
+ class="MuiButton-label-id"
+ >
+ Capture
+ </span>
+ <span
+ class="MuiTouchRipple-root-id"
+ />
+ </button>
<button
class="MuiButtonBase-root-id MuiButton-root-id MuiButton-text-id MuiButton-textSecondary-id MuiButton-flat-id MuiButton-flatSecondary-id MuiCardActions-action-id"
tabindex="0"
@@ -21201,6 +21243,34 @@ exports[`Storyshots Views / Orders / Order details fulfilled 1`] = `
class="MuiTouchRipple-root-id"
/>
</button>
+ <button
+ class="MuiButtonBase-root-id MuiButton-root-id MuiButton-text-id MuiButton-textSecondary-id MuiButton-flat-id MuiButton-flatSecondary-id MuiCardActions-action-id"
+ tabindex="0"
+ type="button"
+ >
+ <span
+ class="MuiButton-label-id"
+ >
+ Void
+ </span>
+ <span
+ class="MuiTouchRipple-root-id"
+ />
+ </button>
+ <button
+ class="MuiButtonBase-root-id MuiButton-root-id MuiButton-text-id MuiButton-textSecondary-id MuiButton-flat-id MuiButton-flatSecondary-id MuiCardActions-action-id"
+ tabindex="0"
+ type="button"
+ >
+ <span
+ class="MuiButton-label-id"
+ >
+ Mark as paid
+ </span>
+ <span
+ class="MuiTouchRipple-root-id"
+ />
+ </button>
</div>
</div>
<div
@@ -21376,9 +21446,9 @@ exports[`Storyshots Views / Orders / Order details fulfilled 1`] = `
class="MuiTypography-root-id MuiTypography-body1-id Component-title-id"
>
<div
- class="Component-root-id undefined Component-neutralDot-id"
+ class="Component-root-id undefined Component-errorDot-id"
>
- Pending
+ Unpaid
</div>
</span>
<div
@@ -21481,7 +21551,77 @@ exports[`Storyshots Views / Orders / Order details fulfilled 1`] = `
<span
class="MuiButton-label-id"
>
- Release
+ Refund
+ </span>
+ <span
+ class="MuiTouchRipple-root-id"
+ />
+ </button>
+ <button
+ class="MuiButtonBase-root-id MuiButton-root-id MuiButton-text-id MuiButton-textSecondary-id MuiButton-flat-id MuiButton-flatSecondary-id MuiCardActions-action-id"
+ tabindex="0"
+ type="button"
+ >
+ <span
+ class="MuiButton-label-id"
+ >
+ Void
+ </span>
+ <span
+ class="MuiTouchRipple-root-id"
+ />
+ </button>
+ <button
+ class="MuiButtonBase-root-id MuiButton-root-id MuiButton-text-id MuiButton-textSecondary-id MuiButton-flat-id MuiButton-flatSecondary-id MuiCardActions-action-id"
+ tabindex="0"
+ type="button"
+ >
+ <span
+ class="MuiButton-label-id"
+ >
+ Capture
+ </span>
+ <span
+ class="MuiTouchRipple-root-id"
+ />
+ </button>
+ <button
+ class="MuiButtonBase-root-id MuiButton-root-id MuiButton-text-id MuiButton-textSecondary-id MuiButton-flat-id MuiButton-flatSecondary-id MuiCardActions-action-id"
+ tabindex="0"
+ type="button"
+ >
+ <span
+ class="MuiButton-label-id"
+ >
+ Refund
+ </span>
+ <span
+ class="MuiTouchRipple-root-id"
+ />
+ </button>
+ <button
+ class="MuiButtonBase-root-id MuiButton-root-id MuiButton-text-id MuiButton-textSecondary-id MuiButton-flat-id MuiButton-flatSecondary-id MuiCardActions-action-id"
+ tabindex="0"
+ type="button"
+ >
+ <span
+ class="MuiButton-label-id"
+ >
+ Void
+ </span>
+ <span
+ class="MuiTouchRipple-root-id"
+ />
+ </button>
+ <button
+ class="MuiButtonBase-root-id MuiButton-root-id MuiButton-text-id MuiButton-textSecondary-id MuiButton-flat-id MuiButton-flatSecondary-id MuiCardActions-action-id"
+ tabindex="0"
+ type="button"
+ >
+ <span
+ class="MuiButton-label-id"
+ >
+ Mark as paid
</span>
<span
class="MuiTouchRipple-root-id"
@@ -22479,6 +22619,48 @@ exports[`Storyshots Views / Orders / Order details no payment 1`] = `
<div
class="MuiCardActions-root-id"
>
+ <button
+ class="MuiButtonBase-root-id MuiButton-root-id MuiButton-text-id MuiButton-textSecondary-id MuiButton-flat-id MuiButton-flatSecondary-id MuiCardActions-action-id"
+ tabindex="0"
+ type="button"
+ >
+ <span
+ class="MuiButton-label-id"
+ >
+ Capture
+ </span>
+ <span
+ class="MuiTouchRipple-root-id"
+ />
+ </button>
+ <button
+ class="MuiButtonBase-root-id MuiButton-root-id MuiButton-text-id MuiButton-textSecondary-id MuiButton-flat-id MuiButton-flatSecondary-id MuiCardActions-action-id"
+ tabindex="0"
+ type="button"
+ >
+ <span
+ class="MuiButton-label-id"
+ >
+ Refund
+ </span>
+ <span
+ class="MuiTouchRipple-root-id"
+ />
+ </button>
+ <button
+ class="MuiButtonBase-root-id MuiButton-root-id MuiButton-text-id MuiButton-textSecondary-id MuiButton-flat-id MuiButton-flatSecondary-id MuiCardActions-action-id"
+ tabindex="0"
+ type="button"
+ >
+ <span
+ class="MuiButton-label-id"
+ >
+ Void
+ </span>
+ <span
+ class="MuiTouchRipple-root-id"
+ />
+ </button>
<button
class="MuiButtonBase-root-id MuiButton-root-id MuiButton-text-id MuiButton-textSecondary-id MuiButton-flat-id MuiButton-flatSecondary-id MuiCardActions-action-id"
tabindex="0"
@@ -23764,9 +23946,9 @@ exports[`Storyshots Views / Orders / Order details no shipping address 1`] = `
class="MuiTypography-root-id MuiTypography-body1-id Component-title-id"
>
<div
- class="Component-root-id undefined Component-neutralDot-id"
+ class="Component-root-id undefined Component-errorDot-id"
>
- Pending
+ Unpaid
</div>
</span>
<div
@@ -23869,7 +24051,35 @@ exports[`Storyshots Views / Orders / Order details no shipping address 1`] = `
<span
class="MuiButton-label-id"
>
- Release
+ Refund
+ </span>
+ <span
+ class="MuiTouchRipple-root-id"
+ />
+ </button>
+ <button
+ class="MuiButtonBase-root-id MuiButton-root-id MuiButton-text-id MuiButton-textSecondary-id MuiButton-flat-id MuiButton-flatSecondary-id MuiCardActions-action-id"
+ tabindex="0"
+ type="button"
+ >
+ <span
+ class="MuiButton-label-id"
+ >
+ Void
+ </span>
+ <span
+ class="MuiTouchRipple-root-id"
+ />
+ </button>
+ <button
+ class="MuiButtonBase-root-id MuiButton-root-id MuiButton-text-id MuiButton-textSecondary-id MuiButton-flat-id MuiButton-flatSecondary-id MuiCardActions-action-id"
+ tabindex="0"
+ type="button"
+ >
+ <span
+ class="MuiButton-label-id"
+ >
+ Mark as paid
</span>
<span
class="MuiTouchRipple-root-id"
@@ -24714,9 +24924,9 @@ exports[`Storyshots Views / Orders / Order details partially fulfilled 1`] = `
class="MuiTypography-root-id MuiTypography-body1-id Component-title-id"
>
<div
- class="Component-root-id undefined Component-neutralDot-id"
+ class="Component-root-id undefined Component-errorDot-id"
>
- Pending
+ Unpaid
</div>
</span>
<div
@@ -24819,7 +25029,77 @@ exports[`Storyshots Views / Orders / Order details partially fulfilled 1`] = `
<span
class="MuiButton-label-id"
>
- Release
+ Refund
+ </span>
+ <span
+ class="MuiTouchRipple-root-id"
+ />
+ </button>
+ <button
+ class="MuiButtonBase-root-id MuiButton-root-id MuiButton-text-id MuiButton-textSecondary-id MuiButton-flat-id MuiButton-flatSecondary-id MuiCardActions-action-id"
+ tabindex="0"
+ type="button"
+ >
+ <span
+ class="MuiButton-label-id"
+ >
+ Void
+ </span>
+ <span
+ class="MuiTouchRipple-root-id"
+ />
+ </button>
+ <button
+ class="MuiButtonBase-root-id MuiButton-root-id MuiButton-text-id MuiButton-textSecondary-id MuiButton-flat-id MuiButton-flatSecondary-id MuiCardActions-action-id"
+ tabindex="0"
+ type="button"
+ >
+ <span
+ class="MuiButton-label-id"
+ >
+ Capture
+ </span>
+ <span
+ class="MuiTouchRipple-root-id"
+ />
+ </button>
+ <button
+ class="MuiButtonBase-root-id MuiButton-root-id MuiButton-text-id MuiButton-textSecondary-id MuiButton-flat-id MuiButton-flatSecondary-id MuiCardActions-action-id"
+ tabindex="0"
+ type="button"
+ >
+ <span
+ class="MuiButton-label-id"
+ >
+ Refund
+ </span>
+ <span
+ class="MuiTouchRipple-root-id"
+ />
+ </button>
+ <button
+ class="MuiButtonBase-root-id MuiButton-root-id MuiButton-text-id MuiButton-textSecondary-id MuiButton-flat-id MuiButton-flatSecondary-id MuiCardActions-action-id"
+ tabindex="0"
+ type="button"
+ >
+ <span
+ class="MuiButton-label-id"
+ >
+ Void
+ </span>
+ <span
+ class="MuiTouchRipple-root-id"
+ />
+ </button>
+ <button
+ class="MuiButtonBase-root-id MuiButton-root-id MuiButton-text-id MuiButton-textSecondary-id MuiButton-flat-id MuiButton-flatSecondary-id MuiCardActions-action-id"
+ tabindex="0"
+ type="button"
+ >
+ <span
+ class="MuiButton-label-id"
+ >
+ Mark as paid
</span>
<span
class="MuiTouchRipple-root-id"
@@ -27536,9 +27816,9 @@ exports[`Storyshots Views / Orders / Order details pending payment 1`] = `
class="MuiTypography-root-id MuiTypography-body1-id Component-title-id"
>
<div
- class="Component-root-id undefined Component-neutralDot-id"
+ class="Component-root-id undefined Component-errorDot-id"
>
- Pending
+ Unpaid
</div>
</span>
<div
@@ -27641,7 +27921,35 @@ exports[`Storyshots Views / Orders / Order details pending payment 1`] = `
<span
class="MuiButton-label-id"
>
- Release
+ Refund
+ </span>
+ <span
+ class="MuiTouchRipple-root-id"
+ />
+ </button>
+ <button
+ class="MuiButtonBase-root-id MuiButton-root-id MuiButton-text-id MuiButton-textSecondary-id MuiButton-flat-id MuiButton-flatSecondary-id MuiCardActions-action-id"
+ tabindex="0"
+ type="button"
+ >
+ <span
+ class="MuiButton-label-id"
+ >
+ Void
+ </span>
+ <span
+ class="MuiTouchRipple-root-id"
+ />
+ </button>
+ <button
+ class="MuiButtonBase-root-id MuiButton-root-id MuiButton-text-id MuiButton-textSecondary-id MuiButton-flat-id MuiButton-flatSecondary-id MuiCardActions-action-id"
+ tabindex="0"
+ type="button"
+ >
+ <span
+ class="MuiButton-label-id"
+ >
+ Mark as paid
</span>
<span
class="MuiTouchRipple-root-id"
@@ -28563,6 +28871,69 @@ exports[`Storyshots Views / Orders / Order details refunded payment 1`] = `
</tbody>
</table>
</div>
+ <hr
+ class="Component-root-id"
+ />
+ <div
+ class="MuiCardActions-root-id"
+ >
+ <button
+ class="MuiButtonBase-root-id MuiButton-root-id MuiButton-text-id MuiButton-textSecondary-id MuiButton-flat-id MuiButton-flatSecondary-id MuiCardActions-action-id"
+ tabindex="0"
+ type="button"
+ >
+ <span
+ class="MuiButton-label-id"
+ >
+ Capture
+ </span>
+ <span
+ class="MuiTouchRipple-root-id"
+ />
+ </button>
+ <button
+ class="MuiButtonBase-root-id MuiButton-root-id MuiButton-text-id MuiButton-textSecondary-id MuiButton-flat-id MuiButton-flatSecondary-id MuiCardActions-action-id"
+ tabindex="0"
+ type="button"
+ >
+ <span
+ class="MuiButton-label-id"
+ >
+ Refund
+ </span>
+ <span
+ class="MuiTouchRipple-root-id"
+ />
+ </button>
+ <button
+ class="MuiButtonBase-root-id MuiButton-root-id MuiButton-text-id MuiButton-textSecondary-id MuiButton-flat-id MuiButton-flatSecondary-id MuiCardActions-action-id"
+ tabindex="0"
+ type="button"
+ >
+ <span
+ class="MuiButton-label-id"
+ >
+ Void
+ </span>
+ <span
+ class="MuiTouchRipple-root-id"
+ />
+ </button>
+ <button
+ class="MuiButtonBase-root-id MuiButton-root-id MuiButton-text-id MuiButton-textSecondary-id MuiButton-flat-id MuiButton-flatSecondary-id MuiCardActions-action-id"
+ tabindex="0"
+ type="button"
+ >
+ <span
+ class="MuiButton-label-id"
+ >
+ Mark as paid
+ </span>
+ <span
+ class="MuiTouchRipple-root-id"
+ />
+ </button>
+ </div>
</div>
<div
class="OrderHistory-root-id"
@@ -30337,9 +30708,9 @@ exports[`Storyshots Views / Orders / Order details unfulfilled 1`] = `
class="MuiTypography-root-id MuiTypography-body1-id Component-title-id"
>
<div
- class="Component-root-id undefined Component-neutralDot-id"
+ class="Component-root-id undefined Component-errorDot-id"
>
- Pending
+ Unpaid
</div>
</span>
<div
@@ -30442,7 +30813,35 @@ exports[`Storyshots Views / Orders / Order details unfulfilled 1`] = `
<span
class="MuiButton-label-id"
>
- Release
+ Refund
+ </span>
+ <span
+ class="MuiTouchRipple-root-id"
+ />
+ </button>
+ <button
+ class="MuiButtonBase-root-id MuiButton-root-id MuiButton-text-id MuiButton-textSecondary-id MuiButton-flat-id MuiButton-flatSecondary-id MuiCardActions-action-id"
+ tabindex="0"
+ type="button"
+ >
+ <span
+ class="MuiButton-label-id"
+ >
+ Void
+ </span>
+ <span
+ class="MuiTouchRipple-root-id"
+ />
+ </button>
+ <button
+ class="MuiButtonBase-root-id MuiButton-root-id MuiButton-text-id MuiButton-textSecondary-id MuiButton-flat-id MuiButton-flatSecondary-id MuiCardActions-action-id"
+ tabindex="0"
+ type="button"
+ >
+ <span
+ class="MuiButton-label-id"
+ >
+ Mark as paid
</span>
<span
class="MuiTouchRipple-root-id"
@@ -32651,9 +33050,9 @@ exports[`Storyshots Views / Orders / Order list default 1`] = `
class="MuiTableCell-root-id MuiTableCell-body-id MuiTableCell-paddingDense-id"
>
<div
- class="Component-root-id undefined Component-neutralDot-id"
+ class="Component-root-id undefined Component-errorDot-id"
>
- Pending
+ Unpaid
</div>
</td>
<td
@@ -32698,9 +33097,9 @@ exports[`Storyshots Views / Orders / Order list default 1`] = `
class="MuiTableCell-root-id MuiTableCell-body-id MuiTableCell-paddingDense-id"
>
<div
- class="Component-root-id undefined Component-neutralDot-id"
+ class="Component-root-id undefined Component-errorDot-id"
>
- Pending
+ Unpaid
</div>
</td>
<td
@@ -32745,9 +33144,9 @@ exports[`Storyshots Views / Orders / Order list default 1`] = `
class="MuiTableCell-root-id MuiTableCell-body-id MuiTableCell-paddingDense-id"
>
<div
- class="Component-root-id undefined Component-neutralDot-id"
+ class="Component-root-id undefined Component-errorDot-id"
>
- Pending
+ Unpaid
</div>
</td>
<td
@@ -32839,9 +33238,9 @@ exports[`Storyshots Views / Orders / Order list default 1`] = `
class="MuiTableCell-root-id MuiTableCell-body-id MuiTableCell-paddingDense-id"
>
<div
- class="Component-root-id undefined Component-neutralDot-id"
+ class="Component-root-id undefined Component-errorDot-id"
>
- Pending
+ Unpaid
</div>
</td>
<td
@@ -32886,9 +33285,9 @@ exports[`Storyshots Views / Orders / Order list default 1`] = `
class="MuiTableCell-root-id MuiTableCell-body-id MuiTableCell-paddingDense-id"
>
<div
- class="Component-root-id undefined Component-neutralDot-id"
+ class="Component-root-id undefined Component-errorDot-id"
>
- Pending
+ Unpaid
</div>
</td>
<td
@@ -32933,9 +33332,9 @@ exports[`Storyshots Views / Orders / Order list default 1`] = `
class="MuiTableCell-root-id MuiTableCell-body-id MuiTableCell-paddingDense-id"
>
<div
- class="Component-root-id undefined Component-neutralDot-id"
+ class="Component-root-id undefined Component-errorDot-id"
>
- Pending
+ Unpaid
</div>
</td>
<td
@@ -33027,9 +33426,9 @@ exports[`Storyshots Views / Orders / Order list default 1`] = `
class="MuiTableCell-root-id MuiTableCell-body-id MuiTableCell-paddingDense-id"
>
<div
- class="Component-root-id undefined Component-neutralDot-id"
+ class="Component-root-id undefined Component-errorDot-id"
>
- Pending
+ Unpaid
</div>
</td>
<td
@@ -33074,9 +33473,9 @@ exports[`Storyshots Views / Orders / Order list default 1`] = `
class="MuiTableCell-root-id MuiTableCell-body-id MuiTableCell-paddingDense-id"
>
<div
- class="Component-root-id undefined Component-neutralDot-id"
+ class="Component-root-id undefined Component-errorDot-id"
>
- Pending
+ Unpaid
</div>
</td>
<td
@@ -33121,9 +33520,9 @@ exports[`Storyshots Views / Orders / Order list default 1`] = `
class="MuiTableCell-root-id MuiTableCell-body-id MuiTableCell-paddingDense-id"
>
<div
- class="Component-root-id undefined Component-neutralDot-id"
+ class="Component-root-id undefined Component-errorDot-id"
>
- Pending
+ Unpaid
</div>
</td>
<td
@@ -33215,9 +33614,9 @@ exports[`Storyshots Views / Orders / Order list default 1`] = `
class="MuiTableCell-root-id MuiTableCell-body-id MuiTableCell-paddingDense-id"
>
<div
- class="Component-root-id undefined Component-neutralDot-id"
+ class="Component-root-id undefined Component-errorDot-id"
>
- Pending
+ Unpaid
</div>
</td>
<td
@@ -33262,9 +33661,9 @@ exports[`Storyshots Views / Orders / Order list default 1`] = `
class="MuiTableCell-root-id MuiTableCell-body-id MuiTableCell-paddingDense-id"
>
<div
- class="Component-root-id undefined Component-neutralDot-id"
+ class="Component-root-id undefined Component-errorDot-id"
>
- Pending
+ Unpaid
</div>
</td>
<td
@@ -33309,9 +33708,9 @@ exports[`Storyshots Views / Orders / Order list default 1`] = `
class="MuiTableCell-root-id MuiTableCell-body-id MuiTableCell-paddingDense-id"
>
<div
- class="Component-root-id undefined Component-neutralDot-id"
+ class="Component-root-id undefined Component-errorDot-id"
>
- Pending
+ Unpaid
</div>
</td>
<td
@@ -33356,9 +33755,9 @@ exports[`Storyshots Views / Orders / Order list default 1`] = `
class="MuiTableCell-root-id MuiTableCell-body-id MuiTableCell-paddingDense-id"
>
<div
- class="Component-root-id undefined Component-neutralDot-id"
+ class="Component-root-id undefined Component-errorDot-id"
>
- Pending
+ Unpaid
</div>
</td>
<td
@@ -33450,9 +33849,9 @@ exports[`Storyshots Views / Orders / Order list default 1`] = `
class="MuiTableCell-root-id MuiTableCell-body-id MuiTableCell-paddingDense-id"
>
<div
- class="Component-root-id undefined Component-neutralDot-id"
+ class="Component-root-id undefined Component-successDot-id"
>
- Pending
+ Paid
</div>
</td>
<td
diff --git a/saleor/static/dashboard-next/storybook/stories/orders/OrderDetailsPage.tsx b/saleor/static/dashboard-next/storybook/stories/orders/OrderDetailsPage.tsx
index cd97e429fe..0fd40a5be4 100644
--- a/saleor/static/dashboard-next/storybook/stories/orders/OrderDetailsPage.tsx
+++ b/saleor/static/dashboard-next/storybook/stories/orders/OrderDetailsPage.tsx
@@ -43,7 +43,7 @@ storiesOf("Views / Orders / Order details", module)
{...props}
order={{
...props.order,
- paymentStatus: PaymentChargeStatusEnum.PREAUTH
+ paymentStatus: PaymentChargeStatusEnum.NOT_CHARGED
}}
/>
))
@@ -52,7 +52,7 @@ storiesOf("Views / Orders / Order details", module)
{...props}
order={{
...props.order,
- paymentStatus: PaymentChargeStatusEnum.ERROR
+ paymentStatus: PaymentChargeStatusEnum.NOT_CHARGED
}}
/>
))
@@ -61,7 +61,7 @@ storiesOf("Views / Orders / Order details", module)
{...props}
order={{
...props.order,
- paymentStatus: PaymentChargeStatusEnum.CONFIRMED
+ paymentStatus: PaymentChargeStatusEnum.CHARGED
}}
/>
))
@@ -79,7 +79,7 @@ storiesOf("Views / Orders / Order details", module)
{...props}
order={{
...props.order,
- paymentStatus: PaymentChargeStatusEnum.REFUNDED
+ paymentStatus: PaymentChargeStatusEnum.FULLY_REFUNDED
}}
/>
))
@@ -88,7 +88,7 @@ storiesOf("Views / Orders / Order details", module)
{...props}
order={{
...props.order,
- paymentStatus: PaymentChargeStatusEnum.REJECTED
+ paymentStatus: PaymentChargeStatusEnum.NOT_CHARGED
}}
/>
))
diff --git a/saleor/static/dashboard-next/types/globalTypes.ts b/saleor/static/dashboard-next/types/globalTypes.ts
index 2ef964781a..8ebc524e78 100644
--- a/saleor/static/dashboard-next/types/globalTypes.ts
+++ b/saleor/static/dashboard-next/types/globalTypes.ts
@@ -7,17 +7,24 @@
export enum AttributeTypeEnum {
PRODUCT = "PRODUCT",
- VARIANT = "VARIANT"
+ VARIANT = "VARIANT",
}
export enum AuthorizationKeyType {
FACEBOOK = "FACEBOOK",
- GOOGLE_OAUTH2 = "GOOGLE_OAUTH2"
+ GOOGLE_OAUTH2 = "GOOGLE_OAUTH2",
}
export enum FulfillmentStatus {
CANCELED = "CANCELED",
- FULFILLED = "FULFILLED"
+ FULFILLED = "FULFILLED",
+}
+
+export enum OrderAction {
+ CAPTURE = "CAPTURE",
+ MARK_AS_PAID = "MARK_AS_PAID",
+ REFUND = "REFUND",
+ VOID = "VOID",
}
export enum OrderEvents {
@@ -37,14 +44,14 @@ export enum OrderEvents {
PLACED = "PLACED",
PLACED_FROM_DRAFT = "PLACED_FROM_DRAFT",
TRACKING_UPDATED = "TRACKING_UPDATED",
- UPDATED = "UPDATED"
+ UPDATED = "UPDATED",
}
export enum OrderEventsEmails {
FULFILLMENT = "FULFILLMENT",
ORDER = "ORDER",
PAYMENT = "PAYMENT",
- SHIPPING = "SHIPPING"
+ SHIPPING = "SHIPPING",
}
export enum OrderStatus {
@@ -52,13 +59,13 @@ export enum OrderStatus {
DRAFT = "DRAFT",
FULFILLED = "FULFILLED",
PARTIALLY_FULFILLED = "PARTIALLY_FULFILLED",
- UNFULFILLED = "UNFULFILLED"
+ UNFULFILLED = "UNFULFILLED",
}
export enum PaymentChargeStatusEnum {
CHARGED = "CHARGED",
FULLY_REFUNDED = "FULLY_REFUNDED",
- NOT_CHARGED = "NOT_CHARGED"
+ NOT_CHARGED = "NOT_CHARGED",
}
export enum PermissionEnum {
@@ -71,7 +78,7 @@ export enum PermissionEnum {
MANAGE_SETTINGS = "MANAGE_SETTINGS",
MANAGE_SHIPPING = "MANAGE_SHIPPING",
MANAGE_STAFF = "MANAGE_STAFF",
- MANAGE_USERS = "MANAGE_USERS"
+ MANAGE_USERS = "MANAGE_USERS",
}
export enum TaxRateType {
@@ -98,14 +105,14 @@ export enum TaxRateType {
RESTAURANTS = "RESTAURANTS",
SOCIAL_HOUSING = "SOCIAL_HOUSING",
STANDARD = "STANDARD",
- WATER = "WATER"
+ WATER = "WATER",
}
export enum WeightUnitsEnum {
g = "g",
kg = "kg",
lb = "lb",
- oz = "oz"
+ oz = "oz",
}
export interface AddressInput {
diff --git a/templates/dashboard/order/detail.html b/templates/dashboard/order/detail.html
index 82cecaec56..8c0427fe79 100644
--- a/templates/dashboard/order/detail.html
+++ b/templates/dashboard/order/detail.html
@@ -126,7 +126,7 @@
</td>
<td class="right-align">
<strong>
- {% price balance %}
+ {% price order.balance_amount %}
</strong>
</td>
</tr>
@@ -137,8 +137,8 @@
{% trans "Preauthorized amount" context "Order summary card header" %}
</td>
<td class="right-align">
- {% if preauthorized %}
- {% price preauthorized %}
+ {% if order.authorized_amount %}
+ {% price order.authorized_amount %}
{% else %}
{% trans "N/A" context "Preauthorized amount not available" %}
{% endif %}
@@ -149,30 +149,30 @@
{% trans "Captured amount" context "Order summary card header" %}
</td>
<td class="right-align">
- {% price captured %}
+ {% price order.captured_amount %}
</td>
</tr>
</tbody>
</table>
</div>
{% if not order.is_draft %}
- {% if can_capture or can_refund or can_void or can_mark_as_paid %}
+ {% if order.can_capture or order.can_refund or order.can_void or order.can_mark_as_paid %}
<div class="data-table-action">
- {% if can_capture %}
+ {% if order.can_capture %}
<a href="#base-modal" data-href="{% url 'dashboard:capture-payment' order_pk=order.pk payment_pk=payment.pk %}" class="btn-flat modal-trigger-custom waves-effect">
{% trans "Capture" context "Order summary card action" %}
</a>
- {% elif can_refund %}
+ {% elif order.can_refund %}
<a href="#base-modal" data-href="{% url 'dashboard:refund-payment' order_pk=order.pk payment_pk=payment.pk %}" class="btn-flat modal-trigger-custom waves-effect">
{% trans "Refund" context "Order summary card action" %}
</a>
{% endif %}
- {% if can_void %}
+ {% if order.can_void %}
<a href="#base-modal" data-href="{% url 'dashboard:void-payment' order_pk=order.pk payment_pk=payment.pk %}" class="btn-flat modal-trigger-custom waves-effect">
{% trans "Void" context "Order summary card action" %}
</a>
{% endif %}
- {% if can_mark_as_paid %}
+ {% if order.can_mark_as_paid %}
<a href="#base-modal" data-href="{% url 'dashboard:order-mark-as-paid' order_pk=order.pk %}" class="btn-flat modal-trigger-custom waves-effect">
{% trans "Mark as paid" context "Order detail action" %}
</a>
diff --git a/tests/api/test_order.py b/tests/api/test_order.py
index 28538186bc..ac8d273599 100644
--- a/tests/api/test_order.py
+++ b/tests/api/test_order.py
@@ -903,7 +903,7 @@ def test_order_capture(
order {
paymentStatus
isPaid
- totalCaptured {
+ capturedAmount {
amount
}
}
@@ -920,7 +920,7 @@ def test_order_capture(
order.refresh_from_db()
assert data['paymentStatus'] == PaymentChargeStatusEnum.CHARGED.name
assert data['isPaid']
- assert data['totalCaptured']['amount'] == float(amount)
+ assert data['capturedAmount']['amount'] == float(amount)
event_order_paid = order.events.first()
assert event_order_paid.type == OrderEvents.ORDER_FULLY_PAID.value