ptcoffee_django/src/core/__init__.py
2022-04-24 12:38:44 -06:00

98 lines
3.3 KiB
Python

from django.conf import settings
class DiscountValueType:
FIXED = "fixed"
PERCENTAGE = "percentage"
CHOICES = [
(FIXED, settings.DEFAULT_CURRENCY),
(PERCENTAGE, "%"),
]
class VoucherType:
SHIPPING = "shipping"
ENTIRE_ORDER = "entire_order"
SPECIFIC_PRODUCT = "specific_product"
CHOICES = [
(ENTIRE_ORDER, "Entire order"),
(SHIPPING, "Shipping"),
(SPECIFIC_PRODUCT, "Specific products, collections and categories"),
]
class OrderStatus:
DRAFT = "draft" # fully editable, not finalized order created by staff users
UNFULFILLED = "unfulfilled" # order with no items marked as fulfilled
PARTIALLY_FULFILLED = (
"partially_fulfilled" # order with some items marked as fulfilled
)
FULFILLED = "fulfilled" # order with all items marked as fulfilled
PARTIALLY_RETURNED = (
"partially_returned" # order with some items marked as returned
)
RETURNED = "returned" # order with all items marked as returned
CANCELED = "canceled" # permanently canceled order
CHOICES = [
(DRAFT, "Draft"),
(UNFULFILLED, "Unfulfilled"),
(PARTIALLY_FULFILLED, "Partially fulfilled"),
(PARTIALLY_RETURNED, "Partially returned"),
(RETURNED, "Returned"),
(FULFILLED, "Fulfilled"),
(CANCELED, "Canceled"),
]
class TransactionStatus:
CREATED = "CREATED" # The order was created with the specified context.
SAVED = "SAVED" # The order was saved and persisted. The order status continues to be in progress until a capture is made with final_capture = true for all purchase units within the order.
APPROVED = "APPROVED" # The customer approved the payment through the PayPal wallet or another form of guest or unbranded payment. For example, a card, bank account, or so on.
VOIDED = "VOIDED" # All purchase units in the order are voided.
COMPLETED = "COMPLETED" # The payment was authorized or the authorized payment was captured for the order.
PAYER_ACTION_REQUIRED = "PAYER_ACTION_REQUIRED" # The order requires an action from the payer (e.g. 3DS authentication). Redirect the payer to the "rel":"payer-action" HATEOAS link returned as part of the response prior to authorizing or capturing the order.
CHOICES = [
(CREATED, "Created"),
(SAVED, "Saved"),
(APPROVED, "Approved"),
(VOIDED, "Voided"),
(COMPLETED, "Completed"),
(PAYER_ACTION_REQUIRED, "Payer action required")
]
class ShippingMethodType:
PRICE_BASED = "price"
WEIGHT_BASED = "weight"
CHOICES = [
(PRICE_BASED, "Price based shipping"),
(WEIGHT_BASED, "Weight based shipping"),
]
class ShippingService:
FIRST_CLASS = "FIRST CLASS"
PRIORITY = "PRIORITY"
PRIORITY_COMMERCIAL = "PRIORITY COMMERCIAL"
CHOICES = [
(FIRST_CLASS, "First Class"),
(PRIORITY, "Priority"),
(PRIORITY_COMMERCIAL, "Priority Commercial")
]
class ShippingContainer:
LG_FLAT_RATE_BOX = "LG FLAT RATE BOX"
REGIONAL_RATE_BOX_A = "REGIONALRATEBOXA"
REGIONAL_RATE_BOX_B = "REGIONALRATEBOXB"
VARIABLE = "VARIABLE"
CHOICES = [
(LG_FLAT_RATE_BOX, "Flate Rate Box - Large"),
(REGIONAL_RATE_BOX_A, "Regional Rate Box A"),
(REGIONAL_RATE_BOX_B, "Regional Rate Box B"),
(VARIABLE, "Variable")
]