-
Notifications
You must be signed in to change notification settings - Fork 20
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
2372, 23508 - redirect to direct pay, API and UI updates #282
Conversation
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.
Nice work, this looks good 👍
@@ -126,7 +126,8 @@ def json(self): | |||
'submissionDate': self.submission_date.isoformat(), | |||
'expiryDate': self.expiry_date.isoformat() if self.expiry_date else None, | |||
'outputFileKey': self._output_file_key, | |||
'submitter': self.submitter.display_name if self.submitter else None | |||
'submitter': self.submitter.display_name if self.submitter else None, | |||
'paymentToken': self.payment_token |
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.
can you just add a comment here that this is the 'invoice id' from the pay db
@pytest.mark.parametrize('test_name,mock_response,is_payment_completion_date_expected', [ | ||
('test_pad_invoice', {'id': 123, 'paymentMethod': 'PAD'}, True), | ||
('test_pad_invoice', {'id': 123, 'paymentMethod': 'DIRECT_PAY'}, False)]) | ||
def test_create_invoice(client, session, jwt, mocker, test_name, mock_response, is_payment_completion_date_expected): |
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.
nice
@@ -70,18 +70,22 @@ def create_invoice(document_access_request: DocumentAccessRequest, user_jwt: Jwt | |||
header, business_json) | |||
|
|||
if payment_response.status_code in (HTTPStatus.OK, HTTPStatus.CREATED): | |||
payment_completion_date = datetime.utcnow() | |||
is_pad = payment_response.json().get('paymentMethod') == 'PAD' | |||
today_utc = datetime.utcnow() |
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.
datetime.now(tz=timezone.utc)
datetime.utcnow() = depreciated
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.
Yeah, pycharm shows the same !
I wasn't sure about updating it in just one place, but you are right. When changing the code, update it in place I changed if it does not break everything else :D
@@ -37,10 +37,6 @@ def validate_document_access_request(document_access_request_json: dict, account | |||
if not account_org: | |||
validation_errors.append({'error': 'Invalid Account'}) | |||
|
|||
if account_org.get('orgType') != 'PREMIUM': |
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.
Woohoo!
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.
LGTM
Issue #:2372 /bcgov/entity#2372
Issue #:23508 /bcgov/entity#23508
Description of changes:
API updates:
UI updates:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the PPR license (Apache 2.0).