diff --git a/Sources/Categories/SCCAPIRequest+Serialization.h b/Sources/Categories/SCCAPIRequest+Serialization.h index 12478fc..d6ea212 100644 --- a/Sources/Categories/SCCAPIRequest+Serialization.h +++ b/Sources/Categories/SCCAPIRequest+Serialization.h @@ -31,6 +31,8 @@ extern NSString *__nonnull const SCCAPIRequestOptionsKey; extern NSString *__nonnull const SCCAPIRequestOptionsClearDefaultFeesKey; extern NSString *__nonnull const SCCAPIRequestOptionsSupportedTenderTypesKey; extern NSString *__nonnull const SCCAPIRequestOptionsAutoReturnKey; +extern NSString *__nonnull const SCCAPIRequestOptionsDisableCNPKey; +extern NSString *__nonnull const SCCAPIRequestOptionsSkipReceiptKey; extern NSString *__nonnull const SCCAPIRequestOptionsTenderTypeStringCard; extern NSString *__nonnull const SCCAPIRequestOptionsTenderTypeStringCash; extern NSString *__nonnull const SCCAPIRequestOptionsTenderTypeStringOther; diff --git a/Sources/SCCAPIRequest.h b/Sources/SCCAPIRequest.h index 7d256da..650f1f1 100644 --- a/Sources/SCCAPIRequest.h +++ b/Sources/SCCAPIRequest.h @@ -136,6 +136,14 @@ typedef NS_OPTIONS(NSUInteger, SCCAPIRequestTenderTypes) { /// of the value of this parameter. @property (nonatomic, assign, readonly) BOOL returnsAutomaticallyAfterPayment; +/// If YES, Point of Sale will not display the option to manually key-in a credit card number. +/// Defaults to NO. +@property (nonatomic, assign) BOOL disablesKeyedInCardEntry; + +/// If YES, Point of Sale will skip the receipt screen of the payment flow for non-cash payments. +/// Defaults to NO. +@property (nonatomic, assign) BOOL skipsReceipt; + /** @param request The request to compare the receiver to. @return YES if the receiver and `request` are logically equivalent. diff --git a/Sources/SCCAPIRequest.m b/Sources/SCCAPIRequest.m index c942d90..4b763fb 100644 --- a/Sources/SCCAPIRequest.m +++ b/Sources/SCCAPIRequest.m @@ -42,6 +42,8 @@ NSString *__nonnull const SCCAPIRequestOptionsSupportedTenderTypesKey = @"supported_tender_types"; NSString *__nonnull const SCCAPIRequestOptionsClearDefaultFeesKey = @"clear_default_fees"; NSString *__nonnull const SCCAPIRequestOptionsAutoReturnKey = @"auto_return"; +NSString *__nonnull const SCCAPIRequestOptionsDisableCNPKey = @"disable_cnp"; +NSString *__nonnull const SCCAPIRequestOptionsSkipReceiptKey = @"skip_receipt"; NSString *__nonnull const SCCAPIRequestOptionsTenderTypeStringCard = @"CREDIT_CARD"; NSString *__nonnull const SCCAPIRequestOptionsTenderTypeStringCash = @"CASH"; NSString *__nonnull const SCCAPIRequestOptionsTenderTypeStringOther = @"OTHER"; @@ -185,7 +187,7 @@ - (NSUInteger)hash; { NSUInteger const hashOfRequiredFields = self.clientID.hash ^ self.callbackURL.hash ^ self.amount.hash; NSUInteger const hashOfOptionalFields = self.userInfoString.hash ^ self.locationID.hash ^ self.notes.hash ^ self.customerID.hash; - NSUInteger const hashOfScalarFields = (NSUInteger)self.supportedTenderTypes ^ (NSUInteger)self.clearsDefaultFees ^ (NSUInteger)self.returnsAutomaticallyAfterPayment; + NSUInteger const hashOfScalarFields = (NSUInteger)self.supportedTenderTypes ^ (NSUInteger)self.clearsDefaultFees ^ (NSUInteger)self.returnsAutomaticallyAfterPayment ^ (NSUInteger)self.disablesKeyedInCardEntry ^ (NSUInteger)self.skipsReceipt; return hashOfRequiredFields ^ hashOfOptionalFields ^ hashOfScalarFields; } @@ -232,7 +234,9 @@ - (BOOL)isEqualToAPIRequest:(nullable SCCAPIRequest *)request; // The following properties are scalar. if (!(self.supportedTenderTypes == request.supportedTenderTypes) || !(self.clearsDefaultFees == request.clearsDefaultFees) || - !(self.returnsAutomaticallyAfterPayment == request.returnsAutomaticallyAfterPayment)) { + !(self.returnsAutomaticallyAfterPayment == request.returnsAutomaticallyAfterPayment) || + !(self.disablesKeyedInCardEntry == request.disablesKeyedInCardEntry) || + !(self.skipsReceipt == request.skipsReceipt)) { return NO; } @@ -273,6 +277,8 @@ - (nullable NSURL *)APIRequestURLWithError:(out NSError *__nullable *__nullable) [options SCC_setSafeObject:supportedTenderTypes forKey:SCCAPIRequestOptionsSupportedTenderTypesKey]; [options SCC_setSafeObject:@(self.clearsDefaultFees) forKey:SCCAPIRequestOptionsClearDefaultFeesKey]; [options SCC_setSafeObject:@(self.returnsAutomaticallyAfterPayment) forKey:SCCAPIRequestOptionsAutoReturnKey]; + [options SCC_setSafeObject:@(self.disablesKeyedInCardEntry) forKey:SCCAPIRequestOptionsDisableCNPKey]; + [options SCC_setSafeObject:@(self.skipsReceipt) forKey:SCCAPIRequestOptionsSkipReceiptKey]; if (options.count) { [data SCC_setSafeObject:options forKey:SCCAPIRequestOptionsKey]; } diff --git a/SquarePointOfSaleSDK.podspec b/SquarePointOfSaleSDK.podspec index 8341d67..cdd5b4b 100644 --- a/SquarePointOfSaleSDK.podspec +++ b/SquarePointOfSaleSDK.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'SquarePointOfSaleSDK' - s.version = '3.3.1' + s.version = '3.3.2' s.summary = 'SDK for easier use of Square\'s Point of Sale app-switching API on iOS' s.homepage = 'https://github.com/square/SquarePointOfSaleSDK-iOS/' s.license = { :type => 'Apache License, Version 2.0', :text => "© #{ Date.today.year } Square, Inc." }