tosspayments / payment-sdk-ios Goto Github PK
View Code? Open in Web Editor NEWToss Payments iOS SDK
Toss Payments iOS SDK
successUrl paymentType 쿼리파라미터 KEYIN 추가되는것은 string 으로 내려와서 키인결제는 native 업데이트는 필요 없음
Example에 추가해주는 정도
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.
사용예
paymentWidget.renderPaymentMethods('#payment-methods', 100_000, { variantKey: ${uiKey} })
안녕하세요. 토스 페이먼츠를 통해서 결제 위젯을 연결하였습니다.
추가로 궁금한것은 정기 결제 웹 소스는 있는데, SDK는 없는 것 인가해서 질문드립니다.
찾아보니 안보여서 웹킷에 웹 소스를 직접 띄우는 방식으로 구현하긴했는데, 혹시나 글 남기고 갑니다.
기존 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 정보를 따르기로 함. (암시적인 값보단 명시적인 값 따르기)
안녕하세요.
앞으로는 애플 정책에서 말하는 매니페스트가 필요할 것 같은데.. 언제쯤 추가될 수 있나요?
제곧내
50 개 이상의 scheme 을 등록하면,
51번째부터는 canOpenURL을 모두 false로 발생시키면서 의도한 동작을 해내기 어려워진다.
해결방법: open을 직접하고 fallback 을 이용해서 handling 하는것으로 수정해본다.
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.
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)
}
Fail(errorCode: "PAY_PROCESS_CANCELED", errorMessage: "결제가+사용자에+의해+취소되었습니다.", orderId: Optional("")
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.