Skip to content

Commit

Permalink
iOS: Release 3.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Serhii Libin committed Oct 5, 2023
1 parent d55feb6 commit 0989138
Show file tree
Hide file tree
Showing 142 changed files with 1,291 additions and 160 deletions.
2 changes: 1 addition & 1 deletion Datatrans.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |spec|
spec.name = "Datatrans"
spec.version = "3.2.0"
spec.version = "3.3.0"
spec.summary = "Datatrans iOS SDK - Accept payments on your iOS apps"
spec.description = <<-DESC
Accept payments on your iOS apps: Our mobile SDKs support your entire payment and
Expand Down
10 changes: 5 additions & 5 deletions Datatrans.xcframework/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,30 @@
<array>
<dict>
<key>LibraryIdentifier</key>
<string>ios-arm64</string>
<string>ios-arm64_x86_64-simulator</string>
<key>LibraryPath</key>
<string>Datatrans.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
<dict>
<key>LibraryIdentifier</key>
<string>ios-arm64_x86_64-simulator</string>
<string>ios-arm64</string>
<key>LibraryPath</key>
<string>Datatrans.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
</array>
<key>CFBundlePackageType</key>
Expand Down
Binary file modified Datatrans.xcframework/ios-arm64/Datatrans.framework/Assets.car
Binary file not shown.
Binary file modified Datatrans.xcframework/ios-arm64/Datatrans.framework/Datatrans
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#import <Foundation/Foundation.h>

@class DTByjunoPaymentInfo;
@class DTDCCModel;
@class DTPaymentMethodInfo;
@class DTPaymentRequest;
@class DTSavedPaymentMethod;
Expand All @@ -17,5 +18,6 @@
@property (nonatomic, nonnull, copy) NSString* reqType;
@property (nonatomic, nonnull, copy) DTSavedPaymentMethod* savedPaymentMethod;
@property (nonatomic, nullable, copy) NSString* transactionId;
@property (nonatomic, nullable, copy) DTDCCModel* dccModel;

@end
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
//
// DTDccServiceResponse.h
// Datatrans
//
// Created by Serhii Libin on 09.08.23.
//

#import <Datatrans/DTResponse.h>

@interface DTDCCServiceResponse : NSObject<DTResponse>

@property (nonatomic, nonnull, copy) NSString* transactionId;
@property (nonatomic, nullable, copy) NSString* dccAmount;
@property (nonatomic, nullable, copy) NSString* dccCurrency;
@property (nonatomic, nullable, copy) NSString* dccRate;
@property (nonatomic, nullable, copy) NSString* dccMarkupPercentage;

@end
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,14 @@
@interface DTInitialTransaction : NSObject

- (nonnull instancetype)init NS_UNAVAILABLE;
- (nonnull instancetype)initWithDictionary:(nonnull NSDictionary *)jsonObject;
- (nonnull instancetype)initWithDictionary:(nonnull NSDictionary *)jsonObject dccObject:(nullable NSDictionary *)dccObject;

- (void)addOptionsToPaymentOptions:(nonnull DTPaymentOptions *)paymentOptions hasInternalMethod:(BOOL)hasInternalMethod;

- (nonnull DTAliasRequest *)aliasRequest;
- (nonnull NSArray<NSString *> *)paymentMethods;
- (nonnull DTPaymentRequest *)paymentRequest;
- (nullable DTSavedPaymentMethod *)savedPaymentMethod;
- (nonnull NSArray<NSString *> *)dccEnabledMethods;

@end
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
@class DTAuthorizationRequestResponse;
@class DTCard;
@class DTCardAliasRequestResponse;
@class DTDCCServiceResponse;
@class DTPaymentAuthorizationRequest;
@class DTPaymentOptions;
@class DTPaymentRequest;
Expand Down Expand Up @@ -50,7 +51,7 @@ typedef enum {

- (void)requestInitialTransaction:(NSString *)mobileToken idempotencyKey:(NSString *)idempotencyKey completion:(void (^)(NSData *, NSError *))completion;
- (void)requestCardAliasForMerchantId:(NSString *)merchantId card:(DTCard *)card options:(DTPaymentOptions *)options completion:(void (^)(DTCardAliasRequestResponse *, NSError *))completion;
- (void)requestStatusForMerchantId:(NSString *)merchantId alias:(NSString *)alias currencyCode:(NSString *)currencyCode isAliasRequest:(BOOL)isAliasRequest completion:(void(^)(DTStatusRequestResponse *, NSError *))completion;
- (void)requestStatusForMerchantId:(NSString *)merchantId alias:(NSString *)alias currencyCode:(NSString *)currencyCode isAliasRequest:(BOOL)isAliasRequest transactionId:(NSString *)transactionId isDCC:(BOOL)isDCC completion:(void(^)(DTStatusRequestResponse *, NSError *))completion;
- (void)requestTokenizationWithJSONBody:(NSData *)body completion:(void (^)(NSData *, NSError *))completion;
- (void)authorizeAliasPaymentRequest:(DTAliasPaymentAuthorizationRequest *)authorizationRequest completion:(void (^)(DTAuthorizationRequestResponse *, NSError *))completion;
- (void)authorizePaymentRequest:(DTPaymentAuthorizationRequest *)authorizationRequest completion:(void (^)(DTAuthorizationRequestResponse *, NSError *))completion; // split web payment
Expand All @@ -60,6 +61,7 @@ typedef enum {
- (void)TWINTStatusRequestForMerchantId:(NSString *)merchantId transactionId:(NSString *)transactionId options:(DTPaymentOptions *)options completion:(void (^)(DTTWINTStatusRequestResponse *, NSError *))completion;
- (void)cancelRequest:(DTPaymentRequest *)paymentRequest transactionId:(NSString *)transactionId;
- (void)startApplePayRequest:(DTPaymentRequest *)paymentRequest token:(NSString *)token options:(DTPaymentOptions *)options completion:(void (^)(DTStartApplePayRequestResponse *, NSError *))completion;
- (void)dccInfoForMerchantId:(NSString *)merchantId paymentMethod:(NSString *)paymentMethod cardno:(NSString *)cardno alias:(NSString *)alias completion:(void (^)(DTDCCServiceResponse *, NSError *))completion;

#pragma mark - Management
typedef void (^DTManagementCompletion)(NSError* error);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,6 @@
@property (nonatomic, assign) BOOL isVippsAppInstalled;
@property (nullable, nonatomic, strong) NSString* appCallbackUrl;
@property (nonatomic, assign) BOOL isPayment;
@property (nonatomic, assign) NSInteger savedCardDCCShowMode;

@end
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
- (nonnull NSString *)get3DStatusUrl:(BOOL)isAliasRequest;
- (nonnull NSString *)getAliasUrl;
- (nonnull NSString *)getApplePayUrl;
- (nonnull NSString *)getDCCServiceUrl;
- (nonnull NSString *)getAuthorizationUrl;
- (nonnull NSString *)getAuthorizationSplitUrl;
- (nonnull NSString *)getCancelUrl;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#import <Datatrans/DTUrls.h>

@class DTAliasRequest;
@class DTDCCModel;
@class DTPaymentOptions;
@class DTSavedCard;
@class DTWebCallbackUrls;
Expand All @@ -21,7 +22,7 @@
- (nonnull instancetype)initWithUrls:(nonnull DTUrls *)urls callbackUrls:(nonnull DTWebCallbackUrls *)callbackUrls;

- (nonnull NSURLRequest *)aliasInputRequestForRequest:(nonnull DTAliasRequest *)aliasRequest transactionModel:(nonnull id<DTTransactionModel>)transactionModel;
- (nonnull NSURLRequest *)authenticate3DRequestForRequest:(nonnull DTPaymentRequest *)paymentRequest creditCard:(nonnull DTSavedCard *)creditCard transactionId:(nonnull NSString *)transactionId testing:(BOOL)testing;
- (nonnull NSURLRequest *)authenticate3DRequestForRequest:(nonnull DTPaymentRequest *)paymentRequest creditCard:(nonnull DTSavedCard *)creditCard transactionId:(nonnull NSString *)transactionId testing:(BOOL)testing dccModel:(nullable DTDCCModel *)dccModel;
- (nonnull NSURLRequest *)paymentInputRequestForRequest:(nonnull DTPaymentRequest *)paymentRequest transactionModel:(nonnull id<DTTransactionModel>)transactionModel;

@end
Original file line number Diff line number Diff line change
Expand Up @@ -1153,6 +1153,7 @@ SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly) NSInteger authorizat
- (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)coder OBJC_DESIGNATED_INITIALIZER;
@end

enum DTDCCShowMode : NSInteger;

/// This class can be used to specify miscellaneous options related to the transaction.
SWIFT_CLASS_NAMED("TransactionOptions")
Expand Down Expand Up @@ -1189,13 +1190,37 @@ SWIFT_CLASS_NAMED("TransactionOptions")
/// Please be advised that enabling this option will break your app in many
/// corporate networks with anti-malware/-theft/-espionage SSL proxying.
@property (nonatomic) BOOL useCertificatePinning;
/// Sometimes, apps display a loading animation before starting the SDK. You can set the <code>customInitialLoaderDelegate</code> option if you want to keep showing this animation instead of the SDK’s loader during initial SDK network requests.
/// Sometimes, apps display a loading animation before starting the SDK.
/// You can set the <code>customInitialLoaderDelegate</code> option if you
/// want to keep showing this animation instead of the SDK’s loader during
/// initial SDK network requests.
/// important:
/// Your loader must be visible before starting the SDK. Be aware that the SDK blocks user input. Your loading screen can not have a cancel button or give the impression that users can still interact with the UI.
/// Your loader must be visible before starting the SDK.
/// Be aware that the SDK blocks user input. Your loading screen can not have a
/// cancel button or give the impression that users can still interact with the UI.
@property (nonatomic, weak) id <DTInitialLoaderDelegate> _Nullable customInitialLoaderDelegate;
/// Option to control when the DCC (Dynamic Currency Conversion) screen is presented
/// for payments with saved cards (alias/tokenized payments).
/// The default is <code>DCCShowMode.always</code>, meaning DCC is always shown when available.
/// See <code>DCCShowMode</code> for additional information.
@property (nonatomic) enum DTDCCShowMode savedCardDCCShowMode;
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
@end

/// Mode to control when DCC is presented for saved card payments (alias/tokenized payments).
typedef SWIFT_ENUM_NAMED(NSInteger, DTDCCShowMode, "DCCShowMode", open) {
/// The DCC screen is always shown when the merchant is set up and the saved card is eligible for DCC.
DTDCCShowModeAlways = 0,
/// DCC is initially shown repeatedly for each eligible card. The more often a user declines DCC
/// for a given saved card, the less often the DCC screen is shown for that card.
/// This mode is recommended when customers frequently pay with saved cards to enhance
/// the user experience and reduce unnecessary clicks.
/// Note: the information whether DCC was previously declined is stored on the device only.
DTDCCShowModeSmart = 1,
/// Show DCC only in guest mode and not for payments with saved cards.
DTDCCShowModeNever = 2,
};


/// This class includes the success message and other details of a transaction.
/// You will also obtain a transactionId that you can use for operations
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ FOUNDATION_EXPORT const unsigned char DatatransVersionString[];
#import <Datatrans/DTAuthorizationRequestResponse.h>
#import <Datatrans/DTByjunoPaymentInfo.h>
#import <Datatrans/DTCardAliasRequestResponse.h>
#import <Datatrans/DTDCCServiceResponse.h>
#import <Datatrans/DTErrorHandler.h>
#import <Datatrans/DTErrorPresenter.h>
#import <Datatrans/DTExternalWebAppDelegateProxy.h>
Expand Down
Binary file modified Datatrans.xcframework/ios-arm64/Datatrans.framework/Info.plist
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// swift-module-flags: -target arm64-apple-ios11.0 -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name Datatrans
import AVFoundation
import AudioToolbox
import CommonCrypto
import CoreHaptics
@_exported import Datatrans
import Foundation
Expand Down Expand Up @@ -114,6 +115,17 @@ import _Concurrency
@objc public var testing: Swift.Bool
@objc public var useCertificatePinning: Swift.Bool
@objc weak public var customInitialLoaderDelegate: Datatrans.InitialLoaderDelegate?
@objc(DTDCCShowMode) public enum DCCShowMode : Swift.Int {
case always
case smart
case never
public init?(rawValue: Swift.Int)
public typealias RawValue = Swift.Int
public var rawValue: Swift.Int {
get
}
}
@objc public var savedCardDCCShowMode: Datatrans.TransactionOptions.DCCShowMode
@objc override dynamic public init()
@objc deinit
}
Expand Down Expand Up @@ -397,6 +409,9 @@ extension SwiftUI.View {
extension Datatrans.BoncardType : Swift.Equatable {}
extension Datatrans.BoncardType : Swift.Hashable {}
extension Datatrans.BoncardType : Swift.RawRepresentable {}
extension Datatrans.TransactionOptions.DCCShowMode : Swift.Equatable {}
extension Datatrans.TransactionOptions.DCCShowMode : Swift.Hashable {}
extension Datatrans.TransactionOptions.DCCShowMode : Swift.RawRepresentable {}
extension Datatrans.PaymentMethodType : Swift.Equatable {}
extension Datatrans.PaymentMethodType : Swift.Hashable {}
extension Datatrans.PaymentMethodType : Swift.RawRepresentable {}
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#import <Foundation/Foundation.h>

@class DTByjunoPaymentInfo;
@class DTDCCModel;
@class DTPaymentMethodInfo;
@class DTPaymentRequest;
@class DTSavedPaymentMethod;
Expand All @@ -17,5 +18,6 @@
@property (nonatomic, nonnull, copy) NSString* reqType;
@property (nonatomic, nonnull, copy) DTSavedPaymentMethod* savedPaymentMethod;
@property (nonatomic, nullable, copy) NSString* transactionId;
@property (nonatomic, nullable, copy) DTDCCModel* dccModel;

@end
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
//
// DTDccServiceResponse.h
// Datatrans
//
// Created by Serhii Libin on 09.08.23.
//

#import <Datatrans/DTResponse.h>

@interface DTDCCServiceResponse : NSObject<DTResponse>

@property (nonatomic, nonnull, copy) NSString* transactionId;
@property (nonatomic, nullable, copy) NSString* dccAmount;
@property (nonatomic, nullable, copy) NSString* dccCurrency;
@property (nonatomic, nullable, copy) NSString* dccRate;
@property (nonatomic, nullable, copy) NSString* dccMarkupPercentage;

@end
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,14 @@
@interface DTInitialTransaction : NSObject

- (nonnull instancetype)init NS_UNAVAILABLE;
- (nonnull instancetype)initWithDictionary:(nonnull NSDictionary *)jsonObject;
- (nonnull instancetype)initWithDictionary:(nonnull NSDictionary *)jsonObject dccObject:(nullable NSDictionary *)dccObject;

- (void)addOptionsToPaymentOptions:(nonnull DTPaymentOptions *)paymentOptions hasInternalMethod:(BOOL)hasInternalMethod;

- (nonnull DTAliasRequest *)aliasRequest;
- (nonnull NSArray<NSString *> *)paymentMethods;
- (nonnull DTPaymentRequest *)paymentRequest;
- (nullable DTSavedPaymentMethod *)savedPaymentMethod;
- (nonnull NSArray<NSString *> *)dccEnabledMethods;

@end
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
@class DTAuthorizationRequestResponse;
@class DTCard;
@class DTCardAliasRequestResponse;
@class DTDCCServiceResponse;
@class DTPaymentAuthorizationRequest;
@class DTPaymentOptions;
@class DTPaymentRequest;
Expand Down Expand Up @@ -50,7 +51,7 @@ typedef enum {

- (void)requestInitialTransaction:(NSString *)mobileToken idempotencyKey:(NSString *)idempotencyKey completion:(void (^)(NSData *, NSError *))completion;
- (void)requestCardAliasForMerchantId:(NSString *)merchantId card:(DTCard *)card options:(DTPaymentOptions *)options completion:(void (^)(DTCardAliasRequestResponse *, NSError *))completion;
- (void)requestStatusForMerchantId:(NSString *)merchantId alias:(NSString *)alias currencyCode:(NSString *)currencyCode isAliasRequest:(BOOL)isAliasRequest completion:(void(^)(DTStatusRequestResponse *, NSError *))completion;
- (void)requestStatusForMerchantId:(NSString *)merchantId alias:(NSString *)alias currencyCode:(NSString *)currencyCode isAliasRequest:(BOOL)isAliasRequest transactionId:(NSString *)transactionId isDCC:(BOOL)isDCC completion:(void(^)(DTStatusRequestResponse *, NSError *))completion;
- (void)requestTokenizationWithJSONBody:(NSData *)body completion:(void (^)(NSData *, NSError *))completion;
- (void)authorizeAliasPaymentRequest:(DTAliasPaymentAuthorizationRequest *)authorizationRequest completion:(void (^)(DTAuthorizationRequestResponse *, NSError *))completion;
- (void)authorizePaymentRequest:(DTPaymentAuthorizationRequest *)authorizationRequest completion:(void (^)(DTAuthorizationRequestResponse *, NSError *))completion; // split web payment
Expand All @@ -60,6 +61,7 @@ typedef enum {
- (void)TWINTStatusRequestForMerchantId:(NSString *)merchantId transactionId:(NSString *)transactionId options:(DTPaymentOptions *)options completion:(void (^)(DTTWINTStatusRequestResponse *, NSError *))completion;
- (void)cancelRequest:(DTPaymentRequest *)paymentRequest transactionId:(NSString *)transactionId;
- (void)startApplePayRequest:(DTPaymentRequest *)paymentRequest token:(NSString *)token options:(DTPaymentOptions *)options completion:(void (^)(DTStartApplePayRequestResponse *, NSError *))completion;
- (void)dccInfoForMerchantId:(NSString *)merchantId paymentMethod:(NSString *)paymentMethod cardno:(NSString *)cardno alias:(NSString *)alias completion:(void (^)(DTDCCServiceResponse *, NSError *))completion;

#pragma mark - Management
typedef void (^DTManagementCompletion)(NSError* error);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,6 @@
@property (nonatomic, assign) BOOL isVippsAppInstalled;
@property (nullable, nonatomic, strong) NSString* appCallbackUrl;
@property (nonatomic, assign) BOOL isPayment;
@property (nonatomic, assign) NSInteger savedCardDCCShowMode;

@end
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
- (nonnull NSString *)get3DStatusUrl:(BOOL)isAliasRequest;
- (nonnull NSString *)getAliasUrl;
- (nonnull NSString *)getApplePayUrl;
- (nonnull NSString *)getDCCServiceUrl;
- (nonnull NSString *)getAuthorizationUrl;
- (nonnull NSString *)getAuthorizationSplitUrl;
- (nonnull NSString *)getCancelUrl;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#import <Datatrans/DTUrls.h>

@class DTAliasRequest;
@class DTDCCModel;
@class DTPaymentOptions;
@class DTSavedCard;
@class DTWebCallbackUrls;
Expand All @@ -21,7 +22,7 @@
- (nonnull instancetype)initWithUrls:(nonnull DTUrls *)urls callbackUrls:(nonnull DTWebCallbackUrls *)callbackUrls;

- (nonnull NSURLRequest *)aliasInputRequestForRequest:(nonnull DTAliasRequest *)aliasRequest transactionModel:(nonnull id<DTTransactionModel>)transactionModel;
- (nonnull NSURLRequest *)authenticate3DRequestForRequest:(nonnull DTPaymentRequest *)paymentRequest creditCard:(nonnull DTSavedCard *)creditCard transactionId:(nonnull NSString *)transactionId testing:(BOOL)testing;
- (nonnull NSURLRequest *)authenticate3DRequestForRequest:(nonnull DTPaymentRequest *)paymentRequest creditCard:(nonnull DTSavedCard *)creditCard transactionId:(nonnull NSString *)transactionId testing:(BOOL)testing dccModel:(nullable DTDCCModel *)dccModel;
- (nonnull NSURLRequest *)paymentInputRequestForRequest:(nonnull DTPaymentRequest *)paymentRequest transactionModel:(nonnull id<DTTransactionModel>)transactionModel;

@end
Loading

0 comments on commit 0989138

Please sign in to comment.