-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
82 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--- | ||
title: خطاها | ||
description: توضیح خطاهایی که کتابخانه می اندازد | ||
--- | ||
|
||
ممکن است در طول بخشهای مختلف پرداخت خطاهایی انداخته شود. شما میتوانید از این خطاها استفاده کنید تا به کاربر بازخورد بدهید. | ||
|
||
## `BadConfigError` | ||
|
||
این خطا در دو صورت انداخته میشود: | ||
- در صورتی که تنظیماتی که به کتابخانه دادهاید درست نباشد و توسط Zod شناسایی شود (قبل از اینکه به درگاه پرداخت برسد) | ||
- در صورتی که درگاه پرداخت با خطا پاسخ دهد و بگوید که تنظیمات شما اشتباه است | ||
|
||
این خطا یه صورت معمول به این معناست که شما، بهعنوان توسعهدهنده، کاری را اشتباه کردهاید یا تنظیمات اشتباه دارید. | ||
|
||
## `UserError` | ||
|
||
این خطا وقتی انداخته میشود که کاربر کاری غیر از انجام پرداخت به صورت عادی کرده است. برای مثال ممکن است پرداخت را لغو کرده باشند. | ||
|
||
## `GatewayFailureError` | ||
|
||
نشان دهنده خطای ناشی از خرابی درگاه پرداخت یا یک دلیل غیرقابل تشخیص است. | ||
|
||
## `MonopayError` | ||
|
||
همهی خطاهای ذکر شده از این خطا ارثبری میکنند. بعضی اوقات شما میخواهید تمام خطاهای مربوط به پرداخت را بگیرید. اگر میخواهید اینکار را بکنید باید به دنبال این خطا باشید |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--- | ||
title: Exceptions | ||
description: Explaining the exceptions the package throws | ||
--- | ||
|
||
Exceptions may be thrown during different parts of transaction. To provide your users information when things go wrong, you should catch these exceptions. | ||
|
||
## `BadConfigError` | ||
|
||
This error is thrown in two cases: | ||
- If your provided configuration doesn't match the Zod schema for the driver (before even hitting the IPG API) | ||
- If the payment gateway responds with an error status indicating your config is invalid | ||
|
||
This error usually means you, the developer, are doing something wrong or have misconfigured a driver. | ||
|
||
## `UserError` | ||
|
||
This error is thrown when the end-user does something other than going through the provided steps to pay. For example it be that they cancelled the payment. | ||
|
||
## `GatewayFailureError` | ||
|
||
Denotes an error either caused by a failure from gateway or an unrecognizable reason. | ||
|
||
## `MonopayError` | ||
|
||
All the above errors extend this error. Sometimes you want to catch all payment-related errors. If you want to do that, you should look for this error. |