Skip to content

Conversation

@tyler-omise
Copy link
Collaborator

Description

  • support authentication in charge request (enum: PASSKEY, 3DS) for TAS PASSKEY support
  • support authenticated_by in charge response
  • update unit test for these scenarios: PASSKEY, 3DS, and none. Update mock json responses
  • update example class to include pkey for some operations.

NOTE:

  • In order to send charge with PASSKEY or 3DS, either email or phone number is needed

Business impact (if any)

  • N/A

@tyler-omise tyler-omise self-assigned this Oct 2, 2025
@tyler-omise tyler-omise force-pushed the feature/tas-passkey-support branch 2 times, most recently from 9bfb980 to e76a8e5 Compare October 3, 2025 03:05
@Narum11 Narum11 requested a review from Copilot October 3, 2025 06:42
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Adds PASSKEY and 3DS authentication support to Charge model and request builder, updates fixtures/tests to assert new request/response fields, and refactors Example class output from System.out to java.util.logging while adding an authentication-aware charge example.

  • Introduces AuthenticationType enum and new Charge fields: authentication, authenticated_by.
  • Extends Charge.CreateRequestBuilder to allow setting authentication and updates related tests/fixtures.
  • Refactors Example to use logging and adds chargeWithAuthentication method plus accompanying ExampleTest for coverage.

Reviewed Changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/main/java/co/omise/models/AuthenticationType.java New enum for authentication modes (3DS, PASSKEY).
src/main/java/co/omise/models/Charge.java Adds authentication fields and builder support.
src/main/java/co/omise/Example.java Logging refactor and new chargeWithAuthentication workflow.
src/test/java/co/omise/requests/ChargeRequestTest.java Adds assertions for authentication fields and request payload updates.
src/test/java/co/omise/ExampleTest.java New test exercising Example methods including authentication use.
testdata fixture JSON files Updated/added fixtures including authentication and authenticated_by fields (PASSKEY, 3DS, null cases).
charge_object.json Adds authentication fields to base charge test object.

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines 143 to 147
logInfo(
"created charge with %s authentication: %s and auth url: %s ",
authenticationType.name(),
charge.getId(),
charge.getAuthorizeUri());
Copy link

Copilot AI Oct 3, 2025

Choose a reason for hiding this comment

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

[nitpick] authenticationType.name() logs 'THREE_DS' instead of the serialized value '3DS', which can confuse users. Consider adding a helper (e.g., a method or map) to log the wire-format value consistent with @JsonProperty annotations (e.g., map THREE_DS -> '3DS', PASSKEY -> 'PASSKEY').

Copilot uses AI. Check for mistakes.
@sonarqubecloud
Copy link

sonarqubecloud bot commented Oct 3, 2025

@tyler-omise tyler-omise merged commit 040fc3f into master Oct 3, 2025
4 checks passed
@tyler-omise tyler-omise deleted the feature/tas-passkey-support branch October 3, 2025 07:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants