Skip to content

Commit

Permalink
iOS: Release 1.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
skirsche-ieffects committed May 3, 2021
1 parent fea0bbd commit 26d7fed
Show file tree
Hide file tree
Showing 81 changed files with 1,548 additions and 230 deletions.
12 changes: 6 additions & 6 deletions Datatrans.xcframework/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,29 @@
<array>
<dict>
<key>LibraryIdentifier</key>
<string>ios-arm64</string>
<string>ios-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-x86_64-simulator</string>
<string>ios-arm64</string>
<key>LibraryPath</key>
<string>Datatrans.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>x86_64</string>
<string>arm64</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 @@ -7,11 +7,10 @@

@protocol DTErrorHandlerDelegate;
@protocol DTErrorPresenter;
@class DTUrls;

@interface DTErrorHandler : NSObject

- (nonnull instancetype)initWithDelegate:(nonnull id<DTErrorHandlerDelegate>)delegate errorPresenter:(nonnull id<DTErrorPresenter>)errorPresenter urls:(nonnull DTUrls *)urls suppressTransactionErrorDialog:(BOOL)suppressTransactionErrorDialog;
- (nonnull instancetype)initWithDelegate:(nonnull id<DTErrorHandlerDelegate>)delegate errorPresenter:(nonnull id<DTErrorPresenter>)errorPresenter suppressCriticalErrorDialog:(BOOL)suppressCriticalErrorDialog;

- (void)handleTechnicalError:(nonnull NSError *)error;
- (void)handleTechnicalError:(nonnull NSError *)error retryBlock:(void (^_Nullable)(void))retryBlock;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ typedef enum {
- (void)requestInitialTransaction:(NSString *)mobileToken idempotencyKey:(NSString *)idempotencyKey completion:(void (^)(NSData *, NSError *))completion;
- (void)requestAliasForMerchantId:(NSString *)merchantId cardNo:(NSString *)cardNo completion:(void (^)(DTAliasRequestResponse *, NSError *))completion;
- (void)requestStatusForMerchantId:(NSString *)merchantId alias:(NSString *)alias currencyCode:(NSString *)currencyCode isAliasRequest:(BOOL)isAliasRequest 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
- (void)startTokenRequest:(DTPaymentRequest *)paymentRequest paymentMethod:(NSString *)paymentMethod completion:(void (^)(DTStartTokenRequestResponse *, NSError *))completion;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ typedef enum {
@property (nonatomic, assign) BOOL creditCardScanningEnabled;
@property (nullable, nonatomic, copy) DTSwissBillingPaymentInfo* swissBillingPaymentInfo;
@property (nullable, nonatomic, copy) NSString* appCallbackScheme;
@property (nonatomic, assign) BOOL suppressTransactionErrorDialog;
@property (nonatomic, assign) BOOL suppressCriticalErrorDialog;
@property (nullable, nonatomic, copy) NSString* applePayMerchantIdentifier;
@property (nullable, nonatomic, copy) DTApplePayConfig* applePayConfig;
@property (nonatomic, assign) BOOL skipAuthorizationCompletion;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
- (nonnull NSString *)getCancelUrl;
- (nonnull NSString *)getInitialTransactionRequestUrl;
- (nonnull NSString *)getPaymentPostUrl:(BOOL)isResumed;
- (nonnull NSString *)getTokenizationRequestUrl;
- (nonnull NSString *)getTWINTRegistrationUrl;
- (nonnull NSString *)getTWINTStatusUrl;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,10 @@ SWIFT_CLASS_NAMED("Card")
/// Class to be used to represent the card expiry date (month and year).
SWIFT_CLASS_NAMED("CardExpiryDate")
@interface DTCardExpiryDate : NSObject <NSCopying>
/// Formats the month to a two digit string.
@property (nonatomic, readonly, copy) NSString * _Nonnull formattedMonth;
/// Formats the year to a two digit string.
@property (nonatomic, readonly, copy) NSString * _Nonnull formattedYear;
/// Card expiry month, [1, 12], e.g. 1 for January or 12 for December
@property (nonatomic) NSInteger month;
/// Card expiry year, 2 or 4 digits, e.g. 30 or 2030
Expand Down Expand Up @@ -670,9 +674,124 @@ SWIFT_CLASS_NAMED("ThemeConfiguration")
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
@end

@protocol DTTokenizationRequestDelegate;
@class DTTokenizationOptions;
@class NSNumber;
@class UIViewController;

/// Use this class to start a tokenization request. After the tokenization request has been
/// completed - regardless if successful or not - <code>delegate</code> will be called with some basic
/// information about the success or failure.
SWIFT_CLASS_NAMED("TokenizationRequest")
@interface DTTokenizationRequest : NSObject
/// This delegate will be notified after a tokenization request has been finished,
/// successfully or not.
@property (nonatomic, weak) id <DTTokenizationRequestDelegate> _Nullable delegate;
/// The available options for how a tokenization request is handled by the mobile SDK.
@property (nonatomic, strong) DTTokenizationOptions * _Nonnull options;
/// The theme to be used by the SDK.
@property (nonatomic, strong) DTThemeConfiguration * _Nonnull theme;
/// Use this init method if you use your own UI and already have a <code>Card</code> instance with the
/// card data to be tokenized. After this class is initialized, you should define its <code>delegate</code>,
/// the <code>options</code> properties and a <code>theme</code> if desired.
/// \param merchantId Your merchantId.
///
/// \param card Card object to tokenize.
///
- (nonnull instancetype)initWithMerchantId:(NSString * _Nonnull)merchantId card:(DTCard * _Nonnull)card OBJC_DESIGNATED_INITIALIZER;
/// Use this init method to allow the user to enter the card data to be tokenized. After this
/// class is initialized, you should define its <code>delegate</code>, the <code>options</code> properties
/// and a <code>theme</code> if desired.
/// This initializer is for use from Objective-C only. Instead of <code>[PaymentMethodType]</code>, it
/// takes <code>[NSNumber]</code> containing <code>rawValue</code>s of <code>PaymentMethodType</code>.
/// Example:
/// <code>[[DTTokenizationRequest alloc] initWithMerchantId:@"..." paymentMethodTypes:@[@(DTPaymentMethodTypeVisa), @(DTPaymentMethodTypeMasterCard)]];</code>
/// \param merchantId Your merchantId.
///
/// \param paymentMethodTypesObjc The allowed credit or debit card types.
///
- (nonnull instancetype)initWithMerchantId:(NSString * _Nonnull)merchantId paymentMethodTypes:(NSArray<NSNumber *> * _Nonnull)paymentMethodTypesObjc;
/// Starts the SDK and displays any needed user interface using the provided
/// <code>presentingController</code>. Note that a tokenization request can only
/// be started once.
/// \param presentingController <code>UIViewController</code>
/// used to present the user interface during an on-going tokenization request.
///
- (void)startWithPresentingController:(UIViewController * _Nonnull)presentingController;
- (nonnull instancetype)init SWIFT_UNAVAILABLE;
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
@end

@class DTTokenizationRequestError;

/// Implement TokenizationRequestDelegate to be notified when a tokenization
/// request ends. TokenizationRequestDelegate will notify you about the success,
/// error or cancel state of the processed tokenization request.
SWIFT_PROTOCOL_NAMED("TokenizationRequestDelegate")
@protocol DTTokenizationRequestDelegate
/// This is called after a tokenization request has been successfully
/// completed. This callback provides details about the tokenization request.
/// \param tokenizationRequest The object containing the information
/// of the completed tokenization request.
///
/// \param tokenizationId The resulting tokenizationId.
///
- (void)tokenizationRequestDidFinish:(DTTokenizationRequest * _Nonnull)tokenizationRequest tokenizationId:(NSString * _Nonnull)tokenizationId;
/// This is called after a tokenization request fails or encounters an error.
/// Keep in mind that the SDK shows the error to the user before
/// this is invoked. Therefore, this callback can be used to cancel
/// any on-going process involving the tokenization request.
/// You may also use the error details provided here and display it
/// the way you want when suppressing the error message within
/// the <code>TokenizationRequestOptions</code>.
/// \param tokenizationRequest The object containing the information
/// of the failed tokenization request.
///
/// \param error The error that occurred.
///
- (void)tokenizationRequestDidFail:(DTTokenizationRequest * _Nonnull)tokenizationRequest error:(DTTokenizationRequestError * _Nonnull)error;
@optional
/// This is called after a tokenization request has been cancelled. This callback
/// can be used to cancel any on-going process involving the tokenization request.
/// \param tokenizationRequest The object containing the
/// information of the cancelled tokenization request.
///
- (void)tokenizationRequestDidCancel:(DTTokenizationRequest * _Nonnull)tokenizationRequest;
@end


/// This class includes the error message of a tokenization request.
SWIFT_CLASS_NAMED("TokenizationRequestError")
@interface DTTokenizationRequestError : NSError
- (nonnull instancetype)initWithDomain:(NSString * _Nonnull)domain code:(NSInteger)code userInfo:(NSDictionary<NSString *, id> * _Nullable)dict OBJC_DESIGNATED_INITIALIZER;
- (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)coder OBJC_DESIGNATED_INITIALIZER;
@end


/// This class can be used to specify miscellaneous options related to the tokenization request.
SWIFT_CLASS_NAMED("TokenizationRequestOptions")
@interface DTTokenizationOptions : NSObject
/// Use this setting to change the UI language. If this is not
/// specified, the default language determined by the system will be used.
/// The supported values are <code>de</code>, <code>en</code>, <code>fr</code>, <code>it</code> and <code>nil</code>.
@property (nonatomic, copy) NSString * _Nullable language;
/// Use this setting to display or hide critical errors.
@property (nonatomic) BOOL suppressCriticalErrorDialog;
/// Use this setting to switch from production to sandbox. If not specified,
/// the SDK will call the Datatrans production environment.
@property (nonatomic) BOOL testing;
/// Whether secure connections to Datatrans servers require a certificate
/// chain signed with a specific CA private key. The device’s trust settings
/// are explicitly ignored, i.e. custom installed/white-listed certificates
/// and/or CAs will not work.
/// 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;
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
@end

@protocol DTTransactionDelegate;
@class DTTransactionOptions;
@class UIViewController;

/// Use this class to start a transaction with a <code>mobileToken</code> that has previously been initialized
/// with a server-to-server init call. This class is the main class to start any operation with the SDK.
Expand Down Expand Up @@ -770,7 +889,6 @@ SWIFT_PROTOCOL_NAMED("TransactionDelegate")
- (void)transactionDidCancel:(DTTransaction * _Nonnull)transaction;
@end

@class NSNumber;

/// This class includes the error message and other details of a transaction.
SWIFT_CLASS_NAMED("TransactionError")
Expand Down Expand Up @@ -800,7 +918,7 @@ SWIFT_CLASS_NAMED("TransactionOptions")
/// :nodoc:
@property (nonatomic, copy) NSDictionary<NSString *, NSString *> * _Nullable merchantProperties;
/// Use this setting to display or hide critical and transaction errors.
@property (nonatomic) BOOL suppressTransactionErrorDialog;
@property (nonatomic) BOOL suppressCriticalErrorDialog;
/// Use this setting to switch from production to sandbox. If not specified,
/// the SDK will call the Datatrans production environment.
@property (nonatomic) BOOL testing;
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,32 @@ import WebKit
@objc override public init(type: Datatrans.PaymentMethodType, token: Swift.String, cardExpiryDate: Datatrans.CardExpiryDate?, maskedCardNumber: Swift.String?, cardholder: Swift.String?)
@objc required public init?(coder: Foundation.NSCoder)
}
@_inheritsConvenienceInitializers @objc(DTTokenizationRequestError) public class TokenizationRequestError : Foundation.NSError {
@objc deinit
@objc override dynamic public init(domain: Swift.String, code: Swift.Int, userInfo dict: [Swift.String : Any]? = nil)
@objc required dynamic public init?(coder: Foundation.NSCoder)
}
@_inheritsConvenienceInitializers @objc(DTTransactionOptions) @objcMembers public class TransactionOptions : ObjectiveC.NSObject {
@objc public var appCallbackScheme: Swift.String?
@objc public var applePayConfig: Datatrans.ApplePayConfig?
@objc public var merchantProperties: [Swift.String : Swift.String]?
@objc public var suppressTransactionErrorDialog: Swift.Bool
@objc public var suppressCriticalErrorDialog: Swift.Bool
@objc public var testing: Swift.Bool
@objc public var useCertificatePinning: Swift.Bool
@objc deinit
@objc override dynamic public init()
}
@objc(DTTokenizationRequestDelegate) public protocol TokenizationRequestDelegate : AnyObject {
@objc func tokenizationRequestDidFinish(_ tokenizationRequest: Datatrans.TokenizationRequest, tokenizationId: Swift.String)
@objc func tokenizationRequestDidFail(_ tokenizationRequest: Datatrans.TokenizationRequest, error: Datatrans.TokenizationRequestError)
@objc optional func tokenizationRequestDidCancel(_ tokenizationRequest: Datatrans.TokenizationRequest)
}
@_inheritsConvenienceInitializers @objc(DTTokenizationOptions) @objcMembers public class TokenizationRequestOptions : ObjectiveC.NSObject {
@objc public var language: Swift.String? {
@objc get
@objc set
}
@objc public var suppressCriticalErrorDialog: Swift.Bool
@objc public var testing: Swift.Bool
@objc public var useCertificatePinning: Swift.Bool
@objc deinit
Expand Down Expand Up @@ -195,6 +216,17 @@ import WebKit
@objc deinit
@objc override dynamic public init()
}
@objc(DTTokenizationRequest) public class TokenizationRequest : ObjectiveC.NSObject {
@objc weak public var delegate: Datatrans.TokenizationRequestDelegate?
@objc public var options: Datatrans.TokenizationRequestOptions
@objc public var theme: Datatrans.ThemeConfiguration
@objc public init(merchantId: Swift.String, card: Datatrans.Card)
public init(merchantId: Swift.String, paymentMethodTypes: [Datatrans.PaymentMethodType])
@objc(initWithMerchantId:paymentMethodTypes:) convenience public init(merchantId: Swift.String, paymentMethodTypesObjc: [Foundation.NSNumber])
@objc public func start(presentingController: UIKit.UIViewController)
@objc deinit
@objc override dynamic public init()
}
@objc(DTPaymentMethod) @objcMembers public class PaymentMethod : ObjectiveC.NSObject, Swift.Codable, Foundation.NSCoding, Foundation.NSCopying {
@objc final public let type: Datatrans.PaymentMethodType
@objc public init(type: Datatrans.PaymentMethodType)
Expand All @@ -207,6 +239,12 @@ import WebKit
@objc deinit
}
@objc(DTCardExpiryDate) @objcMembers public class CardExpiryDate : ObjectiveC.NSObject, Swift.Codable, Foundation.NSCopying {
@objc public var formattedMonth: Swift.String {
@objc get
}
@objc public var formattedYear: Swift.String {
@objc get
}
@objc public var month: Swift.Int {
@objc get
@objc set
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,32 @@ import WebKit
@objc override public init(type: Datatrans.PaymentMethodType, token: Swift.String, cardExpiryDate: Datatrans.CardExpiryDate?, maskedCardNumber: Swift.String?, cardholder: Swift.String?)
@objc required public init?(coder: Foundation.NSCoder)
}
@_inheritsConvenienceInitializers @objc(DTTokenizationRequestError) public class TokenizationRequestError : Foundation.NSError {
@objc deinit
@objc override dynamic public init(domain: Swift.String, code: Swift.Int, userInfo dict: [Swift.String : Any]? = nil)
@objc required dynamic public init?(coder: Foundation.NSCoder)
}
@_inheritsConvenienceInitializers @objc(DTTransactionOptions) @objcMembers public class TransactionOptions : ObjectiveC.NSObject {
@objc public var appCallbackScheme: Swift.String?
@objc public var applePayConfig: Datatrans.ApplePayConfig?
@objc public var merchantProperties: [Swift.String : Swift.String]?
@objc public var suppressTransactionErrorDialog: Swift.Bool
@objc public var suppressCriticalErrorDialog: Swift.Bool
@objc public var testing: Swift.Bool
@objc public var useCertificatePinning: Swift.Bool
@objc deinit
@objc override dynamic public init()
}
@objc(DTTokenizationRequestDelegate) public protocol TokenizationRequestDelegate : AnyObject {
@objc func tokenizationRequestDidFinish(_ tokenizationRequest: Datatrans.TokenizationRequest, tokenizationId: Swift.String)
@objc func tokenizationRequestDidFail(_ tokenizationRequest: Datatrans.TokenizationRequest, error: Datatrans.TokenizationRequestError)
@objc optional func tokenizationRequestDidCancel(_ tokenizationRequest: Datatrans.TokenizationRequest)
}
@_inheritsConvenienceInitializers @objc(DTTokenizationOptions) @objcMembers public class TokenizationRequestOptions : ObjectiveC.NSObject {
@objc public var language: Swift.String? {
@objc get
@objc set
}
@objc public var suppressCriticalErrorDialog: Swift.Bool
@objc public var testing: Swift.Bool
@objc public var useCertificatePinning: Swift.Bool
@objc deinit
Expand Down Expand Up @@ -195,6 +216,17 @@ import WebKit
@objc deinit
@objc override dynamic public init()
}
@objc(DTTokenizationRequest) public class TokenizationRequest : ObjectiveC.NSObject {
@objc weak public var delegate: Datatrans.TokenizationRequestDelegate?
@objc public var options: Datatrans.TokenizationRequestOptions
@objc public var theme: Datatrans.ThemeConfiguration
@objc public init(merchantId: Swift.String, card: Datatrans.Card)
public init(merchantId: Swift.String, paymentMethodTypes: [Datatrans.PaymentMethodType])
@objc(initWithMerchantId:paymentMethodTypes:) convenience public init(merchantId: Swift.String, paymentMethodTypesObjc: [Foundation.NSNumber])
@objc public func start(presentingController: UIKit.UIViewController)
@objc deinit
@objc override dynamic public init()
}
@objc(DTPaymentMethod) @objcMembers public class PaymentMethod : ObjectiveC.NSObject, Swift.Codable, Foundation.NSCoding, Foundation.NSCopying {
@objc final public let type: Datatrans.PaymentMethodType
@objc public init(type: Datatrans.PaymentMethodType)
Expand All @@ -207,6 +239,12 @@ import WebKit
@objc deinit
}
@objc(DTCardExpiryDate) @objcMembers public class CardExpiryDate : ObjectiveC.NSObject, Swift.Codable, Foundation.NSCopying {
@objc public var formattedMonth: Swift.String {
@objc get
}
@objc public var formattedYear: Swift.String {
@objc get
}
@objc public var month: Swift.Int {
@objc get
@objc set
Expand Down
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@

@protocol DTErrorHandlerDelegate;
@protocol DTErrorPresenter;
@class DTUrls;

@interface DTErrorHandler : NSObject

- (nonnull instancetype)initWithDelegate:(nonnull id<DTErrorHandlerDelegate>)delegate errorPresenter:(nonnull id<DTErrorPresenter>)errorPresenter urls:(nonnull DTUrls *)urls suppressTransactionErrorDialog:(BOOL)suppressTransactionErrorDialog;
- (nonnull instancetype)initWithDelegate:(nonnull id<DTErrorHandlerDelegate>)delegate errorPresenter:(nonnull id<DTErrorPresenter>)errorPresenter suppressCriticalErrorDialog:(BOOL)suppressCriticalErrorDialog;

- (void)handleTechnicalError:(nonnull NSError *)error;
- (void)handleTechnicalError:(nonnull NSError *)error retryBlock:(void (^_Nullable)(void))retryBlock;
Expand Down
Loading

0 comments on commit 26d7fed

Please sign in to comment.