Giter Site home page Giter Site logo

payment-sdk-ios's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

payment-sdk-ios's Issues

feat: improve WidgetPaymentInfo default structure

We offers minimum properties for requestPayments on WidgetPaymentInfo, DefaultWidgetPaymentInfo

public protocol WidgetPaymentInfo: Codable {
    // 필수
    var orderId: String { get }
    var orderName: String { get }
    
    // 선택
    var customerName: String? { get }
    var customerEmail: String? { get }
    var taxFreeAmount: Double? { get }
}
public struct DefaultWidgetPaymentInfo: WidgetPaymentInfo {
    
    // 필수
    public let orderId: String
    public let orderName: String
    
    // 선택
    public let customerName: String?
    public let customerEmail: String?
    public let taxFreeAmount: Double?
    public let cultureExpense: Bool
        
    public init(
        orderId: String,
        orderName: String,
        customerName: String? = nil,
        customerEmail: String? = nil,
        taxFreeAmount: Double? = nil,
        cultureExpense: Bool = false
    ) {
        self.orderId = orderId
        self.orderName = orderName
        self.customerName = customerName
        self.customerEmail = customerEmail
        self.taxFreeAmount = taxFreeAmount
        self.cultureExpense = cultureExpense
    }
}

There are many cases in widgets where �basic parameters, such as appScheme, are required. It would be helpful to provide an example of an improved basic object declaration for this purpose.

정기 결제는 지원하지 않는건가요??

안녕하세요. 토스 페이먼츠를 통해서 결제 위젯을 연결하였습니다.

추가로 궁금한것은 정기 결제 웹 소스는 있는데, SDK는 없는 것 인가해서 질문드립니다.

찾아보니 안보여서 웹킷에 웹 소스를 직접 띄우는 방식으로 구현하긴했는데, 혹시나 글 남기고 갑니다.

해외 결제 지원 (renderPaymentMethods 메서드, 두번째 파라미터 amount에 금액, 통화, 나라를 받음. 하위호환을 위해 오버로딩 방식으로 제공중)

기존 renderPaymentMethods 방식 deprecated
renderPaymentMethods(selector: string, amount: number, options?: {variantKey?: string})

변경된 renderPaymentMethods 인터페이스
renderPaymentMethods(
selector: string,
amount: {value: number, currency?: string, country?: string},
options?: {variantKey?: string}
)
국내 mid 클라이언트키일 경우에, currency, country 안넣으면 디폴트로 'KRW', 'KR' 넣어주기
해외 mid 클라이언트키일 경우에, currency, country 안넣으면 파라미터 누락 에러 발생
requestPayment
requestPayment 결제정보 파라미터에 products, shipping, paymentMethodOptions추가
나중에 배송지 위젯이 나왔을 때, requestPayment에 shipping 정보가 있다면, shipping 정보를 따르기로 함. (암시적인 값보단 명시적인 값 따르기)

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

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("")

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.