Skip to content
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

Provide More Method in Building Request #28

Open
kevindavee opened this issue Feb 17, 2020 · 1 comment
Open

Provide More Method in Building Request #28

kevindavee opened this issue Feb 17, 2020 · 1 comment
Labels
enhancement New feature or request xendit-java 2.0 Major Release for xendit-java

Comments

@kevindavee
Copy link
Contributor

For credit card charge example:

  public static CreditCardCharge createAuthorization(
      String tokenId,
      String externalId,
      Number amount,
      String authenticationId,
      String cardCVN,
      Boolean capture)

understand this is only for the required parameters. if the user wants to use the client method with optional fields, she will need to use the createAuthorization(Map<String, Object> params) function. I'm personally not super keen on letting users use this as we are losing the entire advantage of a typed language to hint to devs on what are the required parameters of the function.

We can look at including a CreateAuthorizationParams object to specify what is required/not required and let users create the request params as the argument to the client method. One drawback is if we change our API specs (adding new fields) is that we might need to update the client. But I guess we can still have the createAuthorization(Map<String, Object> params) method to have some flexibility for certain users

@kevindavee kevindavee added the enhancement New feature or request label Feb 17, 2020
@kevindavee kevindavee added the xendit-java 2.0 Major Release for xendit-java label Feb 26, 2020
@stanleynguyen
Copy link
Contributor

Yes let's follow the go implementation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request xendit-java 2.0 Major Release for xendit-java
Projects
None yet
Development

No branches or pull requests

2 participants