Skip to content

Commit eb6aba0

Browse files
Merge pull request #37 from dojo-engineering/develop
Release v1.4.2
2 parents b25a8fa + da28ed7 commit eb6aba0

File tree

4 files changed

+10
-6
lines changed

4 files changed

+10
-6
lines changed

Sources/dojo-ios-sdk/Classes/ApplePay/ApplePayHandler.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class ApplePayHandler: NSObject, ApplePayHandlerProtocol {
4949

5050
// Create our payment request
5151
let paymentRequest = PKPaymentRequest()
52-
paymentRequest.paymentSummaryItems = [getApplePayAmount(paymentIntent.totalAmount.value)]
52+
paymentRequest.paymentSummaryItems = [getApplePayAmount(paymentIntent.totalAmount.value, merchantName: payload.merchantName)]
5353
paymentRequest.merchantIdentifier = payload.applePayConfig.merchantIdentifier
5454
paymentRequest.supportedNetworks = getSupportedApplePayNetworks(payload.applePayConfig.supportedCards)
5555
paymentRequest.merchantCapabilities = getMerchantCapability()
@@ -196,8 +196,8 @@ extension ApplePayHandler {
196196
return schemas
197197
}
198198

199-
func getApplePayAmount(_ amount: UInt64) -> PKPaymentSummaryItem {
200-
PKPaymentSummaryItem(label: "Amount", amount: NSDecimalNumber(mantissa: amount, exponent: -2, isNegative: false), type: .final)
199+
func getApplePayAmount(_ amount: UInt64, merchantName: String?) -> PKPaymentSummaryItem {
200+
PKPaymentSummaryItem(label: merchantName ?? "Amount", amount: NSDecimalNumber(mantissa: amount, exponent: -2, isNegative: false), type: .final)
201201
}
202202

203203
func convertPaymentMethodType(_ type: PKPaymentMethodType) -> String {

Sources/dojo-ios-sdk/Classes/DojoSDK.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ protocol DojoSDKProtocol {
4545
@objc public class DojoSDK: NSObject, DojoSDKProtocol {
4646

4747
public static override func version() -> Int {
48-
141
48+
142
4949
}
5050

5151
/// Execute card payment

Sources/dojo-ios-sdk/Classes/Entities/DojoApplePayPayload.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,12 @@ import Foundation
1515
/// - metaData: A set of key-value pairs that you can use for storing additional information.
1616
@objc public init(applePayConfig: DojoApplePayConfig,
1717
userEmailAddress: String? = nil,
18-
metaData: [String : String]? = nil) {
18+
metaData: [String : String]? = nil,
19+
merchantName: String? = nil) {
1920
self.applePayConfig = applePayConfig
2021
self.userEmailAddress = userEmailAddress
2122
self.metaData = metaData
23+
self.merchantName = merchantName
2224
}
2325

2426
/// ApplePay related settings.
@@ -27,5 +29,7 @@ import Foundation
2729
public let userEmailAddress: String?
2830
/// A set of key-value pairs that you can use for storing additional information.
2931
public let metaData: [String: String]?
32+
33+
public var merchantName: String?
3034
}
3135

dojo-ios-sdk.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
Pod::Spec.new do |s|
1010
s.name = 'dojo-ios-sdk'
11-
s.version = '1.4.1'
11+
s.version = '1.4.2'
1212
s.summary = 'Dojo Payment SDK'
1313

1414
# This description is used to generate tags and improve search results.

0 commit comments

Comments
 (0)