sslcommerz_client package

Submodules

sslcommerz_client.client module

class sslcommerz_client.client.SSLCommerzClient(store_id: str, store_passwd: str, sandbox: bool = False)[source]

Bases: object

property baseURL
property credential
get_order_validation_data(data: dict | OrderValidationPostData | IPNResponse)[source]

Get Order validation data from API.

get_refund_data(refund_ref_id: str)[source]

Get existing refund data.

get_transaction_by_id(tran_id: str)[source]

Get transactions by transaction id.

get_transaction_by_session(sessionkey: str)[source]

Get a transaction by sessionkey.

initiate_refund(data: dict | RefundRequestPostData)[source]

Initiate a refund.

initiate_session(postData: PaymentInitPostData | dict)[source]

Initiates an session.

validate_IPN(data: dict)[source]

Validate an IPN response.

sslcommerz_client.dataclasses module

class sslcommerz_client.dataclasses.APIConnectEnum(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: str, Enum

DONE = 'DONE'
FAILED = 'FAILED'
INACTIVE = 'INACTIVE'
INVALID_REQUEST = 'INVALID_REQUEST'
class sslcommerz_client.dataclasses.APIResponse(*, raw_data: Any = None, status_code: int, response: OrderValidationResponse | IPNResponse | PaymentInitResponse | RefundResponse | RefundInitiateResponse | TransactionBySessionResponse | TransactionsByIDResponse | None = None)[source]

Bases: BaseModel

dataclass for api response complete with raw response data, status_code and one of response objects for easy introspection.

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'raw_data': FieldInfo(annotation=Any, required=False), 'response': FieldInfo(annotation=Union[OrderValidationResponse, IPNResponse, PaymentInitResponse, RefundResponse, RefundInitiateResponse, TransactionBySessionResponse, TransactionsByIDResponse, NoneType], required=False), 'status_code': FieldInfo(annotation=int, required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

raw_data: Any
response: OrderValidationResponse | IPNResponse | PaymentInitResponse | RefundResponse | RefundInitiateResponse | TransactionBySessionResponse | TransactionsByIDResponse | None
status_code: int
class sslcommerz_client.dataclasses.BaseOrderResponse(*, tran_date: datetime, tran_id: str, val_id: str, amount: Decimal, store_amount: Decimal, card_type: str, card_no: str, currency: str, bank_tran_id: str, card_issuer: str, card_brand: str, card_issuer_country: str, card_issuer_country_code: str, currency_type: str, currency_amount: Decimal, currency_rate: Decimal, risk_level: RiskLevelEnum, risk_title: str, error: str | None = None, base_fair: Decimal | None = None, card_sub_brand: str | None = None, value_a: str | None = None, value_b: str | None = None, value_c: str | None = None, value_d: str | None = None)[source]

Bases: BaseModel

Base dataclass for Order and IPN.

amount: Decimal
bank_tran_id: str
base_fair: Decimal | None
card_brand: str
card_issuer: str
card_issuer_country: str
card_issuer_country_code: str
card_no: str
card_sub_brand: str | None
card_type: str
currency: str
currency_amount: Decimal
currency_rate: Decimal
currency_type: str
error: str | None
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'amount': FieldInfo(annotation=Decimal, required=True), 'bank_tran_id': FieldInfo(annotation=str, required=True), 'base_fair': FieldInfo(annotation=Union[Decimal, NoneType], required=False), 'card_brand': FieldInfo(annotation=str, required=True), 'card_issuer': FieldInfo(annotation=str, required=True), 'card_issuer_country': FieldInfo(annotation=str, required=True), 'card_issuer_country_code': FieldInfo(annotation=str, required=True), 'card_no': FieldInfo(annotation=str, required=True), 'card_sub_brand': FieldInfo(annotation=Union[str, NoneType], required=False), 'card_type': FieldInfo(annotation=str, required=True), 'currency': FieldInfo(annotation=str, required=True), 'currency_amount': FieldInfo(annotation=Decimal, required=True), 'currency_rate': FieldInfo(annotation=Decimal, required=True), 'currency_type': FieldInfo(annotation=str, required=True), 'error': FieldInfo(annotation=Union[str, NoneType], required=False), 'risk_level': FieldInfo(annotation=RiskLevelEnum, required=True), 'risk_title': FieldInfo(annotation=str, required=True), 'store_amount': FieldInfo(annotation=Decimal, required=True), 'tran_date': FieldInfo(annotation=datetime, required=True), 'tran_id': FieldInfo(annotation=str, required=True), 'val_id': FieldInfo(annotation=str, required=True), 'value_a': FieldInfo(annotation=Union[str, NoneType], required=False), 'value_b': FieldInfo(annotation=Union[str, NoneType], required=False), 'value_c': FieldInfo(annotation=Union[str, NoneType], required=False), 'value_d': FieldInfo(annotation=Union[str, NoneType], required=False)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

risk_level: RiskLevelEnum
risk_title: str
store_amount: Decimal
tran_date: datetime
tran_id: str
val_id: str
value_a: str | None
value_b: str | None
value_c: str | None
value_d: str | None
class sslcommerz_client.dataclasses.BooleanIntEnum(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: int, Enum

FALSE = 0
TRUE = 1
class sslcommerz_client.dataclasses.CartItem(*, product: str, quantity: int, amount: Decimal)[source]

Bases: BaseModel

Dataclass for cart items in PaymentInitPostData.

amount: Decimal
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'amount': FieldInfo(annotation=Decimal, required=True), 'product': FieldInfo(annotation=str, required=True), 'quantity': FieldInfo(annotation=int, required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

classmethod not_more_than_255(v: str, info: ValidationInfo)[source]
product: str
quantity: int
classmethod valid_decimal(v, info: ValidationInfo)[source]
class sslcommerz_client.dataclasses.Credential(*, store_id: str, store_passwd: str)[source]

Bases: BaseModel

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'store_id': FieldInfo(annotation=str, required=True), 'store_passwd': FieldInfo(annotation=str, required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

store_id: str
store_passwd: str
class sslcommerz_client.dataclasses.EMIOptionsEnum(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: int, Enum

NINE_MONTHS = 9
SIX_MONTHS = 6
THREE_MONTHS = 3
class sslcommerz_client.dataclasses.EMIOptionsResponseEnum(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: str, Enum

NINE_MONTHS = '9'
NONE = '0'
SIX_MONTHS = '6'
THREE_MONTHS = '3'
class sslcommerz_client.dataclasses.Gateway(*, name: str, type: str, logo: str | None = None, gw: str | None = None, r_flag: str | None = None, redirectGatewayURL: str | None = None)[source]

Bases: BaseModel

gw: str | None
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'gw': FieldInfo(annotation=Union[str, NoneType], required=False), 'logo': FieldInfo(annotation=Union[str, NoneType], required=False), 'name': FieldInfo(annotation=str, required=True), 'r_flag': FieldInfo(annotation=Union[str, NoneType], required=False), 'redirectGatewayURL': FieldInfo(annotation=Union[str, NoneType], required=False), 'type': FieldInfo(annotation=str, required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

name: str
r_flag: str | None
redirectGatewayURL: str | None
type: str
class sslcommerz_client.dataclasses.IPNOrderStatusEnum(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: str, Enum

CANCELLED = 'CANCELLED'
EXPIRED = 'EXPIRED'
FAILED = 'FAILED'
UNATTEMPTED = 'UNATTEMPTED'
VALID = 'VALID'
class sslcommerz_client.dataclasses.IPNResponse(*, tran_date: datetime, tran_id: str, val_id: str, amount: Decimal, store_amount: Decimal, card_type: str, card_no: str, currency: str, bank_tran_id: str, card_issuer: str, card_brand: str, card_issuer_country: str, card_issuer_country_code: str, currency_type: str, currency_amount: Decimal, currency_rate: Decimal, risk_level: RiskLevelEnum, risk_title: str, error: str | None = None, base_fair: Decimal | None = None, card_sub_brand: str | None = None, value_a: str | None = None, value_b: str | None = None, value_c: str | None = None, value_d: str | None = None, store_id: str, status: IPNOrderStatusEnum, verify_sign: str, verify_key: str, verify_sign_sha2: str | None = None)[source]

Bases: BaseOrderResponse

IPN response dataclass with validation

get_hash(credential: ~sslcommerz_client.dataclasses.Credential, hasher=<built-in function openssl_md5>)[source]
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'amount': FieldInfo(annotation=Decimal, required=True), 'bank_tran_id': FieldInfo(annotation=str, required=True), 'base_fair': FieldInfo(annotation=Union[Decimal, NoneType], required=False), 'card_brand': FieldInfo(annotation=str, required=True), 'card_issuer': FieldInfo(annotation=str, required=True), 'card_issuer_country': FieldInfo(annotation=str, required=True), 'card_issuer_country_code': FieldInfo(annotation=str, required=True), 'card_no': FieldInfo(annotation=str, required=True), 'card_sub_brand': FieldInfo(annotation=Union[str, NoneType], required=False), 'card_type': FieldInfo(annotation=str, required=True), 'currency': FieldInfo(annotation=str, required=True), 'currency_amount': FieldInfo(annotation=Decimal, required=True), 'currency_rate': FieldInfo(annotation=Decimal, required=True), 'currency_type': FieldInfo(annotation=str, required=True), 'error': FieldInfo(annotation=Union[str, NoneType], required=False), 'risk_level': FieldInfo(annotation=RiskLevelEnum, required=True), 'risk_title': FieldInfo(annotation=str, required=True), 'status': FieldInfo(annotation=IPNOrderStatusEnum, required=True), 'store_amount': FieldInfo(annotation=Decimal, required=True), 'store_id': FieldInfo(annotation=str, required=True), 'tran_date': FieldInfo(annotation=datetime, required=True), 'tran_id': FieldInfo(annotation=str, required=True), 'val_id': FieldInfo(annotation=str, required=True), 'value_a': FieldInfo(annotation=Union[str, NoneType], required=False), 'value_b': FieldInfo(annotation=Union[str, NoneType], required=False), 'value_c': FieldInfo(annotation=Union[str, NoneType], required=False), 'value_d': FieldInfo(annotation=Union[str, NoneType], required=False), 'verify_key': FieldInfo(annotation=str, required=True), 'verify_sign': FieldInfo(annotation=str, required=True), 'verify_sign_sha2': FieldInfo(annotation=Union[str, NoneType], required=False)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

status: IPNOrderStatusEnum
store_id: str
validate_against_credential(credential: Credential | dict)[source]
verify_key: str
verify_sign: str
verify_sign_sha2: str | None
class sslcommerz_client.dataclasses.IPNValidationStatus(*, status: bool, response: IPNResponse)[source]

Bases: BaseModel

IPN validation result’s dataclass.

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'response': FieldInfo(annotation=IPNResponse, required=True), 'status': FieldInfo(annotation=bool, required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

response: IPNResponse
status: bool
class sslcommerz_client.dataclasses.MultiCardNamesEnum(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: str, Enum

ABBANK = 'abbank'
AMEX_CARD = 'amexcard'
BANK_ASIA = 'bankasia'
BKASH = 'bkash'
BRAC_MASTER = 'brac_master'
BRAC_VISA = 'brac_visa'
CITY = 'city'
CITY_AMEX = 'city_amex'
CITY_MASTER = 'city_master'
CITY_VISA = 'city_visa'
DBBL_MASTER = 'dbbl_master'
DBBL_MOBILE_BANKING = 'dbblmobilebanking'
DBBL_NEXUS = 'dbbl_nexus'
DBBL_VISA = 'dbbl_visa'
EBL_MASTER = 'ebl_master'
EBL_VISA = 'ebl_visa'
IBBL = 'ibbl'
INTERNET_BANK = 'internetbank'
MASTER_CARD = 'mastercard'
MOBILE_BANK = 'mobilebank'
MTBL = 'mtbl'
OTHER_CARD = 'othercard'
QCASH = 'qcash'
SBL_MASTER = 'sbl_master'
SBL_VISA = 'sbl_visa'
TAPNPAY = 'tapnpay'
UPAY = 'upay'
VISA_CARD = 'visacard'
class sslcommerz_client.dataclasses.OrderStatusEnum(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: str, Enum

INVALID_TRANSACTION = 'INVALID_TRANSACTION'
VALID = 'VALID'
VALIDATED = 'VALIDATED'
class sslcommerz_client.dataclasses.OrderValidationPostData(*, val_id: str, v: int | None = None)[source]

Bases: BaseModel

Dataclass for Order validation API post data.

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'v': FieldInfo(annotation=Union[int, NoneType], required=False), 'val_id': FieldInfo(annotation=str, required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

classmethod not_more_than_fifty(v, info: ValidationInfo)[source]
v: int | None
val_id: str
classmethod validate_v(v)[source]
class sslcommerz_client.dataclasses.OrderValidationResponse(*, tran_date: datetime, tran_id: str, val_id: str, amount: Decimal, store_amount: Decimal, card_type: str, card_no: str, currency: str, bank_tran_id: str, card_issuer: str, card_brand: str, card_issuer_country: str, card_issuer_country_code: str, currency_type: str, currency_amount: Decimal, currency_rate: Decimal, risk_level: RiskLevelEnum, risk_title: str, error: str | None = None, base_fair: Decimal | None = None, card_sub_brand: str | None = None, value_a: str | None = None, value_b: str | None = None, value_c: str | None = None, value_d: str | None = None, status: OrderStatusEnum, emi_instalment: EMIOptionsResponseEnum, discount_amount: Decimal, discount_percentage: Decimal, discount_remarks: str)[source]

Bases: BaseOrderResponse

Order validation response.

discount_amount: Decimal
discount_percentage: Decimal
discount_remarks: str
emi_instalment: EMIOptionsResponseEnum
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'amount': FieldInfo(annotation=Decimal, required=True), 'bank_tran_id': FieldInfo(annotation=str, required=True), 'base_fair': FieldInfo(annotation=Union[Decimal, NoneType], required=False), 'card_brand': FieldInfo(annotation=str, required=True), 'card_issuer': FieldInfo(annotation=str, required=True), 'card_issuer_country': FieldInfo(annotation=str, required=True), 'card_issuer_country_code': FieldInfo(annotation=str, required=True), 'card_no': FieldInfo(annotation=str, required=True), 'card_sub_brand': FieldInfo(annotation=Union[str, NoneType], required=False), 'card_type': FieldInfo(annotation=str, required=True), 'currency': FieldInfo(annotation=str, required=True), 'currency_amount': FieldInfo(annotation=Decimal, required=True), 'currency_rate': FieldInfo(annotation=Decimal, required=True), 'currency_type': FieldInfo(annotation=str, required=True), 'discount_amount': FieldInfo(annotation=Decimal, required=True), 'discount_percentage': FieldInfo(annotation=Decimal, required=True), 'discount_remarks': FieldInfo(annotation=str, required=True), 'emi_instalment': FieldInfo(annotation=EMIOptionsResponseEnum, required=True), 'error': FieldInfo(annotation=Union[str, NoneType], required=False), 'risk_level': FieldInfo(annotation=RiskLevelEnum, required=True), 'risk_title': FieldInfo(annotation=str, required=True), 'status': FieldInfo(annotation=OrderStatusEnum, required=True), 'store_amount': FieldInfo(annotation=Decimal, required=True), 'tran_date': FieldInfo(annotation=datetime, required=True), 'tran_id': FieldInfo(annotation=str, required=True), 'val_id': FieldInfo(annotation=str, required=True), 'value_a': FieldInfo(annotation=Union[str, NoneType], required=False), 'value_b': FieldInfo(annotation=Union[str, NoneType], required=False), 'value_c': FieldInfo(annotation=Union[str, NoneType], required=False), 'value_d': FieldInfo(annotation=Union[str, NoneType], required=False)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

status: OrderStatusEnum
class sslcommerz_client.dataclasses.PaymentInitPostData(*, total_amount: Decimal, currency: str, tran_id: str, product_category: str, success_url: Url, fail_url: Url, cancel_url: Url, emi_option: BooleanIntEnum = BooleanIntEnum.FALSE, cus_name: str, cus_email: str, cus_add1: str, cus_city: str, cus_country: str, cus_phone: str, shipping_method: ShippingMethodEnum = ShippingMethodEnum.YES, num_of_item: int, product_name: str, product_profile: ProductProfileEnum, ipn_url: str | None = None, multi_card_name: MultiCardNamesEnum | None = None, allowed_bin: str | None = None, emi_max_inst_option: EMIOptionsEnum | None = None, emi_selected_inst: EMIOptionsEnum | None = None, emi_allow_only: int | None = None, cus_add2: str | None = None, cus_postcode: str | None = None, cus_state: str | None = None, cus_fax: str | None = None, ship_name: str | None = None, ship_add1: str | None = None, ship_add2: str | None = None, ship_city: str | None = None, ship_postcode: str | None = None, ship_country: str | None = None, ship_phone: str | None = None, ship_state: str | None = None, hours_till_departure: str | None = None, flight_type: str | None = None, pnr: str | None = None, journey_from_to: str | None = None, third_party_booking: str | None = None, hotel_name: str | None = None, length_of_stay: str | None = None, check_in_time: str | None = None, hotel_city: str | None = None, product_type: str | None = None, topup_number: str | None = None, country_topup: str | None = None, cart: List[CartItem] | None = None, product_amount: Decimal | None = None, vat: Decimal | None = None, discount_amount: Decimal | None = None, convenience_fee: Decimal | None = None, value_a: str | None = None, value_b: str | None = None, value_c: str | None = None, value_d: str | None = None)[source]

Bases: BaseModel

Dataclass for session initiation post data.

allowed_bin: str | None
cancel_url: Url
cart: List[CartItem] | None
classmethod check_cart_items(v)[source]
check_in_time: str | None
convenience_fee: Decimal | None
country_topup: str | None
currency: str
cus_add1: str
cus_add2: str | None
cus_city: str
cus_country: str
cus_email: str
cus_fax: str | None
cus_name: str
cus_phone: str
cus_postcode: str | None
cus_state: str | None
discount_amount: Decimal | None
emi_allow_only: int | None
emi_max_inst_option: EMIOptionsEnum | None
emi_option: BooleanIntEnum
emi_selected_inst: EMIOptionsEnum | None
fail_url: Url
flight_type: str | None
hotel_city: str | None
hotel_name: str | None
hours_till_departure: str | None
ipn_url: str | None
journey_from_to: str | None
length_of_stay: str | None
classmethod mandatory_if_airline_tickets(v, info: ValidationInfo)[source]
classmethod mandatory_if_telecom_vertical(v, info: ValidationInfo)[source]
classmethod mandatory_if_travel_vertical(v, info: ValidationInfo)[source]
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'allowed_bin': FieldInfo(annotation=Union[str, NoneType], required=False), 'cancel_url': FieldInfo(annotation=Url, required=True, metadata=[UrlConstraints(max_length=None, allowed_schemes=['http', 'https'], host_required=None, default_host=None, default_port=None, default_path=None)]), 'cart': FieldInfo(annotation=Union[List[CartItem], NoneType], required=False), 'check_in_time': FieldInfo(annotation=Union[str, NoneType], required=False), 'convenience_fee': FieldInfo(annotation=Union[Decimal, NoneType], required=False), 'country_topup': FieldInfo(annotation=Union[str, NoneType], required=False), 'currency': FieldInfo(annotation=str, required=True), 'cus_add1': FieldInfo(annotation=str, required=True), 'cus_add2': FieldInfo(annotation=Union[str, NoneType], required=False), 'cus_city': FieldInfo(annotation=str, required=True), 'cus_country': FieldInfo(annotation=str, required=True), 'cus_email': FieldInfo(annotation=str, required=True), 'cus_fax': FieldInfo(annotation=Union[str, NoneType], required=False), 'cus_name': FieldInfo(annotation=str, required=True), 'cus_phone': FieldInfo(annotation=str, required=True), 'cus_postcode': FieldInfo(annotation=Union[str, NoneType], required=False), 'cus_state': FieldInfo(annotation=Union[str, NoneType], required=False), 'discount_amount': FieldInfo(annotation=Union[Decimal, NoneType], required=False), 'emi_allow_only': FieldInfo(annotation=Union[int, NoneType], required=False), 'emi_max_inst_option': FieldInfo(annotation=Union[EMIOptionsEnum, NoneType], required=False), 'emi_option': FieldInfo(annotation=BooleanIntEnum, required=False, default=<BooleanIntEnum.FALSE: 0>), 'emi_selected_inst': FieldInfo(annotation=Union[EMIOptionsEnum, NoneType], required=False), 'fail_url': FieldInfo(annotation=Url, required=True, metadata=[UrlConstraints(max_length=None, allowed_schemes=['http', 'https'], host_required=None, default_host=None, default_port=None, default_path=None)]), 'flight_type': FieldInfo(annotation=Union[str, NoneType], required=False), 'hotel_city': FieldInfo(annotation=Union[str, NoneType], required=False), 'hotel_name': FieldInfo(annotation=Union[str, NoneType], required=False), 'hours_till_departure': FieldInfo(annotation=Union[str, NoneType], required=False), 'ipn_url': FieldInfo(annotation=Union[str, NoneType], required=False), 'journey_from_to': FieldInfo(annotation=Union[str, NoneType], required=False), 'length_of_stay': FieldInfo(annotation=Union[str, NoneType], required=False), 'multi_card_name': FieldInfo(annotation=Union[MultiCardNamesEnum, NoneType], required=False), 'num_of_item': FieldInfo(annotation=int, required=True), 'pnr': FieldInfo(annotation=Union[str, NoneType], required=False), 'product_amount': FieldInfo(annotation=Union[Decimal, NoneType], required=False), 'product_category': FieldInfo(annotation=str, required=True), 'product_name': FieldInfo(annotation=str, required=True), 'product_profile': FieldInfo(annotation=ProductProfileEnum, required=True), 'product_type': FieldInfo(annotation=Union[str, NoneType], required=False), 'ship_add1': FieldInfo(annotation=Union[str, NoneType], required=False), 'ship_add2': FieldInfo(annotation=Union[str, NoneType], required=False), 'ship_city': FieldInfo(annotation=Union[str, NoneType], required=False), 'ship_country': FieldInfo(annotation=Union[str, NoneType], required=False), 'ship_name': FieldInfo(annotation=Union[str, NoneType], required=False), 'ship_phone': FieldInfo(annotation=Union[str, NoneType], required=False), 'ship_postcode': FieldInfo(annotation=Union[str, NoneType], required=False), 'ship_state': FieldInfo(annotation=Union[str, NoneType], required=False), 'shipping_method': FieldInfo(annotation=ShippingMethodEnum, required=False, default=<ShippingMethodEnum.YES: 'YES'>), 'success_url': FieldInfo(annotation=Url, required=True, metadata=[UrlConstraints(max_length=None, allowed_schemes=['http', 'https'], host_required=None, default_host=None, default_port=None, default_path=None)]), 'third_party_booking': FieldInfo(annotation=Union[str, NoneType], required=False), 'topup_number': FieldInfo(annotation=Union[str, NoneType], required=False), 'total_amount': FieldInfo(annotation=Decimal, required=True), 'tran_id': FieldInfo(annotation=str, required=True), 'value_a': FieldInfo(annotation=Union[str, NoneType], required=False), 'value_b': FieldInfo(annotation=Union[str, NoneType], required=False), 'value_c': FieldInfo(annotation=Union[str, NoneType], required=False), 'value_d': FieldInfo(annotation=Union[str, NoneType], required=False), 'vat': FieldInfo(annotation=Union[Decimal, NoneType], required=False)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

multi_card_name: MultiCardNamesEnum | None
classmethod not_more_than_255(v, info: ValidationInfo)[source]
classmethod not_more_than_fifty(v, info: ValidationInfo)[source]
classmethod not_more_than_hundred(v, info: ValidationInfo)[source]
classmethod not_more_than_hundred_fifty(v, info: ValidationInfo)[source]
classmethod not_more_than_thirty(v, info: ValidationInfo)[source]
classmethod not_more_than_three(v, info: ValidationInfo)[source]
num_of_item: int
pnr: str | None
product_amount: Decimal | None
product_category: str
product_name: str
product_profile: ProductProfileEnum
product_type: str | None
ship_add1: str | None
ship_add2: str | None
ship_city: str | None
ship_country: str | None
ship_name: str | None
ship_phone: str | None
ship_postcode: str | None
ship_state: str | None
shipping_method: ShippingMethodEnum
success_url: Url
third_party_booking: str | None
topup_number: str | None
total_amount: Decimal
tran_id: str
classmethod valid_decimal(v, info: ValidationInfo)[source]
classmethod valid_emi_allow_only(v, info: ValidationInfo)[source]
classmethod validate_based_on_shipping_method(v, info: ValidationInfo)[source]
classmethod validate_num_of_item(v)[source]
value_a: str | None
value_b: str | None
value_c: str | None
value_d: str | None
vat: Decimal | None
class sslcommerz_client.dataclasses.PaymentInitResponse(*, status: ResponseStatusEnum, failedreason: str | None = None, sessionkey: str | None = None, gw: Any | None = None, redirectGatewayURL: str | None = None, directPaymentURLBank: str | None = None, directPaymentURLCard: str | None = None, directPaymentURL: str | None = None, redirectGatewayURLFailed: str | None = None, GatewayPageURL: str | None = None, storeBanner: str | None = None, storeLogo: str | None = None, desc: List[Gateway] | None = None)[source]

Bases: BaseModel

Payment initiation response as a dataclass.

GatewayPageURL: str | None
desc: List[Gateway] | None
directPaymentURL: str | None
directPaymentURLBank: str | None
directPaymentURLCard: str | None
failedreason: str | None
gw: Any | None
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'GatewayPageURL': FieldInfo(annotation=Union[str, NoneType], required=False), 'desc': FieldInfo(annotation=Union[List[Gateway], NoneType], required=False), 'directPaymentURL': FieldInfo(annotation=Union[str, NoneType], required=False), 'directPaymentURLBank': FieldInfo(annotation=Union[str, NoneType], required=False), 'directPaymentURLCard': FieldInfo(annotation=Union[str, NoneType], required=False), 'failedreason': FieldInfo(annotation=Union[str, NoneType], required=False), 'gw': FieldInfo(annotation=Union[Any, NoneType], required=False), 'redirectGatewayURL': FieldInfo(annotation=Union[str, NoneType], required=False), 'redirectGatewayURLFailed': FieldInfo(annotation=Union[str, NoneType], required=False), 'sessionkey': FieldInfo(annotation=Union[str, NoneType], required=False), 'status': FieldInfo(annotation=ResponseStatusEnum, required=True), 'storeBanner': FieldInfo(annotation=Union[str, NoneType], required=False), 'storeLogo': FieldInfo(annotation=Union[str, NoneType], required=False)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

redirectGatewayURL: str | None
redirectGatewayURLFailed: str | None
sessionkey: str | None
status: ResponseStatusEnum
storeBanner: str | None
class sslcommerz_client.dataclasses.ProductProfileEnum(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: str, Enum

AIRLINE_TICKETS = 'airline-tickets'
GENERAL = 'general'
NON_PHYSICAL_GOODS = 'non-physical-goods'
PHYSICAL_GOODS = 'physical-goods'
TELECOM_VERTICAL = 'telecom-vertical'
TRAVEL_VERTICAL = 'travel-vertical'
class sslcommerz_client.dataclasses.RefundInitiateResponse(*, APIConnect: APIConnectEnum, bank_tran_id: str, trans_id: str | None = None, refund_ref_id: str | None = None, status: RefundStatusEnum, errorReason: str | None = None)[source]

Bases: BaseModel

Refund initiation response.

APIConnect: APIConnectEnum
bank_tran_id: str
errorReason: str | None
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'APIConnect': FieldInfo(annotation=APIConnectEnum, required=True), 'bank_tran_id': FieldInfo(annotation=str, required=True), 'errorReason': FieldInfo(annotation=Union[str, NoneType], required=False), 'refund_ref_id': FieldInfo(annotation=Union[str, NoneType], required=False), 'status': FieldInfo(annotation=RefundStatusEnum, required=True), 'trans_id': FieldInfo(annotation=Union[str, NoneType], required=False)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

refund_ref_id: str | None
status: RefundStatusEnum
trans_id: str | None
class sslcommerz_client.dataclasses.RefundRequestPostData(*, bank_tran_id: str, refund_amount: str, refund_remarks: str, refe_id: str)[source]

Bases: BaseModel

Dataclass for Refund API post data.

bank_tran_id: str
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'bank_tran_id': FieldInfo(annotation=str, required=True), 'refe_id': FieldInfo(annotation=str, required=True), 'refund_amount': FieldInfo(annotation=str, required=True), 'refund_remarks': FieldInfo(annotation=str, required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

classmethod not_more_than_255(v, info: ValidationInfo)[source]
classmethod not_more_than_eighty(v, info: ValidationInfo)[source]
classmethod not_more_than_fifty(v, info: ValidationInfo)[source]
refe_id: str
refund_amount: str
refund_remarks: str
classmethod valid_decimal(v, info: ValidationInfo)[source]
class sslcommerz_client.dataclasses.RefundResponse(*, APIConnect: APIConnectEnum, bank_tran_id: str, trans_id: str | None = None, refund_ref_id: str | None = None, status: RefundStatusEnum, errorReason: str | None = None, initiated_on: datetime, refunded_on: datetime)[source]

Bases: RefundInitiateResponse

Refund response.

initiated_on: datetime
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'APIConnect': FieldInfo(annotation=APIConnectEnum, required=True), 'bank_tran_id': FieldInfo(annotation=str, required=True), 'errorReason': FieldInfo(annotation=Union[str, NoneType], required=False), 'initiated_on': FieldInfo(annotation=datetime, required=True), 'refund_ref_id': FieldInfo(annotation=Union[str, NoneType], required=False), 'refunded_on': FieldInfo(annotation=datetime, required=True), 'status': FieldInfo(annotation=RefundStatusEnum, required=True), 'trans_id': FieldInfo(annotation=Union[str, NoneType], required=False)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

refunded_on: datetime
class sslcommerz_client.dataclasses.RefundStatusEnum(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: str, Enum

FAILED = 'failed'
PROCESSING = 'processing'
SUCCESS = 'success'
class sslcommerz_client.dataclasses.ResponseStatusEnum(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: str, Enum

FAILED = 'FAILED'
SUCCESS = 'SUCCESS'
class sslcommerz_client.dataclasses.RiskLevelEnum(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: str, Enum

HIGH = '1'
LOW = '0'
class sslcommerz_client.dataclasses.Session(*, status: str, tran_date: datetime, tran_id: str, val_id: str, amount: Decimal, store_amount: Decimal, card_type: str, card_no: str, bank_tran_id: str, card_issuer: str, card_brand: str, card_issuer_country: str, card_issuer_country_code: str, currency_type: str, currency_amount: Decimal, risk_level: RiskLevelEnum, risk_title: str, sessionkey: str | None = None, error: str | None = None, currency: str | None = None, emi_instalment: Decimal | str | None = None, emi_amount: Decimal | str | None = None, discount_percentage: Decimal | str | None = None, discount_remarks: str | None = None, value_a: str | None = None, value_b: str | None = None, value_c: str | None = None, value_d: str | None = None)[source]

Bases: BaseModel

Dataclass for transaction session.

amount: Decimal
bank_tran_id: str
card_brand: str
card_issuer: str
card_issuer_country: str
card_issuer_country_code: str
card_no: str
card_type: str
currency: str | None
currency_amount: Decimal
currency_type: str
discount_percentage: Decimal | str | None
discount_remarks: str | None
emi_amount: Decimal | str | None
emi_instalment: Decimal | str | None
error: str | None
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'amount': FieldInfo(annotation=Decimal, required=True), 'bank_tran_id': FieldInfo(annotation=str, required=True), 'card_brand': FieldInfo(annotation=str, required=True), 'card_issuer': FieldInfo(annotation=str, required=True), 'card_issuer_country': FieldInfo(annotation=str, required=True), 'card_issuer_country_code': FieldInfo(annotation=str, required=True), 'card_no': FieldInfo(annotation=str, required=True), 'card_type': FieldInfo(annotation=str, required=True), 'currency': FieldInfo(annotation=Union[str, NoneType], required=False), 'currency_amount': FieldInfo(annotation=Decimal, required=True), 'currency_type': FieldInfo(annotation=str, required=True), 'discount_percentage': FieldInfo(annotation=Union[Decimal, str, NoneType], required=False), 'discount_remarks': FieldInfo(annotation=Union[str, NoneType], required=False), 'emi_amount': FieldInfo(annotation=Union[Decimal, str, NoneType], required=False), 'emi_instalment': FieldInfo(annotation=Union[Decimal, str, NoneType], required=False), 'error': FieldInfo(annotation=Union[str, NoneType], required=False), 'risk_level': FieldInfo(annotation=RiskLevelEnum, required=True), 'risk_title': FieldInfo(annotation=str, required=True), 'sessionkey': FieldInfo(annotation=Union[str, NoneType], required=False), 'status': FieldInfo(annotation=str, required=True), 'store_amount': FieldInfo(annotation=Decimal, required=True), 'tran_date': FieldInfo(annotation=datetime, required=True), 'tran_id': FieldInfo(annotation=str, required=True), 'val_id': FieldInfo(annotation=str, required=True), 'value_a': FieldInfo(annotation=Union[str, NoneType], required=False), 'value_b': FieldInfo(annotation=Union[str, NoneType], required=False), 'value_c': FieldInfo(annotation=Union[str, NoneType], required=False), 'value_d': FieldInfo(annotation=Union[str, NoneType], required=False)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

risk_level: RiskLevelEnum
risk_title: str
sessionkey: str | None
status: str
store_amount: Decimal
tran_date: datetime
tran_id: str
val_id: str
value_a: str | None
value_b: str | None
value_c: str | None
value_d: str | None
class sslcommerz_client.dataclasses.ShippingMethodEnum(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: str, Enum

COURIER = 'Courier'
NO = 'NO'
YES = 'YES'
class sslcommerz_client.dataclasses.TransactionBySessionResponse(*, status: str, tran_date: datetime, tran_id: str, val_id: str, amount: Decimal, store_amount: Decimal, card_type: str, card_no: str, bank_tran_id: str, card_issuer: str, card_brand: str, card_issuer_country: str, card_issuer_country_code: str, currency_type: str, currency_amount: Decimal, risk_level: RiskLevelEnum, risk_title: str, sessionkey: str | None = None, error: str | None = None, currency: str | None = None, emi_instalment: Decimal | str | None = None, emi_amount: Decimal | str | None = None, discount_percentage: Decimal | str | None = None, discount_remarks: str | None = None, value_a: str | None = None, value_b: str | None = None, value_c: str | None = None, value_d: str | None = None, APIConnect: APIConnectEnum)[source]

Bases: Session

Dataclass for transaction by session query.

APIConnect: APIConnectEnum
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'APIConnect': FieldInfo(annotation=APIConnectEnum, required=True), 'amount': FieldInfo(annotation=Decimal, required=True), 'bank_tran_id': FieldInfo(annotation=str, required=True), 'card_brand': FieldInfo(annotation=str, required=True), 'card_issuer': FieldInfo(annotation=str, required=True), 'card_issuer_country': FieldInfo(annotation=str, required=True), 'card_issuer_country_code': FieldInfo(annotation=str, required=True), 'card_no': FieldInfo(annotation=str, required=True), 'card_type': FieldInfo(annotation=str, required=True), 'currency': FieldInfo(annotation=Union[str, NoneType], required=False), 'currency_amount': FieldInfo(annotation=Decimal, required=True), 'currency_type': FieldInfo(annotation=str, required=True), 'discount_percentage': FieldInfo(annotation=Union[Decimal, str, NoneType], required=False), 'discount_remarks': FieldInfo(annotation=Union[str, NoneType], required=False), 'emi_amount': FieldInfo(annotation=Union[Decimal, str, NoneType], required=False), 'emi_instalment': FieldInfo(annotation=Union[Decimal, str, NoneType], required=False), 'error': FieldInfo(annotation=Union[str, NoneType], required=False), 'risk_level': FieldInfo(annotation=RiskLevelEnum, required=True), 'risk_title': FieldInfo(annotation=str, required=True), 'sessionkey': FieldInfo(annotation=Union[str, NoneType], required=False), 'status': FieldInfo(annotation=str, required=True), 'store_amount': FieldInfo(annotation=Decimal, required=True), 'tran_date': FieldInfo(annotation=datetime, required=True), 'tran_id': FieldInfo(annotation=str, required=True), 'val_id': FieldInfo(annotation=str, required=True), 'value_a': FieldInfo(annotation=Union[str, NoneType], required=False), 'value_b': FieldInfo(annotation=Union[str, NoneType], required=False), 'value_c': FieldInfo(annotation=Union[str, NoneType], required=False), 'value_d': FieldInfo(annotation=Union[str, NoneType], required=False)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

class sslcommerz_client.dataclasses.TransactionsByIDResponse(*, APIConnect: APIConnectEnum, no_of_trans_found: int, element: List[Session])[source]

Bases: BaseModel

Dataclass for transactions by ID query.

APIConnect: APIConnectEnum
element: List[Session]
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'APIConnect': FieldInfo(annotation=APIConnectEnum, required=True), 'element': FieldInfo(annotation=List[Session], required=True), 'no_of_trans_found': FieldInfo(annotation=int, required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

no_of_trans_found: int

Module contents