From 315fd26e7f108c0ae1f28ddefa0b62c68cc7a6ea Mon Sep 17 00:00:00 2001 From: Adhiarta Prabhataputra Date: Fri, 13 Sep 2024 11:38:38 +0700 Subject: [PATCH] Add functionality to send SDK version (#86) * introduce client SDK version in the request header * resolve bug on sending card_holder_mobile_number --- README.md | 2 +- Sources/Xendit/Info.plist | 2 +- Sources/Xendit/Models/DTOs/XenditTokenizationRequest.swift | 2 +- Sources/Xendit/XDTApiClient.swift | 3 ++- Xendit.podspec | 2 +- 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index e267877..336b270 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ Slack Mentions: `@troops-cards` Add this to your Podfile. ```ruby -pod 'Xendit', '~> 3.9.1' +pod 'Xendit', '~> 3.9.2' ``` **Important:** Import SDK in Objective-C project with CocoaPods integration, you can do as following diff --git a/Sources/Xendit/Info.plist b/Sources/Xendit/Info.plist index 956f195..dd7839c 100755 --- a/Sources/Xendit/Info.plist +++ b/Sources/Xendit/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 3.9.1 + 3.9.2 CFBundleVersion $(CURRENT_PROJECT_VERSION) NSPrincipalClass diff --git a/Sources/Xendit/Models/DTOs/XenditTokenizationRequest.swift b/Sources/Xendit/Models/DTOs/XenditTokenizationRequest.swift index 6db1ef4..f8d8fcf 100644 --- a/Sources/Xendit/Models/DTOs/XenditTokenizationRequest.swift +++ b/Sources/Xendit/Models/DTOs/XenditTokenizationRequest.swift @@ -70,7 +70,7 @@ import Foundation } if let phoneNumber = cardData.cardHolderPhoneNumber, !phoneNumber.isEmpty { - cardDataJson["card_holder_mobile_number"] = phoneNumber + cardDataJson["card_holder_phone_number"] = phoneNumber } if cardData.cardCvn != nil && cardData.cardCvn != "" { diff --git a/Sources/Xendit/XDTApiClient.swift b/Sources/Xendit/XDTApiClient.swift index 36da48b..be8deae 100644 --- a/Sources/Xendit/XDTApiClient.swift +++ b/Sources/Xendit/XDTApiClient.swift @@ -21,6 +21,7 @@ extension URLRequest { request.setValue(XDTApiClient.CLIENT_TYPE, forHTTPHeaderField: "client-type") request.setValue(XDTApiClient.CLIENT_API_VERSION, forHTTPHeaderField: "client-version") request.setValue(XDTApiClient.CLIENT_IDENTIFIER, forHTTPHeaderField: "x-client-identifier") + request.setValue(XDTApiClient.CLIENT_SDK_VERSION, forHTTPHeaderField: "x-client-sdk-version") if extraHeaders != nil { for (key, value) in extraHeaders! { @@ -37,7 +38,7 @@ class XDTApiClient { internal static let CLIENT_TYPE = "SDK"; internal static let CLIENT_API_VERSION = "2.0.0"; internal static let CLIENT_IDENTIFIER = "Xendit iOS SDK"; - internal static let CLIENT_SDK_VERSION = "3.8.7"; + internal static let CLIENT_SDK_VERSION = "3.9.2"; private static let WEBAPI_FLEX_BASE_URL = "https://sandbox.webapi.visa.com" diff --git a/Xendit.podspec b/Xendit.podspec index c8613b1..d9dceb7 100755 --- a/Xendit.podspec +++ b/Xendit.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'Xendit' - s.version = '3.9.1' + s.version = '3.9.2' s.license = 'MIT' s.homepage = 'https://www.xendit.co' s.author = { 'Juan Gonzalez’' => 'juan@xendit.co' }