Payment Gateways¶
The internet_payment_gateways adapter provides integration with Iranian Shaparak payment gateways. Supports both
Parsian (SOAP/WSDL) and Saman (REST/JSON) protocols.
Parsian Shaparak¶
Parsian Shaparak adapter using the SOAP protocol with WSDL service definitions.
Ports¶
Abstract port interface defining the Parsian Shaparak adapter contract.
Classes:
| Name | Description |
|---|---|
PaymentRequestDTO |
DTO for initiating a payment request. |
PaymentResponseDTO |
DTO for payment response. |
ConfirmRequestDTO |
DTO for confirming a payment. |
ConfirmResponseDTO |
DTO for confirm payment response. |
ConfirmWithAmountRequestDTO |
DTO for confirming a payment with amount and order verification. |
ConfirmWithAmountResponseDTO |
DTO for confirm payment with amount response. |
ReverseRequestDTO |
DTO for reversing a payment. |
ReverseResponseDTO |
DTO for reverse payment response. |
ParsianShaparakPaymentPort |
Port interface for Parsian Shaparak payment gateway. |
AsyncParsianShaparakPaymentPort |
Async port interface for Parsian Shaparak payment gateway. |
PaymentRequestDTO ¶
DTO for initiating a payment request.
Source code in archipy/adapters/internet_payment_gateways/ir/parsian/ports.py
PaymentResponseDTO ¶
DTO for payment response.
Source code in archipy/adapters/internet_payment_gateways/ir/parsian/ports.py
ConfirmRequestDTO ¶
ConfirmResponseDTO ¶
DTO for confirm payment response.
Source code in archipy/adapters/internet_payment_gateways/ir/parsian/ports.py
ConfirmWithAmountRequestDTO ¶
DTO for confirming a payment with amount and order verification.
Source code in archipy/adapters/internet_payment_gateways/ir/parsian/ports.py
ConfirmWithAmountResponseDTO ¶
DTO for confirm payment with amount response.
Source code in archipy/adapters/internet_payment_gateways/ir/parsian/ports.py
ReverseRequestDTO ¶
ReverseResponseDTO ¶
DTO for reverse payment response.
Source code in archipy/adapters/internet_payment_gateways/ir/parsian/ports.py
ParsianShaparakPaymentPort ¶
Port interface for Parsian Shaparak payment gateway.
Defines the contract for Parsian IPG adapters implementing payment operations (token request, confirmation, and reversal).
Methods:
| Name | Description |
|---|---|
initiate_payment |
Step 1: Request payment token. |
confirm_payment |
Step 3: Confirm transaction. |
confirm_payment_with_amount |
Confirm transaction with amount and order verification. |
reverse_payment |
Reverse a transaction. |
Source code in archipy/adapters/internet_payment_gateways/ir/parsian/ports.py
initiate_payment
abstractmethod
¶
Step 1: Request payment token.
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/ports.py
confirm_payment
abstractmethod
¶
Step 3: Confirm 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/ports.py
confirm_payment_with_amount
abstractmethod
¶
confirm_payment_with_amount(
request: ConfirmWithAmountRequestDTO,
) -> ConfirmWithAmountResponseDTO
Confirm 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/ports.py
reverse_payment
abstractmethod
¶
Reverse a 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/ports.py
AsyncParsianShaparakPaymentPort ¶
Async port interface for Parsian Shaparak payment gateway.
Defines the contract for async Parsian IPG adapters implementing payment operations (token request, confirmation, and reversal).
Methods:
| Name | Description |
|---|---|
initiate_payment |
Step 1: Request payment token (async). |
confirm_payment |
Step 3: Confirm transaction (async). |
confirm_payment_with_amount |
Confirm transaction with amount and order verification (async). |
reverse_payment |
Reverse a transaction (async). |
Source code in archipy/adapters/internet_payment_gateways/ir/parsian/ports.py
initiate_payment
abstractmethod
async
¶
Step 1: Request payment token (async).
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/ports.py
confirm_payment
abstractmethod
async
¶
Step 3: Confirm transaction (async).
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/ports.py
confirm_payment_with_amount
abstractmethod
async
¶
confirm_payment_with_amount(
request: ConfirmWithAmountRequestDTO,
) -> ConfirmWithAmountResponseDTO
Confirm transaction with amount and order verification (async).
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/ports.py
reverse_payment
abstractmethod
async
¶
Reverse a transaction (async).
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/ports.py
options: show_root_toc_entry: false heading_level: 3
Adapters¶
Classes:
| Name | Description |
|---|---|
ParsianShaparakPaymentAdapter |
Adapter for interacting with Parsian Shaparak payment gateway services. |
AsyncParsianShaparakPaymentAdapter |
Async adapter for interacting with Parsian Shaparak payment gateway services. |
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.
Methods:
| Name | Description |
|---|---|
initiate_payment |
Step 1: Request payment token. |
confirm_payment |
Step 3: Confirm transaction. |
confirm_payment_with_amount |
Confirm transaction with amount and order verification. |
reverse_payment |
Reverse a transaction. |
Source code in archipy/adapters/internet_payment_gateways/ir/parsian/adapters.py
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 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 | |
initiate_payment ¶
Step 1: Request payment token.
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
confirm_payment ¶
Step 3: Confirm 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
confirm_payment_with_amount ¶
confirm_payment_with_amount(
request: ConfirmWithAmountRequestDTO,
) -> ConfirmWithAmountResponseDTO
Confirm 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
reverse_payment ¶
Reverse a 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
AsyncParsianShaparakPaymentAdapter ¶
Async adapter for interacting with Parsian Shaparak payment gateway services.
Provides async 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.
Methods:
| Name | Description |
|---|---|
initiate_payment |
Step 1: Request payment token (async). |
confirm_payment |
Step 3: Confirm transaction (async). |
confirm_payment_with_amount |
Confirm transaction with amount and order verification (async). |
reverse_payment |
Reverse a transaction (async). |
Source code in archipy/adapters/internet_payment_gateways/ir/parsian/adapters.py
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 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 | |
initiate_payment
async
¶
Step 1: Request payment token (async).
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
confirm_payment
async
¶
Step 3: Confirm transaction (async).
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
confirm_payment_with_amount
async
¶
confirm_payment_with_amount(
request: ConfirmWithAmountRequestDTO,
) -> ConfirmWithAmountResponseDTO
Confirm transaction with amount and order verification (async).
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
reverse_payment
async
¶
Reverse a transaction (async).
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
Saman Shaparak¶
Saman Shaparak adapters using the REST/JSON protocol. Includes four variants:
SamanShaparakPaymentAdapter— Classic SEP adapter, redirects to fixed payment URLSamanNeoPgShaparakPaymentAdapter— Neo-PG adapter, receives dynamic payment URL fromX-IPG-Urlresponse headerAsyncSamanShaparakPaymentAdapter— Async version of classic SEP adapterAsyncSamanNeoPgShaparakPaymentAdapter— Async version of Neo-PG adapter
Ports¶
Abstract port interfaces defining the Saman Shaparak adapter contract.
Classes:
| Name | Description |
|---|---|
PaymentRequestDTO |
Request for getting payment token. |
PaymentResponseDTO |
Response from token request. |
VerifyRequestDTO |
Request for verifying a payment. |
VerifyResponseDTO |
Response from payment verification. |
ReverseRequestDTO |
Request for reversing a payment. |
ReverseResponseDTO |
Response from payment reversal. |
SamanShaparakPaymentPort |
Port interface for Saman Shaparak payment gateway. |
AsyncSamanShaparakPaymentPort |
Async port interface for Saman Shaparak payment gateway. |
PaymentRequestDTO ¶
Request for getting payment token.
Source code in archipy/adapters/internet_payment_gateways/ir/saman/ports.py
PaymentResponseDTO ¶
Response from token request.
Methods:
| Name | Description |
|---|---|
validate_status |
Validate TLS-related settings to ensure compatibility. |
Source code in archipy/adapters/internet_payment_gateways/ir/saman/ports.py
validate_status ¶
Validate TLS-related settings to ensure compatibility.
Source code in archipy/adapters/internet_payment_gateways/ir/saman/ports.py
VerifyRequestDTO ¶
VerifyResponseDTO ¶
Response from payment verification.
Source code in archipy/adapters/internet_payment_gateways/ir/saman/ports.py
ReverseRequestDTO ¶
ReverseResponseDTO ¶
SamanShaparakPaymentPort ¶
Port interface for Saman Shaparak payment gateway.
Defines the contract for Saman IPG adapters implementing payment operations (token request, verification, and reversal).
Methods:
| Name | Description |
|---|---|
initiate_payment |
Step 1: Request payment token. |
verify_payment |
Step 3: Verify transaction. |
reverse_payment |
Reverse a transaction. |
Source code in archipy/adapters/internet_payment_gateways/ir/saman/ports.py
AsyncSamanShaparakPaymentPort ¶
Async port interface for Saman Shaparak payment gateway.
Defines the contract for async Saman IPG adapters implementing payment operations (token request, verification, and reversal).
Methods:
| Name | Description |
|---|---|
initiate_payment |
Step 1: Request payment token (async). |
verify_payment |
Step 3: Verify transaction (async). |
reverse_payment |
Reverse a transaction (async). |
Source code in archipy/adapters/internet_payment_gateways/ir/saman/ports.py
options: show_root_toc_entry: false heading_level: 3
Adapters¶
Classes:
| Name | Description |
|---|---|
SamanShaparakPaymentAdapter |
Saman Shaparak (SEP) Classic Adapter - Full v3/.5 Protocol. |
SamanNeoPgShaparakPaymentAdapter |
Saman Neo-PG (New Generation) Adapter - Uses dynamic X-IPG-Url. |
AsyncSamanShaparakPaymentAdapter |
Async Saman Shaparak (SEP) Classic Adapter - Full v3/.5 Protocol. |
AsyncSamanNeoPgShaparakPaymentAdapter |
Async Saman Neo-PG (New Generation) Adapter - Uses dynamic X-IPG-Url. |
SamanShaparakPaymentAdapter ¶
Saman Shaparak (SEP) Classic Adapter - Full v3/.5 Protocol.
Implements the SamanShaparakPaymentPort interface using httpx for HTTP operations. Provides methods for initiating payments, verifying transactions, and reversing payments.
Methods:
| Name | Description |
|---|---|
initiate_payment |
Step 1: Request payment token. |
verify_payment |
Step 3: Verify transaction (strongly recommended). |
reverse_payment |
Reverse a transaction. |
Source code in archipy/adapters/internet_payment_gateways/ir/saman/adapters.py
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 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 | |
initiate_payment ¶
Step 1: Request payment token.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
PaymentRequestDTO
|
Payment request data. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
PaymentResponseDTO |
PaymentResponseDTO
|
Response containing token, status, etc. |
Raises:
| Type | Description |
|---|---|
UnavailableError
|
If the payment service is unavailable. |
InternalError
|
If an unexpected error occurs. |
Source code in archipy/adapters/internet_payment_gateways/ir/saman/adapters.py
verify_payment ¶
Step 3: Verify transaction (strongly recommended).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
VerifyRequestDTO
|
Verify request with reference number. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
VerifyResponseDTO |
VerifyResponseDTO
|
Response containing transaction details. |
Raises:
| Type | Description |
|---|---|
UnavailableError
|
If the verify service is unavailable. |
InternalError
|
If an unexpected error occurs. |
Source code in archipy/adapters/internet_payment_gateways/ir/saman/adapters.py
reverse_payment ¶
Reverse a transaction.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
ReverseRequestDTO
|
Reverse request with reference number. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
ReverseResponseDTO |
ReverseResponseDTO
|
Response containing reversal result. |
Raises:
| Type | Description |
|---|---|
UnavailableError
|
If the reverse service is unavailable. |
InternalError
|
If an unexpected error occurs. |
Source code in archipy/adapters/internet_payment_gateways/ir/saman/adapters.py
SamanNeoPgShaparakPaymentAdapter ¶
Saman Neo-PG (New Generation) Adapter - Uses dynamic X-IPG-Url.
Extends SamanShaparakPaymentAdapter to capture the dynamic payment page URL from the X-IPG-Url header in the token response.
Methods:
| Name | Description |
|---|---|
initiate_payment |
Override to capture dynamic neo-pg URL from header. |
Source code in archipy/adapters/internet_payment_gateways/ir/saman/adapters.py
initiate_payment ¶
Override to capture dynamic neo-pg URL from header.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
PaymentRequestDTO
|
Payment request data. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
PaymentResponseDTO |
PaymentResponseDTO
|
Response containing token, status, and IPG URL. |
Raises:
| Type | Description |
|---|---|
UnavailableError
|
If the payment service is unavailable. |
InternalError
|
If an unexpected error occurs. |
Source code in archipy/adapters/internet_payment_gateways/ir/saman/adapters.py
AsyncSamanShaparakPaymentAdapter ¶
Async Saman Shaparak (SEP) Classic Adapter - Full v3/.5 Protocol.
Async implementation of SamanShaparakPaymentPort using httpx.AsyncClient. Provides async methods for initiating payments, verifying transactions, and reversing payments.
Methods:
| Name | Description |
|---|---|
initiate_payment |
Step 1: Request payment token (async). |
verify_payment |
Step 3: Verify transaction (async, strongly recommended). |
reverse_payment |
Reverse a transaction (async). |
Source code in archipy/adapters/internet_payment_gateways/ir/saman/adapters.py
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 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 | |
initiate_payment
async
¶
Step 1: Request payment token (async).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
PaymentRequestDTO
|
Payment request data. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
PaymentResponseDTO |
PaymentResponseDTO
|
Response containing token, status, etc. |
Raises:
| Type | Description |
|---|---|
UnavailableError
|
If the payment service is unavailable. |
InternalError
|
If an unexpected error occurs. |
Source code in archipy/adapters/internet_payment_gateways/ir/saman/adapters.py
verify_payment
async
¶
Step 3: Verify transaction (async, strongly recommended).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
VerifyRequestDTO
|
Verify request with reference number. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
VerifyResponseDTO |
VerifyResponseDTO
|
Response containing transaction details. |
Raises:
| Type | Description |
|---|---|
UnavailableError
|
If the verify service is unavailable. |
InternalError
|
If an unexpected error occurs. |
Source code in archipy/adapters/internet_payment_gateways/ir/saman/adapters.py
reverse_payment
async
¶
Reverse a transaction (async).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
ReverseRequestDTO
|
Reverse request with reference number. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
ReverseResponseDTO |
ReverseResponseDTO
|
Response containing reversal result. |
Raises:
| Type | Description |
|---|---|
UnavailableError
|
If the reverse service is unavailable. |
InternalError
|
If an unexpected error occurs. |
Source code in archipy/adapters/internet_payment_gateways/ir/saman/adapters.py
AsyncSamanNeoPgShaparakPaymentAdapter ¶
Async Saman Neo-PG (New Generation) Adapter - Uses dynamic X-IPG-Url.
Async implementation extending AsyncSamanShaparakPaymentAdapter to capture the dynamic payment page URL from the X-IPG-Url header in the token response.
Methods:
| Name | Description |
|---|---|
initiate_payment |
Override to capture dynamic neo-pg URL from header (async). |
Source code in archipy/adapters/internet_payment_gateways/ir/saman/adapters.py
initiate_payment
async
¶
Override to capture dynamic neo-pg URL from header (async).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
PaymentRequestDTO
|
Payment request data. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
PaymentResponseDTO |
PaymentResponseDTO
|
Response containing token, status, and IPG URL. |
Raises:
| Type | Description |
|---|---|
UnavailableError
|
If the payment service is unavailable. |
InternalError
|
If an unexpected error occurs. |
Source code in archipy/adapters/internet_payment_gateways/ir/saman/adapters.py
options: show_root_toc_entry: false heading_level: 3