Skip to content

Commit

Permalink
Merge pull request #268 from iZettle/sdk-release-v2.3.2
Browse files Browse the repository at this point in the history
SDK Release v2.3.2
  • Loading branch information
saidsikira authored Oct 16, 2019
2 parents 6da6a9b + cdccf9f commit 35d413d
Show file tree
Hide file tree
Showing 44 changed files with 156 additions and 3 deletions.
11 changes: 11 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: 2
jobs:
build:
macos:
xcode: "10.3.0"

steps:
- checkout
- run:
name: Build and run tests
command: xcodebuild -project Example/iZettleSDKSample.xcodeproj clean build CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO | xcpretty -c
2 changes: 1 addition & 1 deletion Carthage/iZettleSDK.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@
"1.6": "https://github.com/iZettle/sdk-ios/releases/download/1.6/iZettleSDK.zip",
"1.5": "https://github.com/iZettle/sdk-ios/releases/download/1.5/iZettleSDK.zip",
"1.4.2": "https://github.com/iZettle/sdk-ios/releases/download/1.4.2/iZettleSDK.zip",
"2.3.1": "https://github.com/iZettle/sdk-ios/releases/download/2.3.1/iZettleSDK.zip"
"2.3.2": "https://github.com/iZettle/sdk-ios/releases/download/2.3.2/iZettleSDK.zip"
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -417,4 +417,4 @@ authorizationCode = 004601

## Errors

iZettle will display any errors that occur during an operation to the user, the NSError-object returned in the operation completion block is only intended to be used by developers for debugging, diagnostics and logging to be able to better communicate errors to iZettle. You should never present the returned errors to the end user.
iZettle will display any errors that occur during an operation to the user, the NSError-object returned in the operation completion block is only intended to be used by developers for debugging, diagnostics and logging to be able to better communicate errors to iZettle. You should never present the returned errors to the end user.
2 changes: 1 addition & 1 deletion iZettleSDK.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'iZettleSDK'
s.version = '2.3.1'
s.version = '2.3.2'
s.summary = 'iZettle SDK for iOS'
s.description = <<-DESC
For detailed information, please see iZettleSDK documentation and Readme.
Expand Down
Binary file modified iZettleSDK/iZettlePayments.framework/Assets.car
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 modified iZettleSDK/iZettlePayments.framework/Info.plist
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.
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 modified iZettleSDK/iZettlePayments.framework/iZettlePayments
Binary file not shown.
136 changes: 136 additions & 0 deletions iZettleSDK/iZettleSDK.framework/Headers/iZettleSDK.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
//
// iZettleSDK.h
//
// Copyright (c) 2014 iZettle. All rights reserved.

@import UIKit;

NS_ASSUME_NONNULL_BEGIN

@class iZettleSDKPaymentInfo;

/// SDK error domain
extern NSErrorDomain const IZSDKErrorDomain;

/**
Defines SDK errors
*/
typedef NS_ERROR_ENUM(IZSDKErrorDomain, IZSDKErrorCode) {
IZSDKErrorCodeUserNotLoggedIn = -1,
IZSDKErrorCodePaymentNotFound = -100,
IZSDKErrorCodeReferenceTooLong = -101,
IZSDKErrorCodeOperationAlreadyInProgress = -300,
};

typedef void(^iZettleSDKOperationCompletion)(iZettleSDKPaymentInfo * _Nullable paymentInfo, NSError * _Nullable error);

@interface iZettleSDK : NSObject

@property (nonatomic, readonly) NSString *version;

+ (iZettleSDK *)shared;
- (void)startWithAPIKey:(NSString *)APIKey
NS_SWIFT_NAME(start(with:));

/// If set only an iZettle user with this account will be allowed to be logged in.
@property (nonatomic, copy, nullable) NSString *enforcedUserAccount;

@end

@interface iZettleSDK (Operations)

/**
Logout current account
*/
- (void)logout;

/**
Perform a payment with an amount and a reference.
@param amount The amount to be charged in the logged in users currency
@param enableTipping Enable tipping flow
@param reference The payment reference. Used to identify an iZettle payment, used when retrieving payment
information at a later time or performing a refund. Max length 128. (Optional)
@param viewController A controller from which iZettle will present its UI
@param completion Completion handler that will be called when the operation finishes
@remark Enabling tipping does not guarantee that tipping flow will be displayed. Tipping flow will only be displayed
for logged in account and active reader supports tipping.
*/
- (void)chargeAmount:(NSDecimalNumber *)amount
enableTipping:(BOOL)enableTipping
reference:(nullable NSString *)reference
presentFromViewController:(UIViewController *)viewController
completion:(iZettleSDKOperationCompletion)completion
NS_SWIFT_NAME(charge(amount:enableTipping:reference:presentFrom:completion:));

/// Refund an amount from a payment with a given reference.
/// @param amount: The amount to be refunded from the payment (Optional, `nil` will refund full amount of original payment)
/// @param reference: The reference of the payment that is to be refunded.
/// @param refundReference: The reference of the refund. Max length 128. (Optional)
/// @param viewController: A controller from which iZettle will present its UI.
/// @param completion: Completion handler that will be called when the operation finishes.
- (void)refundAmount:(nullable NSDecimalNumber *)amount
ofPaymentWithReference:(NSString *)reference
refundReference:(nullable NSString *)refundReference
presentFromViewController:(UIViewController *)viewController
completion:(iZettleSDKOperationCompletion)completion
NS_SWIFT_NAME(refund(amount:ofPayment:withRefundReference:presentFrom:completion:));;

/// Query iZettle for payment information of a payment with a given reference.
/// @param reference: The payment reference to query.
/// @param viewController: A controller from which iZettle will present its UI.
/// @param completion: Completion handler that will be called when the operation finishes.
- (void)retrievePaymentInfoForReference:(NSString *)reference
presentFromViewController:(UIViewController *)viewController
completion:(iZettleSDKOperationCompletion)completion
NS_SWIFT_NAME(retrievePaymentInfo(for:presentFrom:completion:));

/// Query iZettle for payment information of a payment with a given reference.
/// @param reference: The payment reference to query.
/// @param completion: Completion handler that will be called when the operation finishes.
- (void)retrievePaymentInfoForReference:(NSString *)reference
completion:(iZettleSDKOperationCompletion)completion
NS_SWIFT_NAME(retrievePaymentInfo(for:completion:));

/// Present iZettle settings view. The user can switch account, access the iZettle FAQ, view card reader settings etc.
/// @param viewController: A controller from which iZettle will present its UI.
- (void)presentSettingsFromViewController:(UIViewController *)viewController
NS_SWIFT_NAME(presentSettings(from:));

/// Attempt aborting the ongoing operation. Only use this if absolutely necessary. The state of the payment will be unknown to the user after this call.
- (void)abortOperation;

@end

@interface iZettleSDKPaymentInfo : NSObject

@property (nonatomic, readonly) NSDictionary<NSString *, id> *dictionary; // Dictionary representation of the payment information

@property (nonatomic, readonly) NSDecimalNumber *amount; // Paid amount (including gratuityAmount)
@property (nonatomic, readonly, nullable) NSDecimalNumber *gratuityAmount; // The amount of gratuity paid

@property (nonatomic, readonly) NSString *referenceNumber; // iZettles reference to the payment
@property (nonatomic, readonly) NSString *entryMode; // EMV, CONTACTLESS_EMV, MAGSTRIPE_CONTACTLESS, MAGSTRIPE etc
@property (nonatomic, readonly) NSString *authorizationCode;

@property (nonatomic, readonly) NSString *obfuscatedPan; // **** **** **** 1111
@property (nonatomic, readonly) NSString *panHash; // Hash sum of the plain pan
@property (nonatomic, readonly) NSString *cardBrand;

@property (nonatomic, readonly, nullable) NSString *AID;
@property (nonatomic, readonly, nullable) NSString *TSI;
@property (nonatomic, readonly, nullable) NSString *TVR;
@property (nonatomic, readonly, nullable) NSString *applicationName;

// Only used for certain markets
@property (nonatomic, readonly, nullable) NSNumber *numberOfInstallments;
@property (nonatomic, readonly, nullable) NSDecimalNumber *installmentAmount;

// Only used for Mexico
@property (nonatomic, readonly, nullable) NSString *mxFIID;
@property (nonatomic, readonly, nullable) NSString *mxCardType;

@end

NS_ASSUME_NONNULL_END
Binary file modified iZettleSDK/iZettleSDK.framework/Info.plist
Binary file not shown.
6 changes: 6 additions & 0 deletions iZettleSDK/iZettleSDK.framework/Modules/module.modulemap
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
framework module iZettleSDK {
umbrella header "iZettleSDK.h"

export *
module * { export * }
}
Binary file modified iZettleSDK/iZettleSDK.framework/iZettleSDK
Binary file not shown.
Binary file modified iZettleSDK/iZettleShared.framework/Assets.car
Binary file not shown.
Binary file modified iZettleSDK/iZettleShared.framework/Info.plist
Binary file not shown.
Binary file modified iZettleSDK/iZettleShared.framework/iZettleShared
Binary file not shown.
Binary file modified iZettleSDK/iZettleTransport.framework/Info.plist
Binary file not shown.
Binary file modified iZettleSDK/iZettleTransport.framework/iZettleTransport
Binary file not shown.

0 comments on commit 35d413d

Please sign in to comment.