Payment Gateways¶
The internet_payment_gateways adapter provides integration with internet payment gateways. Currently supports Parsian
Shaparak, an Iranian payment gateway.
Parsian Shaparak¶
Adapters¶
Concrete Parsian Shaparak payment gateway adapter implementing payment initiation, verification, and reversal.
archipy.adapters.internet_payment_gateways.ir.parsian.adapters.logger
module-attribute
¶
archipy.adapters.internet_payment_gateways.ir.parsian.adapters.PaymentRequestDTO ¶
Bases: BaseDTO
DTO for initiating a payment request.
Source code in archipy/adapters/internet_payment_gateways/ir/parsian/adapters.py
archipy.adapters.internet_payment_gateways.ir.parsian.adapters.PaymentRequestDTO.amount
class-attribute
instance-attribute
¶
archipy.adapters.internet_payment_gateways.ir.parsian.adapters.PaymentRequestDTO.order_id
class-attribute
instance-attribute
¶
archipy.adapters.internet_payment_gateways.ir.parsian.adapters.PaymentRequestDTO.callback_url
class-attribute
instance-attribute
¶
archipy.adapters.internet_payment_gateways.ir.parsian.adapters.PaymentRequestDTO.additional_data
class-attribute
instance-attribute
¶
archipy.adapters.internet_payment_gateways.ir.parsian.adapters.PaymentRequestDTO.originator
class-attribute
instance-attribute
¶
archipy.adapters.internet_payment_gateways.ir.parsian.adapters.PaymentRequestDTO.model_config
class-attribute
instance-attribute
¶
model_config = ConfigDict(
extra="ignore",
validate_default=True,
from_attributes=True,
frozen=True,
str_strip_whitespace=True,
arbitrary_types_allowed=True,
)
archipy.adapters.internet_payment_gateways.ir.parsian.adapters.PaymentResponseDTO ¶
Bases: BaseDTO
DTO for payment response.
Source code in archipy/adapters/internet_payment_gateways/ir/parsian/adapters.py
archipy.adapters.internet_payment_gateways.ir.parsian.adapters.PaymentResponseDTO.token
class-attribute
instance-attribute
¶
archipy.adapters.internet_payment_gateways.ir.parsian.adapters.PaymentResponseDTO.status
class-attribute
instance-attribute
¶
archipy.adapters.internet_payment_gateways.ir.parsian.adapters.PaymentResponseDTO.message
class-attribute
instance-attribute
¶
archipy.adapters.internet_payment_gateways.ir.parsian.adapters.PaymentResponseDTO.model_config
class-attribute
instance-attribute
¶
model_config = ConfigDict(
extra="ignore",
validate_default=True,
from_attributes=True,
frozen=True,
str_strip_whitespace=True,
arbitrary_types_allowed=True,
)
archipy.adapters.internet_payment_gateways.ir.parsian.adapters.ConfirmRequestDTO ¶
Bases: BaseDTO
DTO for confirming a payment.
Source code in archipy/adapters/internet_payment_gateways/ir/parsian/adapters.py
archipy.adapters.internet_payment_gateways.ir.parsian.adapters.ConfirmRequestDTO.token
class-attribute
instance-attribute
¶
archipy.adapters.internet_payment_gateways.ir.parsian.adapters.ConfirmRequestDTO.model_config
class-attribute
instance-attribute
¶
model_config = ConfigDict(
extra="ignore",
validate_default=True,
from_attributes=True,
frozen=True,
str_strip_whitespace=True,
arbitrary_types_allowed=True,
)
archipy.adapters.internet_payment_gateways.ir.parsian.adapters.ConfirmResponseDTO ¶
Bases: BaseDTO
DTO for confirm payment response.
Source code in archipy/adapters/internet_payment_gateways/ir/parsian/adapters.py
archipy.adapters.internet_payment_gateways.ir.parsian.adapters.ConfirmResponseDTO.status
class-attribute
instance-attribute
¶
archipy.adapters.internet_payment_gateways.ir.parsian.adapters.ConfirmResponseDTO.rrn
class-attribute
instance-attribute
¶
archipy.adapters.internet_payment_gateways.ir.parsian.adapters.ConfirmResponseDTO.card_number_masked
class-attribute
instance-attribute
¶
archipy.adapters.internet_payment_gateways.ir.parsian.adapters.ConfirmResponseDTO.token
class-attribute
instance-attribute
¶
archipy.adapters.internet_payment_gateways.ir.parsian.adapters.ConfirmResponseDTO.model_config
class-attribute
instance-attribute
¶
model_config = ConfigDict(
extra="ignore",
validate_default=True,
from_attributes=True,
frozen=True,
str_strip_whitespace=True,
arbitrary_types_allowed=True,
)
archipy.adapters.internet_payment_gateways.ir.parsian.adapters.ConfirmWithAmountRequestDTO ¶
Bases: BaseDTO
DTO for confirming a payment with amount and order verification.
Source code in archipy/adapters/internet_payment_gateways/ir/parsian/adapters.py
archipy.adapters.internet_payment_gateways.ir.parsian.adapters.ConfirmWithAmountRequestDTO.token
class-attribute
instance-attribute
¶
archipy.adapters.internet_payment_gateways.ir.parsian.adapters.ConfirmWithAmountRequestDTO.order_id
class-attribute
instance-attribute
¶
archipy.adapters.internet_payment_gateways.ir.parsian.adapters.ConfirmWithAmountRequestDTO.amount
class-attribute
instance-attribute
¶
archipy.adapters.internet_payment_gateways.ir.parsian.adapters.ConfirmWithAmountRequestDTO.model_config
class-attribute
instance-attribute
¶
model_config = ConfigDict(
extra="ignore",
validate_default=True,
from_attributes=True,
frozen=True,
str_strip_whitespace=True,
arbitrary_types_allowed=True,
)
archipy.adapters.internet_payment_gateways.ir.parsian.adapters.ConfirmWithAmountResponseDTO ¶
Bases: BaseDTO
DTO for confirm payment with amount response.
Source code in archipy/adapters/internet_payment_gateways/ir/parsian/adapters.py
archipy.adapters.internet_payment_gateways.ir.parsian.adapters.ConfirmWithAmountResponseDTO.status
class-attribute
instance-attribute
¶
archipy.adapters.internet_payment_gateways.ir.parsian.adapters.ConfirmWithAmountResponseDTO.rrn
class-attribute
instance-attribute
¶
archipy.adapters.internet_payment_gateways.ir.parsian.adapters.ConfirmWithAmountResponseDTO.card_number_masked
class-attribute
instance-attribute
¶
archipy.adapters.internet_payment_gateways.ir.parsian.adapters.ConfirmWithAmountResponseDTO.token
class-attribute
instance-attribute
¶
archipy.adapters.internet_payment_gateways.ir.parsian.adapters.ConfirmWithAmountResponseDTO.model_config
class-attribute
instance-attribute
¶
model_config = ConfigDict(
extra="ignore",
validate_default=True,
from_attributes=True,
frozen=True,
str_strip_whitespace=True,
arbitrary_types_allowed=True,
)
archipy.adapters.internet_payment_gateways.ir.parsian.adapters.ReverseRequestDTO ¶
Bases: BaseDTO
DTO for reversing a payment.
Source code in archipy/adapters/internet_payment_gateways/ir/parsian/adapters.py
archipy.adapters.internet_payment_gateways.ir.parsian.adapters.ReverseRequestDTO.token
class-attribute
instance-attribute
¶
archipy.adapters.internet_payment_gateways.ir.parsian.adapters.ReverseRequestDTO.model_config
class-attribute
instance-attribute
¶
model_config = ConfigDict(
extra="ignore",
validate_default=True,
from_attributes=True,
frozen=True,
str_strip_whitespace=True,
arbitrary_types_allowed=True,
)
archipy.adapters.internet_payment_gateways.ir.parsian.adapters.ReverseResponseDTO ¶
Bases: BaseDTO
DTO for reverse payment response.
Source code in archipy/adapters/internet_payment_gateways/ir/parsian/adapters.py
archipy.adapters.internet_payment_gateways.ir.parsian.adapters.ReverseResponseDTO.status
class-attribute
instance-attribute
¶
archipy.adapters.internet_payment_gateways.ir.parsian.adapters.ReverseResponseDTO.message
class-attribute
instance-attribute
¶
archipy.adapters.internet_payment_gateways.ir.parsian.adapters.ReverseResponseDTO.token
class-attribute
instance-attribute
¶
archipy.adapters.internet_payment_gateways.ir.parsian.adapters.ReverseResponseDTO.model_config
class-attribute
instance-attribute
¶
model_config = ConfigDict(
extra="ignore",
validate_default=True,
from_attributes=True,
frozen=True,
str_strip_whitespace=True,
arbitrary_types_allowed=True,
)
archipy.adapters.internet_payment_gateways.ir.parsian.adapters.ParsianShaparakPaymentAdapter ¶
Adapter for interacting with Parsian Shaparak payment gateway services.
Provides methods for initiating payments, confirming transactions, and reversing payments through the Parsian Shaparak payment gateway SOAP services. Supports proxy configuration for environments where direct connections are not possible.
Source code in archipy/adapters/internet_payment_gateways/ir/parsian/adapters.py
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 | |
archipy.adapters.internet_payment_gateways.ir.parsian.adapters.ParsianShaparakPaymentAdapter.login_account
instance-attribute
¶
archipy.adapters.internet_payment_gateways.ir.parsian.adapters.ParsianShaparakPaymentAdapter.sale_client
instance-attribute
¶
archipy.adapters.internet_payment_gateways.ir.parsian.adapters.ParsianShaparakPaymentAdapter.confirm_client
instance-attribute
¶
archipy.adapters.internet_payment_gateways.ir.parsian.adapters.ParsianShaparakPaymentAdapter.reversal_client
instance-attribute
¶
archipy.adapters.internet_payment_gateways.ir.parsian.adapters.ParsianShaparakPaymentAdapter.initiate_payment ¶
Initiate a payment request.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
PaymentRequestDTO
|
Payment request data. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
PaymentResponseDTO |
PaymentResponseDTO
|
Response containing token, status, and message. |
Raises:
| Type | Description |
|---|---|
UnavailableError
|
If a SOAP fault occurs during the request. |
InternalError
|
If an unexpected error occurs during the request. |
Source code in archipy/adapters/internet_payment_gateways/ir/parsian/adapters.py
archipy.adapters.internet_payment_gateways.ir.parsian.adapters.ParsianShaparakPaymentAdapter.confirm_payment ¶
Confirm a payment transaction.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
ConfirmRequestDTO
|
Confirm request data. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
ConfirmResponseDTO |
ConfirmResponseDTO
|
Response containing status, RRN, card number, and token. |
Raises:
| Type | Description |
|---|---|
UnavailableError
|
If a SOAP fault occurs during the request. |
InternalError
|
If an unexpected error occurs during the request. |
Source code in archipy/adapters/internet_payment_gateways/ir/parsian/adapters.py
archipy.adapters.internet_payment_gateways.ir.parsian.adapters.ParsianShaparakPaymentAdapter.confirm_payment_with_amount ¶
confirm_payment_with_amount(
request: ConfirmWithAmountRequestDTO,
) -> ConfirmWithAmountResponseDTO
Confirm a payment transaction with amount and order verification.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
ConfirmWithAmountRequestDTO
|
Confirm with amount request data. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
ConfirmWithAmountResponseDTO |
ConfirmWithAmountResponseDTO
|
Response containing status, RRN, card number, and token. |
Raises:
| Type | Description |
|---|---|
UnavailableError
|
If a SOAP fault occurs during the request. |
InternalError
|
If an unexpected error occurs during the request. |
Source code in archipy/adapters/internet_payment_gateways/ir/parsian/adapters.py
archipy.adapters.internet_payment_gateways.ir.parsian.adapters.ParsianShaparakPaymentAdapter.reverse_payment ¶
Request a reversal of a confirmed transaction.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
ReverseRequestDTO
|
Reverse request data. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
ReverseResponseDTO |
ReverseResponseDTO
|
Response containing status, message, and token. |
Raises:
| Type | Description |
|---|---|
UnavailableError
|
If a SOAP fault occurs during the request. |
InternalError
|
If an unexpected error occurs during the request. |
Source code in archipy/adapters/internet_payment_gateways/ir/parsian/adapters.py
options: show_root_toc_entry: false heading_level: 3