-
Notifications
You must be signed in to change notification settings - Fork 2
sdk v3 #63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
sdk v3 #63
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
99ff9d1
sdk v3
sbilalh c63f389
bump api version
sbilalh 663e4df
use CardProductResource
sbilalh 27216fb
fix tests
sbilalh 26cb72c
fix tests
sbilalh 18c824a
Merge branch 'master' into bilal/mthd-9409
sbilalh c300089
opal & simulate
sbilalh f31bbf7
add back event tests
sbilalh 54b0a0c
nit
sbilalh 5c7a5c9
fix tests
sbilalh 267bdf2
increase retry limit
sbilalh 55df0ab
additional opal types
sbilalh b3bd343
add liability sub types
sbilalh 4b3ea67
fix event tests
sbilalh 59edbe0
fix event tests
sbilalh 5c11f86
comment out event tests for now
sbilalh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,39 @@ | ||
| from typing import TypedDict, Optional, List, Literal | ||
|
|
||
| from method.resource import MethodResponse, Resource | ||
| from method.configuration import Configuration | ||
| from method.errors import ResourceError | ||
|
|
||
|
|
||
| CardProductTypeLiterals = Literal[ | ||
| 'specific', | ||
| 'generic', | ||
| 'in_review', | ||
| ] | ||
|
|
||
| class CardProductBrand(TypedDict): | ||
| id: str | ||
| description: str | ||
| network: str | ||
| default_image: str | ||
|
|
||
|
|
||
| class CardProduct(TypedDict): | ||
| id: str | ||
| name: str | ||
| issuer: str | ||
| type: CardProductTypeLiterals | ||
| brands: List[CardProductBrand] | ||
| error: Optional[ResourceError] | ||
| created_at: str | ||
| updated_at: str | ||
|
|
||
|
|
||
| class CardProductResource(Resource): | ||
| def __init__(self, config: Configuration): | ||
| super(CardProductResource, self).__init__(config.add_path('card_product')) | ||
|
|
||
|
|
||
| def retrieve(self, prt_id: str) -> MethodResponse[CardProduct]: | ||
| return super(CardProductResource, self)._get_with_id(prt_id) | ||
|
|
This file contains hidden or 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 hidden or 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 hidden or 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,12 @@ | ||
| from method.resource import Resource | ||
| from method.configuration import Configuration | ||
| from method.resources.Opal.Token import OpalTokenResource | ||
|
|
||
|
|
||
| class OpalResource(Resource): | ||
| token: OpalTokenResource | ||
|
|
||
| def __init__(self, config: Configuration): | ||
| _config = config.add_path('opal') | ||
| super(OpalResource, self).__init__(_config) | ||
| self.token = OpalTokenResource(_config) |
This file contains hidden or 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,104 @@ | ||
| from typing import TypedDict, Optional, Literal, List, Dict | ||
|
|
||
| from method.resource import MethodResponse, Resource | ||
| from method.configuration import Configuration | ||
|
|
||
| OpalModesLiterals = Literal[ | ||
| 'identity_verification', | ||
| 'connect', | ||
| 'card_connect', | ||
| 'account_verification', | ||
| 'transactions' | ||
| ] | ||
|
|
||
|
|
||
| SkipPIILiterals = Literal[ | ||
| 'name', | ||
| 'dob', | ||
| 'address', | ||
| 'ssn_4' | ||
| ] | ||
|
|
||
|
|
||
| AccountFiltersAccountTypesLiterals = Literal[ | ||
| 'credit_card', | ||
| 'auto_loan', | ||
| 'mortgage', | ||
| 'personal_loan', | ||
| 'student_loan' | ||
| ] | ||
|
|
||
|
|
||
| SelectionTypeLiterals = Literal['single', 'multiple', 'all'] | ||
|
|
||
|
|
||
| class OpalAccountFiltersInclude(TypedDict): | ||
| account_types: List[AccountFiltersAccountTypesLiterals] | ||
|
|
||
|
|
||
| class OpalAccountFiltersExclude(TypedDict): | ||
| account_types: List[AccountFiltersAccountTypesLiterals] | ||
| mch_ids: List[str] | ||
| unverified_account_numbers: bool | ||
|
|
||
|
|
||
| class ConnectAccountFilters(TypedDict): | ||
| include: OpalAccountFiltersInclude | ||
| exclude: OpalAccountFiltersExclude | ||
|
|
||
|
|
||
| class CardConnectAccountFiltersExclude(TypedDict): | ||
| mch_ids: List[str] | ||
| unverified_account_numbers: bool | ||
|
|
||
|
|
||
| class CardConnectAccountFilters(TypedDict): | ||
| exclude: CardConnectAccountFiltersExclude | ||
|
|
||
|
|
||
| class OpalIdentityVerificationCreateOpts(TypedDict): | ||
| skip_pii: List[SkipPIILiterals] | ||
|
|
||
|
|
||
| class OpalConnectCreateOpts(TypedDict): | ||
| skip_pii: List[SkipPIILiterals] | ||
| selection_type: SelectionTypeLiterals | ||
| account_filters: ConnectAccountFilters | ||
|
|
||
|
|
||
| class OpalCardConnectCreateOpts(TypedDict): | ||
| skip_pii: List[SkipPIILiterals] | ||
| selection_type: SelectionTypeLiterals | ||
| account_filters: CardConnectAccountFilters | ||
|
|
||
|
|
||
| class OpalAccountVerificationCreateOpts(TypedDict): | ||
| account_id: str | ||
|
|
||
|
|
||
| class OpalTransactionsCreateOpts(TypedDict): | ||
| transactions: Dict[str, any] | ||
|
|
||
|
|
||
| class OpalTokenCreateOpts(TypedDict): | ||
| mode: OpalModesLiterals | ||
| entity_id: str | ||
| identity_verification: Optional[OpalIdentityVerificationCreateOpts] | ||
| connect: Optional[OpalConnectCreateOpts] | ||
| card_connect: Optional[OpalCardConnectCreateOpts] | ||
| account_verification: Optional[OpalAccountVerificationCreateOpts] | ||
| transactions: Optional[OpalTransactionsCreateOpts] | ||
|
|
||
|
|
||
| class OpalToken(TypedDict): | ||
| token: str | ||
| valid_until: str | ||
| session_id: str | ||
|
|
||
|
|
||
| class OpalTokenResource(Resource): | ||
| def __init__(self, config: Configuration): | ||
| super(OpalTokenResource, self).__init__(config.add_path('token')) | ||
|
|
||
| def create(self, opts: OpalTokenCreateOpts) -> MethodResponse[OpalToken]: | ||
| return super(OpalTokenResource, self)._create(opts) |
This file contains hidden or 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,2 @@ | ||
| from method.resources.Opal.Opal import OpalResource | ||
| from method.resources.Opal.Token import OpalTokenResource, OpalToken |
This file contains hidden or 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,28 @@ | ||
| from method.resource import MethodResponse, Resource | ||
| from method.configuration import Configuration | ||
| from typing import Optional, Literal, List, TypedDict | ||
|
|
||
|
|
||
| AttributesBehaviorsLiterals = Literal[ | ||
| 'new_soft_inquiry' | ||
| ] | ||
|
|
||
|
|
||
| class SimulateEntityAttributesOpts(TypedDict): | ||
| behaviors: List[AttributesBehaviorsLiterals] | ||
|
|
||
|
|
||
| class SimulateAttributesInstance(Resource): | ||
| def __init__(self, entity_id: str, config: Configuration): | ||
| super(SimulateAttributesInstance, self).__init__(config.add_path(entity_id)) | ||
|
|
||
| def create(self, opts: SimulateEntityAttributesOpts) -> MethodResponse[Optional[None]]: | ||
| return super(SimulateAttributesInstance, self)._create(opts) | ||
|
|
||
|
|
||
| class SimulateAttributesResource(Resource): | ||
| def __init__(self, config: Configuration): | ||
| super(SimulateAttributesResource, self).__init__(config.add_path('attributes')) | ||
|
|
||
| def __call__(self, entity_id: str) -> SimulateAttributesInstance: | ||
| return SimulateAttributesInstance(entity_id, self.config) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.