freeleaps-service-hub/apps/payment/backend/infra/payment/constants.py

40 lines
764 B
Python

from enum import IntEnum
from backend.services.common.constants import UserRegion
class TransactionStatus(IntEnum):
PENDING = 0
IN_PROGRESS = 1
COMPLETED = 2
class MoneyCollectionType(IntEnum):
UNSPECIFIED = 0
MARKED_AS_PAID = 1
UPLOAD_PROOF = 2
STRIPE_CHECKOUT = 4
class PaymentLocation(IntEnum):
UNSPECIFIED = 0
CHINA_MAINLAND = 1
INTERNATIONAL = 2
class Currency(IntEnum):
UNKNOWN = 0
USD = 1
CNY = 2
RegionalCurrency = {
PaymentLocation.UNSPECIFIED: Currency.UNKNOWN.name,
PaymentLocation.CHINA_MAINLAND: Currency.CNY.name,
PaymentLocation.INTERNATIONAL: Currency.USD.name,
}
UserRegionToCurrency = {
UserRegion.ZH_CN: Currency.CNY.name,
UserRegion.OTHER: Currency.USD.name,
}