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

Incorrect Decoding of Cancellation Message in SDK (Spaces Replaced with '+') #55

Open
MussaCharles opened this issue Nov 28, 2023 · 0 comments
Assignees

Comments

@MussaCharles
Copy link
Contributor

When a user cancels the payment process using the SDK, the returned string is incorrectly decoded, replacing spaces with '+' signs. For example, the expected cancellation message "결제가 사용자에 의해 취소되었습니다" is returned as "결제가+사용자에+의해+취소되었습니다".

This issue appears to be an encoding problem where spaces are not correctly handled.

Suggested Fix

  1. Investigate the method responsible for decoding the return string in the SDK's payment cancellation code.
  2. Modify the decoding process to correctly interpret spaces, possibly by adjusting the encoding method or replacing '+' signs with spaces.

Below is a sample response for the mentioned issue which is sent via the following delegate

public protocol TossPaymentsDelegate: AnyObject {
    func handleSuccessResult(_ success: TossPaymentsResult.Success)
    func handleFailResult(_ fail: TossPaymentsResult.Fail)
}

Issue

Fail(errorCode: "PAY_PROCESS_CANCELED", errorMessage: "결제가+사용자에+의해+취소되었습니다.", orderId: Optional("")
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

No branches or pull requests

1 participant