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

PaymentMethod.PaymentInfo 데이터 모델 개선 #17

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

sieunju
Copy link

@sieunju sieunju commented Sep 18, 2023

[REFACTOR] PaymentMethod Widget 에서 결제 요청시 사용하는 PaymentMethod.PaymentInfo 구조 변경안

이유

  • 실제 고객사에서 해당 데이터모델 사용시 아래 방식으로 데이터모델을 생성후 처리
val paymentInfo = PaymentMethod.PaymentInfo(
    orderId = model.orderId,
    orderName = model.orderName
)
paymentInfo.customerName = model.customerName
paymentInfo.customerEmail = model.customerEmail
paymentInfo.customerMobilePhone =  model.customerMobilePhone
paymentInfo.showCustomerMobilePhone = true
  • 위 방식보단 아래 방식이 나을거 같아서 제안 해봅니다!
PaymentMethod.PaymentInfo.Builder()
            .setOrderId("20230918222222")
            .setOrderName("주문 번호")
            .setCustomerName("구매할 고객명")
            .setCustomerEmail("[email protected]")
            .setCustomerMobilePhone("010-1234-5678")
            .setShowCustomerMobilePhone(true)
            .build()
  • 추가로 이전에 객체 생성 시 orderId, orderName 필수로 받던 처리에 대하서도 지원을 하면서 Deprecated 추가하여 Builder 방식으로 유도 할수 있도록 주석 추가
constructor(orderId: String, orderName: String) : this(
            Builder()
                .setOrderId(orderId)
                .setOrderName(orderName)
        )

ps. 실제 저희 서비스에서 해당 SDK 사용하다가 "이방식으로 하면 어떨까?"라는 생각에 제안 드려봅니다. 🙇‍♂️

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.

None yet

1 participant