-
Notifications
You must be signed in to change notification settings - Fork 1
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
1 parent
5c93e98
commit cdd6f69
Showing
17 changed files
with
138 additions
and
58 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
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
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
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
33 changes: 33 additions & 0 deletions
33
src/mercoa/resources/invoice_types/types/invoice_failure_type.py
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,33 @@ | ||
# This file was auto-generated by Fern from our API Definition. | ||
|
||
import enum | ||
import typing | ||
|
||
T_Result = typing.TypeVar("T_Result") | ||
|
||
|
||
class InvoiceFailureType(str, enum.Enum): | ||
SOURCE_PAYMENT_ERROR = "SOURCE_PAYMENT_ERROR" | ||
DESTINATION_PAYMENT_ERROR = "DESTINATION_PAYMENT_ERROR" | ||
REJECTED_HIGH_RISK = "REJECTED_HIGH_RISK" | ||
INSUFFICIENT_FUNDS = "INSUFFICIENT_FUNDS" | ||
PROCESSING_ERROR = "PROCESSING_ERROR" | ||
|
||
def visit( | ||
self, | ||
source_payment_error: typing.Callable[[], T_Result], | ||
destination_payment_error: typing.Callable[[], T_Result], | ||
rejected_high_risk: typing.Callable[[], T_Result], | ||
insufficient_funds: typing.Callable[[], T_Result], | ||
processing_error: typing.Callable[[], T_Result], | ||
) -> T_Result: | ||
if self is InvoiceFailureType.SOURCE_PAYMENT_ERROR: | ||
return source_payment_error() | ||
if self is InvoiceFailureType.DESTINATION_PAYMENT_ERROR: | ||
return destination_payment_error() | ||
if self is InvoiceFailureType.REJECTED_HIGH_RISK: | ||
return rejected_high_risk() | ||
if self is InvoiceFailureType.INSUFFICIENT_FUNDS: | ||
return insufficient_funds() | ||
if self is InvoiceFailureType.PROCESSING_ERROR: | ||
return processing_error() |
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
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
Oops, something went wrong.