Skip to content

Conversation

Xaxxis
Copy link
Contributor

@Xaxxis Xaxxis commented Mar 17, 2022

Bug Fix

  • Fix unit testing for custom header
  • Update version on user-agent value

@Xaxxis Xaxxis added enhancement New feature or request fix bug labels Mar 17, 2022
@Xaxxis Xaxxis requested a review from rizdaprasetya March 17, 2022 09:27
Copy link
Collaborator

@rizdaprasetya rizdaprasetya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Xaxxis adding enhancement to this bugfix is not a good idea. Please fix this PR or re-open PR so it contains the bugfix parts only and with v1.4.1

Will explain why later.

@rizdaprasetya
Copy link
Collaborator

The bugfix parts looks good (approved) ✅ , so once you have PR for bugfix parts only, you can go ahead merge & release.

@rizdaprasetya
Copy link
Collaborator

adding enhancement to this bugfix is not a good idea

Some of the reasons:

  • By adding enhancement you are delaying the bugfix release. Because your enhancement will need to be reviewed, and during my quick-review I already saw it needs some revision, the revision will delay the bugfix release.
  • By adding enhancement the bugfix will only available on v1.5, and not available to v1.4. What if the v1.5 enhancement causing more bugs or user prefer v1.4 behavior? If they revert to v1.4 they will not have the bugfix.

So that's why better release the bugfix first as v1.4.1 , then we can take time with the v1.5 enhancement. Bug fix is more prioritized.

Comment on lines 53 to 54
message='The ServerKey is invalid, as it is an empty string or Null. Please double-check your API key. You can check the ServerKey from the Midtrans Dashboard. See https://docs.midtrans.com/en/midtrans-account/overview?id=retrieving-api-access-keys for the details or contact support at support@midtrans.com if you have any questions.',
api_response_dict=None,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review for the enhancement part (to address later after bugfix release):

  • I think Bintar's team is starting to deprecate email support in favor of website contact form. Should replace the email with URL instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, sure will remove the email

Comment on lines 58 to 65
if " " in server_key:
raise MidtransAPIError(
message='The ServerKey is contains white-space. Please double-check your API key. You can check the ServerKey from the Midtrans Dashboard. See https://docs.midtrans.com/en/midtrans-account/overview?id=retrieving-api-access-keys for the details or contact support at support@midtrans.com if you have any questions.',
api_response_dict=None,
http_status_code=0,
raw_http_client_data=None
)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Grammar issue, no need is.

Btw this is my opinion, but feel free to decide. I don't think we should check for whitespace or any specific chars, because the Spec can change from API side. And if it changed, we will need to edit this kind of logic manually each time. Also I think the API raw error message in this scenario already tell merchant that ServerKey is invalid.

So IMO the benefit is small & the potential maintenance burden is higher.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure will remove this part. Thanks da

@Xaxxis Xaxxis removed the enhancement New feature or request label Mar 18, 2022
@Xaxxis
Copy link
Contributor Author

Xaxxis commented Mar 18, 2022

@Xaxxis I will change/revert this PR into the fixed part ya. Thanks

@Xaxxis
Copy link
Contributor Author

Xaxxis commented Mar 18, 2022

Done the PR revert to Fix bug only ya @rizdaprasetya

@Xaxxis Xaxxis changed the title v1.5.0 Fix custom header & implement error handling server-key format v1.4.1 Fix custom header Mar 18, 2022
@rizdaprasetya rizdaprasetya merged commit 83df389 into Midtrans:master Mar 18, 2022
@rizdaprasetya
Copy link
Collaborator

Great thanks @Xaxxis, merged. Please try to continue to release ya, let me know if any issue.

@rizdaprasetya rizdaprasetya changed the title v1.4.1 Fix custom header v1.4.1 Fix custom header config/params not applied to API request Mar 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants