-
Notifications
You must be signed in to change notification settings - Fork 17
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
Rewards + Bug Fixes #127
Open
dragonprevost
wants to merge
171
commits into
unit-finance:master
Choose a base branch
from
MazumaGo:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Rewards + Bug Fixes #127
Changes from all commits
Commits
Show all changes
171 commits
Select commit
Hold shift + click to select a range
a9dd9dc
bug patches
a07b7a4
fixed inheritence and changed pdf response to content
ef2c0d6
add auth user to sol prop
8994d13
added payment rejected event
d5c15b2
added auth users to individual customer dto
a20ad05
added nsf to ach return reasons
4bf5ad3
fixed transaction dto
28d0004
update
eabb243
bug patches
4a6771a
fixed inheritence and changed pdf response to content
86914a3
add auth user to sol prop
e1293d7
added payment rejected event
addd9bd
added auth users to individual customer dto
3652df2
added nsf to ach return reasons
1649093
fixed transaction dto
6d1dd08
update
ec014b3
merge conflicts
a82b783
added coded
517fb30
added codecs
2a8cfd1
coded update
4b89d13
adds support for /sandbox/applications/application_id/approve
e3b8a83
ApproveApplicationSBRequest
00de5d5
Merge pull request #1 from dragonprevost/application-approval-sim
avesk e4fd4c3
update to authorization requests
37dc174
card dto update
d047997
fix bug
6d99a25
added authorization canceled event
09d9aae
Adds support for simulating incoming ACH
a2ddb79
Merge pull request #2 from dragonprevost/simulate-incoming-ach
avesk 32ca1a7
added limits to card create card request
ecfa4fe
Merge branch 'master' of github.com:dragonprevost/unit-python-sdk
8fdcc9a
card limits
b51dc56
patch card payload
ceb8c42
fix unit bug
7bca682
fix payment rejected type
8f90e12
PaymentCreated event returning Payment clearing event
a45ecfe
Merge pull request #3 from dragonprevost/fix-payment-rejected-event
avesk cf574d9
fix benificial owner bug
3513c59
Removes deprecated SSN field from card api
174b4eb
Merge pull request #4 from dragonprevost/remove-ssn-from-cards
avesk 6dd43fc
bug patches
7604c3a
fixed inheritence and changed pdf response to content
f82564e
add auth user to sol prop
4b6f09c
added payment rejected event
1f8895d
added auth users to individual customer dto
86bb420
added nsf to ach return reasons
669d152
fixed transaction dto
b57a1ac
update
46f8605
added coded
4c1b769
added codecs
1a5fdbc
coded update
723e89a
adds support for /sandbox/applications/application_id/approve
93768ff
ApproveApplicationSBRequest
0b67831
update to authorization requests
5f115cd
card dto update
5c77ebb
fix bug
1c78ee1
added authorization canceled event
fd64f5d
added limits to card create card request
b394e8c
Adds support for simulating incoming ACH
6d87d0c
card limits
b160a0e
patch card payload
82f41cc
fix unit bug
129a913
fix payment rejected type
3d562a7
PaymentCreated event returning Payment clearing event
c913912
fix benificial owner bug
6670d91
created authorization declined event
dfddb0f
remove duplicate decoder
b2a008d
fix package
2e4a95d
fix func signature
62f6318
card authorization patches
cd2378f
fix merchant type bug
d363d96
added authorization canceled to coded
38c8208
fix coordinate bug
37da55f
added rewards to sdk
7246c06
reward patches
85af67b
reward bug fix
29feabe
fixed payment rejected bug
ce9b05a
fix customer updated codec bug
915e4d0
Patch CreateCounterpartyRequest to inherit UnitRequest
2ee62da
Merge pull request #5 from dragonprevost/patch-create-counterparty-re…
avesk cc30baa
Simulate transmitting and clearing ach payments
a4c63c2
Merge pull request #7 from MazumaGo/simulate-ach-payment-actions
avesk a3c64d0
Update CreateBusinessApplicationRequest with new required compliance …
4324dd4
Merge pull request #8 from MazumaGo/compliance-updates
eric-truss 064660f
Add relevant models and operations for charge cards and repayments
dfbe4f7
Remove build/ folder and add to gitignore
a27740c
Minor fixes to charge cards
c997b22
simulate purchases
2862234
Update objects with unit dto
a363368
Merge pull request #9 from MazumaGo/charge-cards
eric-truss 88ad935
Add same day flag for ACH payments
fe3576c
Fix ordering of function parameters
c38cefa
Fix book payments
b0be3ff
Use keyword arg for same day to avoid errors
70cfa13
Merge remote-tracking branch 'origin/master' into simulate-purchasees
8c7219e
replace sb_ with sandbox_ prefix
330d08c
use merchant name
784a526
Merge pull request #10 from MazumaGo/simulate-purchasees
avesk c13b1e7
Fix typo
d25d2dc
Add batch releases to Unit object
47333ce
rename
658772b
Fix purchaseTransactionDTO cardLast4Digits key error
fde95ea
Merge pull request #11 from MazumaGo/fix-purchase-txn-dto
avesk dbe0074
Updates DTOs to accomodate purchase simulation responses
eeb66c4
Merge pull request #12 from MazumaGo/fix-purchase-simulations
avesk 5ce5391
fix error
0a1ce8a
Adds CheckDepositPendingReviewEvent and CheckDepositPendingEvent events
ad4e0ae
Merge pull request #13 from MazumaGo/check-deposit-webhooks
avesk b734e22
fix issues
julia-truss aa59e84
Merge remote-tracking branch 'origin/master' into add-batch-release
julia-truss dbce57b
Merge pull request #14 from MazumaGo/add-batch-release
julia-truss bed432b
Check deposits
9a018f1
Merge branch 'master' into check-deposits
avesk 941f05d
Merge pull request #15 from MazumaGo/check-deposits
avesk 40aa08f
Check deposit webhook updates
6fd187d
updates
79e2914
Merge pull request #16 from MazumaGo/check-deposit-webhook-updates
avesk 671f7b4
Update codecs for Check Deposit Webhooks
8b54bd6
Merge pull request #17 from MazumaGo/check-deposit-wh-codecs
avesk 284716b
Fix previous status typo
586cb04
Add get_image
julia-truss 767ecac
Merge pull request #18 from MazumaGo/get-check-deposit-image
mazumanick e24074d
Add account and routing numbers to ListCounterpartyParams
julia-truss 5ee3a2b
Merge pull request #19 from MazumaGo/list-counterparty-ach-numbers
julia-truss ff57889
Category optional
bcfb024
Update purchase and merchant DTOs (#20)
julia-truss df9cb60
Fix KeyError when converting from json (#21)
julia-truss 8dc3d7c
Account for incorrect merchant fields for simulations (#22)
julia-truss f3b7775
Response should output bytes (#23)
julia-truss 6120e8d
astra pushToCard payment
465e84f
revert inadvertant changes
5ce31e0
Update title literal and individual application (#25)
julia-truss 58aa3a2
pushToCardPayment on dto
4e9899b
Fix payment dto
aadbe7d
Merge pull request #24 from MazumaGo/astra-push-to-card
avesk eaef877
Update push to card request #26
julia-truss 2a8470e
Add check payment resources
2dbfd38
Rename
5e752e1
Rename2
b12c980
Add check payments to client
915563f
Fix enums and add get endpoint for check payments
b716cc2
Add check payment transactions
ac8bc05
Add check payments to other references
8b9a8c0
Add create check payment
276b244
Include memo
0da1b2c
Remove item assignment
815e018
Add check payment counterparty to json encoder
04fda05
Remove counterpartyMoved param
4cad693
Add events (#27)
julia-truss 190adab
Check payment codecs
1531493
Cancel check payment and check stop payments (#28)
julia-truss bf7760d
Fix check payment event bugs (#29)
julia-truss 0ac8f97
Fix key error on check payment processed event (#30)
julia-truss 3effb89
Make check_number optional (#31)
julia-truss 699e266
Add timeout handling to payment create
edf6072
Update application form version to V2024_06
f8cda6f
Add patch check payment
78ecd3b
Remove version from application form create resource
d74ad15
Adds pushToCardPayment codec
fc68cf5
Merge pull request #33 from MazumaGo/add-push-to-card-codec
avesk 813df60
Safe get on astraRoutineId
5dafdfa
Merge pull request #34 from MazumaGo/add-push-to-card-codec
avesk 2ff164a
Update officer dto and application literals (#35)
julia-truss 64d7728
Update application request and beneficial owner (#36)
julia-truss 5930419
Update customer and account dtos to faciliate archiving/closing (#37)
julia-truss e7e3543
Implements freeze account endpoint
67f1886
fix reasonText
c6b0ef7
Merge pull request #38 from MazumaGo/account-freeze
avesk 0694c5f
add type creditAccountFreeze to freeze account request
4a2500d
unfreeze account
e5f863b
Merge pull request #39 from MazumaGo/unfreeze-account
avesk 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 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 |
---|---|---|
|
@@ -12,3 +12,5 @@ venv/* | |
dist/ | ||
|
||
.DS_Store | ||
|
||
build/ |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
from unit.api.base_resource import BaseResource | ||
from unit.models.payment import * | ||
from unit.models.codecs import DtoDecoder, split_json_api_single_response | ||
|
||
|
||
class AchResource(BaseResource): | ||
def __init__(self, api_url, token): | ||
super().__init__(api_url, token) | ||
self.resource = "ach" | ||
|
||
def simulate_transmit(self, request: SimulateTransmitAchRequest) -> Union[UnitResponse[PaymentDTO], UnitError]: | ||
payload = request.to_json_api() | ||
response = super().post(f"sandbox/{self.resource}/transmit", payload) | ||
if super().is_20x(response.status_code): | ||
data = response.json().get("data") | ||
# TODO Fix dto | ||
_id, _type, attributes, relationships = split_json_api_single_response(data) | ||
print("simulate_transmit") | ||
print("data", data) | ||
print("_id, _type, attributes, relationships", _id, _type, attributes, relationships) | ||
return UnitResponse[SimulateAchPaymentDTO](SimulateAchPaymentDTO.from_json_api(_id, _type, attributes, relationships), None) | ||
else: | ||
return UnitError.from_json_api(response.json()) | ||
|
||
def simulate_clear(self, request: SimulateClearAchRequest) -> Union[UnitResponse[PaymentDTO], UnitError]: | ||
payload = request.to_json_api() | ||
response = super().post(f"sandbox/{self.resource}/clear", payload) | ||
if super().is_20x(response.status_code): | ||
data = response.json().get("data") | ||
# TODO Fix dto | ||
_id, _type, attributes, relationships = split_json_api_single_response(data) | ||
return UnitResponse[SimulateAchPaymentDTO](SimulateAchPaymentDTO.from_json_api(_id, _type, attributes, relationships), None) | ||
else: | ||
return UnitError.from_json_api(response.json()) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
from unit.api.base_resource import BaseResource | ||
from unit.models.batch_release import * | ||
from unit.models.codecs import DtoDecoder | ||
|
||
|
||
class BatchReleaseResource(BaseResource): | ||
def __init__(self, api_url, token): | ||
super().__init__(api_url, token) | ||
self.resource = 'batch-releases' | ||
|
||
def create(self, batch_releases: List[BatchReleaseDTO]) -> Union[UnitResponse[List[BatchReleaseDTO]], UnitError]: | ||
response = super().post(self.resource, {"data": batch_releases}) | ||
if super().is_20x(response.status_code): | ||
data = response.json().get("data") | ||
return UnitResponse[List[BatchReleaseDTO]](DtoDecoder.decode(data), None) | ||
else: | ||
return UnitError.from_json_api(response.json()) |
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,31 @@ | ||
from unit.api.base_resource import BaseResource | ||
from unit.models.check_deposit import * | ||
from unit.models.codecs import DtoDecoder | ||
from unit.models.transaction import * | ||
|
||
|
||
class CheckDepositResource(BaseResource): | ||
def __init__(self, api_url, token): | ||
super().__init__(api_url, token) | ||
self.resource = "check-deposits" | ||
|
||
def get(self, check_deposit_id: str) -> Union[UnitResponse[CheckDepositDTO], UnitError]: | ||
params = {} | ||
response = super().get(f"{self.resource}/{check_deposit_id}", params) | ||
if response.status_code == 200: | ||
data = response.json().get("data") | ||
included = response.json().get("included") | ||
return UnitResponse[TransactionDTO](DtoDecoder.decode(data), DtoDecoder.decode(included)) | ||
else: | ||
return UnitError.from_json_api(response.json()) | ||
|
||
def list(self, params: ListTransactionParams = None) -> Union[UnitResponse[List[CheckDepositDTO]], UnitError]: | ||
raise NotImplementedError() | ||
|
||
def get_image(self, check_deposit_id: str, is_back_side: Optional[bool] = False) -> Union[UnitResponse[bytes], UnitError]: | ||
params = {} | ||
response = super().get(f"{self.resource}/{check_deposit_id}/{'back' if is_back_side else 'front'}", params) | ||
if response.status_code == 200: | ||
return UnitResponse[bytes](response.content, None) | ||
else: | ||
return UnitError.from_json_api(response.json()) |
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,45 @@ | ||
from unit.api.base_resource import BaseResource | ||
from unit.models.authorization_request import * | ||
from unit.models.check_payment import ApproveCheckPaymentRequest, CheckPaymentDTO | ||
from unit.models.codecs import DtoDecoder | ||
from unit.models.payment import CreateCheckPaymentRequest | ||
|
||
|
||
class CheckPaymentResource(BaseResource): | ||
def __init__(self, api_url, token): | ||
super().__init__(api_url, token) | ||
self.resource = "check-payments" | ||
|
||
def get(self, check_payment_id: str) -> Union[UnitResponse[CheckPaymentDTO], UnitError]: | ||
response = super().get(f"{self.resource}/{check_payment_id}") | ||
if super().is_20x(response.status_code): | ||
data = response.json().get("data") | ||
return UnitResponse[check_payment_id](DtoDecoder.decode(data), None) | ||
else: | ||
return UnitError.from_json_api(response.json()) | ||
|
||
def approve(self, request: ApproveCheckPaymentRequest) -> Union[UnitResponse[CheckPaymentDTO], UnitError]: | ||
payload = request.to_json_api() | ||
response = super().post(f"{self.resource}/{request.check_payment_id}/approve", payload) | ||
if super().is_20x(response.status_code): | ||
data = response.json().get("data") | ||
return UnitResponse[CheckPaymentDTO](DtoDecoder.decode(data), None) | ||
else: | ||
return UnitError.from_json_api(response.json()) | ||
|
||
def create(self, request: CreateCheckPaymentRequest, timeout: float = None) -> Union[UnitResponse[CheckPaymentDTO], UnitError]: | ||
payload = request.to_json_api() | ||
response = super().post(f"{self.resource}", payload, timeout=timeout) | ||
if super().is_20x(response.status_code): | ||
data = response.json().get("data") | ||
return UnitResponse[CheckPaymentDTO](DtoDecoder.decode(data), None) | ||
else: | ||
return UnitError.from_json_api(response.json()) | ||
|
||
def cancel(self, check_payment_id: str) -> Union[UnitResponse[CheckPaymentDTO], UnitError]: | ||
response = super().post(f"{self.resource}/{check_payment_id}/cancel") | ||
if super().is_20x(response.status_code): | ||
data = response.json().get("data") | ||
return UnitResponse[CheckPaymentDTO](DtoDecoder.decode(data), None) | ||
else: | ||
return UnitError.from_json_api(response.json()) |
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,20 @@ | ||
from unit.api.base_resource import BaseResource | ||
from unit.models.authorization_request import * | ||
from unit.models.check_stop_payment import CheckStopPaymentDTO | ||
from unit.models.codecs import DtoDecoder | ||
from unit.models.payment import CreateCheckStopPaymentRequest | ||
|
||
|
||
class CheckStopPaymentResource(BaseResource): | ||
def __init__(self, api_url, token): | ||
super().__init__(api_url, token) | ||
self.resource = "stop-payments" | ||
|
||
def create(self, request: CreateCheckStopPaymentRequest) -> Union[UnitResponse[CheckStopPaymentDTO], UnitError]: | ||
payload = request.to_json_api() | ||
response = super().post(f"{self.resource}", payload) | ||
if super().is_20x(response.status_code): | ||
data = response.json().get("data") | ||
return UnitResponse[CheckStopPaymentDTO](DtoDecoder.decode(data), None) | ||
else: | ||
return UnitError.from_json_api(response.json()) |
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.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function is fairly specific to our testing suite. I would not worry about pulling this into your master branch