From 9e7082b6555d9bd40c6ce5d9bb49e73c5c1925c1 Mon Sep 17 00:00:00 2001 From: Budnikov Vyacheslav Date: Wed, 28 Sep 2016 13:14:45 +0300 Subject: [PATCH 01/28] replace NSNumber *paymentId to NSString *paymentId --- ASDKCore.xcodeproj/project.pbxproj | 8 +- .../Request/Charge/ASDKChargeRequest.h | 4 +- .../Request/Charge/ASDKChargeRequest.m | 2 +- .../ASDKFinishAuthorizeRequest.h | 4 +- .../ASDKFinishAuthorizeRequest.m | 2 +- .../Request/GetState/ASDKGetStateRequest.h | 4 +- .../Request/GetState/ASDKGetStateRequest.m | 2 +- .../Response/Init/ASDKInitResponse.h | 2 +- .../Response/Init/ASDKInitResponse.m | 14 +-- .../Response/PaymentInfo/ASDKPaymentInfo.h | 2 +- .../Response/PaymentInfo/ASDKPaymentInfo.m | 12 +- ASDKCore/ASDKAcquiringSdk.h | 6 +- ASDKCore/ASDKAcquiringSdk.m | 6 +- .../Charge/ASDKChargeRequestBuilder.h | 2 +- .../Charge/ASDKChargeRequestBuilder.m | 6 +- .../ASDKFinishAuthorizeRequestBuilder.h | 2 +- .../ASDKFinishAuthorizeRequestBuilder.m | 6 +- .../GetState/ASDKGetStateRequestBuilder.h | 2 +- .../GetState/ASDKGetStateRequestBuilder.m | 6 +- ASDKUI.xcodeproj/project.pbxproj | 10 +- ASDKUI/3DSController/ASDK3DSViewController.h | 4 +- ASDKUI/3DSController/ASDK3DSViewController.m | 8 +- .../ASDKPaymentFormStarter.h | 19 ++- .../ASDKPaymentFormStarter.m | 108 +++++++++++++++++- .../ASDKPaymentFormViewController.h | 4 +- .../ASDKPaymentFormViewController.m | 10 +- 26 files changed, 192 insertions(+), 63 deletions(-) diff --git a/ASDKCore.xcodeproj/project.pbxproj b/ASDKCore.xcodeproj/project.pbxproj index 3c52e2a..f2e4777 100644 --- a/ASDKCore.xcodeproj/project.pbxproj +++ b/ASDKCore.xcodeproj/project.pbxproj @@ -687,6 +687,7 @@ COPY_PHASE_STRIP = NO; CURRENT_PROJECT_VERSION = 1; DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_BITCODE = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu99; @@ -703,7 +704,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.3; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -736,6 +737,7 @@ COPY_PHASE_STRIP = NO; CURRENT_PROJECT_VERSION = 1; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_BITCODE = NO; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = gnu99; @@ -746,7 +748,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.3; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; @@ -764,6 +766,7 @@ DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_BITCODE = NO; INFOPLIST_FILE = ASDKCore/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 8.0; @@ -785,6 +788,7 @@ DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_BITCODE = NO; INFOPLIST_FILE = ASDKCore/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 8.0; diff --git a/ASDKCore/API Objects/Request/Charge/ASDKChargeRequest.h b/ASDKCore/API Objects/Request/Charge/ASDKChargeRequest.h index d30397a..3be05e4 100644 --- a/ASDKCore/API Objects/Request/Charge/ASDKChargeRequest.h +++ b/ASDKCore/API Objects/Request/Charge/ASDKChargeRequest.h @@ -22,11 +22,11 @@ @interface ASDKChargeRequest : ASDKAcquiringRequest -@property (nonatomic, strong) NSNumber *paymentId; +@property (nonatomic, strong) NSString *paymentId; @property (nonatomic, strong) NSNumber *rebillId; - (ASDKChargeRequest *)initWithTerminalKey:(NSString *)terminalKey - paymentId:(NSNumber *)paymentId + paymentId:(NSString *)paymentId rebillId:(NSNumber *)rebillId token:(NSString *)token; diff --git a/ASDKCore/API Objects/Request/Charge/ASDKChargeRequest.m b/ASDKCore/API Objects/Request/Charge/ASDKChargeRequest.m index 27a0b46..240c30c 100644 --- a/ASDKCore/API Objects/Request/Charge/ASDKChargeRequest.m +++ b/ASDKCore/API Objects/Request/Charge/ASDKChargeRequest.m @@ -23,7 +23,7 @@ @implementation ASDKChargeRequest - (ASDKChargeRequest *)initWithTerminalKey:(NSString *)terminalKey - paymentId:(NSNumber *)paymentId + paymentId:(NSString *)paymentId rebillId:(NSNumber *)rebillId token:(NSString *)token { diff --git a/ASDKCore/API Objects/Request/FinishAuthorize/ASDKFinishAuthorizeRequest.h b/ASDKCore/API Objects/Request/FinishAuthorize/ASDKFinishAuthorizeRequest.h index b20f9ab..25b81d4 100644 --- a/ASDKCore/API Objects/Request/FinishAuthorize/ASDKFinishAuthorizeRequest.h +++ b/ASDKCore/API Objects/Request/FinishAuthorize/ASDKFinishAuthorizeRequest.h @@ -22,13 +22,13 @@ @interface ASDKFinishAuthorizeRequest : ASDKAcquiringRequest -@property (nonatomic, strong) NSNumber *paymentId; +@property (nonatomic, strong) NSString *paymentId; @property (nonatomic, strong) NSString *sendEmail; @property (nonatomic, strong) NSString *cardData; @property (nonatomic, strong) NSString *infoEmail; - (ASDKFinishAuthorizeRequest *)initWithTerminalKey:(NSString *)terminalKey - paymentId:(NSNumber *)paymentId + paymentId:(NSString *)paymentId sendEmail:(NSString *)sendEmail cardData:(NSString *)cardData infoEmail:(NSString *)infoEmail diff --git a/ASDKCore/API Objects/Request/FinishAuthorize/ASDKFinishAuthorizeRequest.m b/ASDKCore/API Objects/Request/FinishAuthorize/ASDKFinishAuthorizeRequest.m index 41db5ac..59f0db1 100644 --- a/ASDKCore/API Objects/Request/FinishAuthorize/ASDKFinishAuthorizeRequest.m +++ b/ASDKCore/API Objects/Request/FinishAuthorize/ASDKFinishAuthorizeRequest.m @@ -23,7 +23,7 @@ @implementation ASDKFinishAuthorizeRequest - (ASDKFinishAuthorizeRequest *)initWithTerminalKey:(NSString *)terminalKey - paymentId:(NSNumber *)paymentId + paymentId:(NSString *)paymentId sendEmail:(NSString *)sendEmail cardData:(NSString *)cardData infoEmail:(NSString *)infoEmail diff --git a/ASDKCore/API Objects/Request/GetState/ASDKGetStateRequest.h b/ASDKCore/API Objects/Request/GetState/ASDKGetStateRequest.h index ba0921d..45d2091 100644 --- a/ASDKCore/API Objects/Request/GetState/ASDKGetStateRequest.h +++ b/ASDKCore/API Objects/Request/GetState/ASDKGetStateRequest.h @@ -22,10 +22,10 @@ @interface ASDKGetStateRequest : ASDKAcquiringRequest -@property (nonatomic, strong) NSNumber *paymentId; +@property (nonatomic, strong) NSString *paymentId; - (ASDKGetStateRequest *)initWithTerminalKey:(NSString *)terminalKey - paymentId:(NSNumber *)paymentId + paymentId:(NSString *)paymentId token:(NSString *)token; @end diff --git a/ASDKCore/API Objects/Request/GetState/ASDKGetStateRequest.m b/ASDKCore/API Objects/Request/GetState/ASDKGetStateRequest.m index 3130a74..ab674fb 100644 --- a/ASDKCore/API Objects/Request/GetState/ASDKGetStateRequest.m +++ b/ASDKCore/API Objects/Request/GetState/ASDKGetStateRequest.m @@ -23,7 +23,7 @@ @implementation ASDKGetStateRequest - (ASDKGetStateRequest *)initWithTerminalKey:(NSString *)terminalKey - paymentId:(NSNumber *)paymentId + paymentId:(NSString *)paymentId token:(NSString *)token { ASDKGetStateRequest *request = [[ASDKGetStateRequest alloc] init]; diff --git a/ASDKCore/API Objects/Response/Init/ASDKInitResponse.h b/ASDKCore/API Objects/Response/Init/ASDKInitResponse.h index f31dccb..7bbef70 100644 --- a/ASDKCore/API Objects/Response/Init/ASDKInitResponse.h +++ b/ASDKCore/API Objects/Response/Init/ASDKInitResponse.h @@ -24,6 +24,6 @@ @property (nonatomic, strong) NSNumber *amount; @property (nonatomic, copy) NSString *orderId; -@property (nonatomic, strong) NSNumber *paymentId; +@property (nonatomic, strong) NSString *paymentId; @end diff --git a/ASDKCore/API Objects/Response/Init/ASDKInitResponse.m b/ASDKCore/API Objects/Response/Init/ASDKInitResponse.m index f761385..6373496 100644 --- a/ASDKCore/API Objects/Response/Init/ASDKInitResponse.m +++ b/ASDKCore/API Objects/Response/Init/ASDKInitResponse.m @@ -29,16 +29,16 @@ - (void)clearAllProperties _orderId = nil; } -- (NSNumber *)paymentId +- (NSString *)paymentId { if (!_paymentId) { - _paymentId =_dictionary[kASDKPaymentId]; - - if (![_paymentId isKindOfClass:[NSNumber class]]) - { - _paymentId = [NSNumber numberWithDouble:_paymentId.doubleValue]; - } + _paymentId =[_dictionary objectForKey:kASDKPaymentId]; + + //if (![_paymentId isKindOfClass:[NSNumber class]]) + //{ + // _paymentId = [NSNumber numberWithDouble:_paymentId.doubleValue]; + //} } return _paymentId; diff --git a/ASDKCore/API Objects/Response/PaymentInfo/ASDKPaymentInfo.h b/ASDKCore/API Objects/Response/PaymentInfo/ASDKPaymentInfo.h index ea7a8f7..9de5327 100644 --- a/ASDKCore/API Objects/Response/PaymentInfo/ASDKPaymentInfo.h +++ b/ASDKCore/API Objects/Response/PaymentInfo/ASDKPaymentInfo.h @@ -23,7 +23,7 @@ @interface ASDKPaymentInfo : ASDKBaseObject -@property (nonatomic, strong) NSNumber *paymentId; +@property (nonatomic, strong) NSString *paymentId; @property (nonatomic, copy) NSString *orderId; @property (nonatomic, strong) NSNumber *amount; diff --git a/ASDKCore/API Objects/Response/PaymentInfo/ASDKPaymentInfo.m b/ASDKCore/API Objects/Response/PaymentInfo/ASDKPaymentInfo.m index f04f38b..50c2ce6 100644 --- a/ASDKCore/API Objects/Response/PaymentInfo/ASDKPaymentInfo.m +++ b/ASDKCore/API Objects/Response/PaymentInfo/ASDKPaymentInfo.m @@ -23,16 +23,16 @@ @implementation ASDKPaymentInfo -- (NSNumber *)paymentId +- (NSString *)paymentId { if (!_paymentId) { - _paymentId =_dictionary[kASDKPaymentId]; + _paymentId = [_dictionary objectForKey:kASDKPaymentId]; - if (![_paymentId isKindOfClass:[NSNumber class]]) - { - _paymentId = [NSNumber numberWithDouble:_paymentId.doubleValue]; - } + //if (![_paymentId isKindOfClass:[NSNumber class]]) + //{ + // _paymentId = [NSNumber numberWithDouble:_paymentId.doubleValue]; + //} } return _paymentId; diff --git a/ASDKCore/ASDKAcquiringSdk.h b/ASDKCore/ASDKAcquiringSdk.h index c3ee7b7..c8bd73c 100644 --- a/ASDKCore/ASDKAcquiringSdk.h +++ b/ASDKCore/ASDKAcquiringSdk.h @@ -70,18 +70,18 @@ success:(void (^)(ASDKInitResponse *response))success failure:(void (^)(ASDKAcquringSdkError *error))failure; -- (void)finishAuthorizeWithPaymentId:(NSNumber *)paymentId +- (void)finishAuthorizeWithPaymentId:(NSString *)paymentId cardData:(NSString *)cardData infoEmail:(NSString *)infoEmail success:(void (^)(ASDKThreeDsData *data, ASDKPaymentInfo *paymentInfo, ASDKPaymentStatus status))success failure:(void (^)(ASDKAcquringSdkError *error))failure; -- (void)chargeWithPaymentId:(NSNumber *)paymentId +- (void)chargeWithPaymentId:(NSString *)paymentId rebillId:(NSNumber *)rebillId success:(void (^)(ASDKThreeDsData *data, ASDKPaymentInfo *paymentInfo))success failure:(void (^)(ASDKAcquringSdkError *error))failure; -- (void)getStateWithPaymentId:(NSNumber *)paymentId +- (void)getStateWithPaymentId:(NSString *)paymentId success:(void (^)(ASDKPaymentInfo *paymentInfo, ASDKPaymentStatus status))success failure:(void (^)(ASDKAcquringSdkError *error))failure; diff --git a/ASDKCore/ASDKAcquiringSdk.m b/ASDKCore/ASDKAcquiringSdk.m index f75dc57..07548fc 100644 --- a/ASDKCore/ASDKAcquiringSdk.m +++ b/ASDKCore/ASDKAcquiringSdk.m @@ -130,7 +130,7 @@ - (void)initWithAmount:(NSNumber *)amount } } -- (void)finishAuthorizeWithPaymentId:(NSNumber *)paymentId +- (void)finishAuthorizeWithPaymentId:(NSString *)paymentId cardData:(NSString *)cardData infoEmail:(NSString *)infoEmail success:(void (^)(ASDKThreeDsData *data, ASDKPaymentInfo *paymentInfo, ASDKPaymentStatus status))success @@ -164,7 +164,7 @@ - (void)finishAuthorizeWithPaymentId:(NSNumber *)paymentId } } -- (void)chargeWithPaymentId:(NSNumber *)paymentId +- (void)chargeWithPaymentId:(NSString *)paymentId rebillId:(NSNumber *)rebillId success:(void (^)(ASDKThreeDsData *data, ASDKPaymentInfo *paymentInfo))success failure:(void (^)(ASDKAcquringSdkError *error))failure @@ -197,7 +197,7 @@ - (void)chargeWithPaymentId:(NSNumber *)paymentId } -- (void)getStateWithPaymentId:(NSNumber *)paymentId +- (void)getStateWithPaymentId:(NSString *)paymentId success:(void (^)(ASDKPaymentInfo *paymentInfo, ASDKPaymentStatus status))success failure:(void (^)(ASDKAcquringSdkError *error))failure { diff --git a/ASDKCore/RequestBuilder/Charge/ASDKChargeRequestBuilder.h b/ASDKCore/RequestBuilder/Charge/ASDKChargeRequestBuilder.h index 7e74e65..7c2ab44 100644 --- a/ASDKCore/RequestBuilder/Charge/ASDKChargeRequestBuilder.h +++ b/ASDKCore/RequestBuilder/Charge/ASDKChargeRequestBuilder.h @@ -22,7 +22,7 @@ @interface ASDKChargeRequestBuilder : ASDKRequestBuilder -+ (ASDKChargeRequestBuilder *)builderWithPaymentId:(NSNumber *)paymentId ++ (ASDKChargeRequestBuilder *)builderWithPaymentId:(NSString *)paymentId rebillId:(NSNumber *)rebillId terminalKey:(NSString *)terminalKey password:(NSString *)password; diff --git a/ASDKCore/RequestBuilder/Charge/ASDKChargeRequestBuilder.m b/ASDKCore/RequestBuilder/Charge/ASDKChargeRequestBuilder.m index 30ebd26..03a5298 100644 --- a/ASDKCore/RequestBuilder/Charge/ASDKChargeRequestBuilder.m +++ b/ASDKCore/RequestBuilder/Charge/ASDKChargeRequestBuilder.m @@ -20,14 +20,14 @@ @interface ASDKChargeRequestBuilder () -@property (nonatomic, strong) NSNumber *paymentId; +@property (nonatomic, strong) NSString *paymentId; @property (nonatomic, strong) NSNumber *rebillId; @end @implementation ASDKChargeRequestBuilder -+ (ASDKChargeRequestBuilder *)builderWithPaymentId:(NSNumber *)paymentId ++ (ASDKChargeRequestBuilder *)builderWithPaymentId:(NSString *)paymentId rebillId:(NSNumber *)rebillId terminalKey:(NSString *)terminalKey password:(NSString *)password @@ -74,7 +74,7 @@ - (void)validateError:(ASDKAcquringSdkError **)error #define kASDKPaymentIdDescription @"Уникальный идентификатор транзакции в системе Банка, полученный в ответе на вызов метода Init." #define kASDKPaymentIdMaxLength 20 - NSString *paymentId = self.paymentId.stringValue; + NSString *paymentId = self.paymentId; if (paymentId.length > kASDKPaymentIdMaxLength || paymentId.length == 0) { validationError = [ASDKAcquringSdkError errorWithMessage:kASDKPaymentId details:[NSString stringWithFormat:@"%@ %@ %d",kASDKPaymentIdDescription, kASDKValidationErrorMaxLengthString, kASDKPaymentIdMaxLength] code:0]; diff --git a/ASDKCore/RequestBuilder/FinishAuthorize/ASDKFinishAuthorizeRequestBuilder.h b/ASDKCore/RequestBuilder/FinishAuthorize/ASDKFinishAuthorizeRequestBuilder.h index 3878533..e0c0b74 100644 --- a/ASDKCore/RequestBuilder/FinishAuthorize/ASDKFinishAuthorizeRequestBuilder.h +++ b/ASDKCore/RequestBuilder/FinishAuthorize/ASDKFinishAuthorizeRequestBuilder.h @@ -22,7 +22,7 @@ @interface ASDKFinishAuthorizeRequestBuilder : ASDKRequestBuilder -+ (ASDKFinishAuthorizeRequestBuilder *)builderWithPaymentId:(NSNumber *)paymentId ++ (ASDKFinishAuthorizeRequestBuilder *)builderWithPaymentId:(NSString *)paymentId cardData:(NSString *)cardData infoEmail:(NSString *)infoEmail terminalKey:(NSString *)terminalKey diff --git a/ASDKCore/RequestBuilder/FinishAuthorize/ASDKFinishAuthorizeRequestBuilder.m b/ASDKCore/RequestBuilder/FinishAuthorize/ASDKFinishAuthorizeRequestBuilder.m index fd6344a..823da84 100644 --- a/ASDKCore/RequestBuilder/FinishAuthorize/ASDKFinishAuthorizeRequestBuilder.m +++ b/ASDKCore/RequestBuilder/FinishAuthorize/ASDKFinishAuthorizeRequestBuilder.m @@ -20,7 +20,7 @@ @interface ASDKFinishAuthorizeRequestBuilder () -@property (nonatomic, strong) NSNumber *paymentId; +@property (nonatomic, strong) NSString *paymentId; @property (nonatomic) NSString *sendEmail; @property (nonatomic, copy) NSString *cardData; @property (nonatomic, strong) NSString *infoEmail; @@ -29,7 +29,7 @@ @interface ASDKFinishAuthorizeRequestBuilder () @implementation ASDKFinishAuthorizeRequestBuilder -+ (ASDKFinishAuthorizeRequestBuilder *)builderWithPaymentId:(NSNumber *)paymentId ++ (ASDKFinishAuthorizeRequestBuilder *)builderWithPaymentId:(NSString *)paymentId cardData:(NSString *)cardData infoEmail:(NSString *)infoEmail terminalKey:(NSString *)terminalKey @@ -86,7 +86,7 @@ - (void)validateError:(ASDKAcquringSdkError **)error #define kASDKPaymentIdDescription @"Уникальный идентификатор транзакции в системе Банка, полученный в ответе на вызов метода Init." #define kASDKPaymentIdMaxLength 20 - NSString *paymentId = self.paymentId.stringValue; + NSString *paymentId = self.paymentId; NSLog(@"paymentId=%@\nrealPaymentId=%@",paymentId,self.paymentId); if (paymentId.length > kASDKPaymentIdMaxLength || paymentId.length == 0) { diff --git a/ASDKCore/RequestBuilder/GetState/ASDKGetStateRequestBuilder.h b/ASDKCore/RequestBuilder/GetState/ASDKGetStateRequestBuilder.h index 8879e48..acbba69 100644 --- a/ASDKCore/RequestBuilder/GetState/ASDKGetStateRequestBuilder.h +++ b/ASDKCore/RequestBuilder/GetState/ASDKGetStateRequestBuilder.h @@ -22,7 +22,7 @@ @interface ASDKGetStateRequestBuilder : ASDKRequestBuilder -+ (ASDKGetStateRequestBuilder *)builderWithPaymentId:(NSNumber *)paymentId ++ (ASDKGetStateRequestBuilder *)builderWithPaymentId:(NSString *)paymentId terminalKey:(NSString *)terminalKey password:(NSString *)password; diff --git a/ASDKCore/RequestBuilder/GetState/ASDKGetStateRequestBuilder.m b/ASDKCore/RequestBuilder/GetState/ASDKGetStateRequestBuilder.m index 2fada99..03d06c4 100644 --- a/ASDKCore/RequestBuilder/GetState/ASDKGetStateRequestBuilder.m +++ b/ASDKCore/RequestBuilder/GetState/ASDKGetStateRequestBuilder.m @@ -20,13 +20,13 @@ @interface ASDKGetStateRequestBuilder () -@property (nonatomic, strong) NSNumber *paymentId; +@property (nonatomic, strong) NSString *paymentId; @end @implementation ASDKGetStateRequestBuilder -+ (ASDKGetStateRequestBuilder *)builderWithPaymentId:(NSNumber *)paymentId ++ (ASDKGetStateRequestBuilder *)builderWithPaymentId:(NSString *)paymentId terminalKey:(NSString *)terminalKey password:(NSString *)password { @@ -70,7 +70,7 @@ - (void)validateError:(ASDKAcquringSdkError **)error #define kASDKPaymentIdDescription @"Уникальный идентификатор транзакции в системе Банка, полученный в ответе на вызов метода Init." #define kASDKPaymentIdMaxLength 20 - NSString *paymentId = self.paymentId.stringValue; + NSString *paymentId = self.paymentId; if (paymentId.length > kASDKPaymentIdMaxLength || paymentId.length == 0) { validationError = [ASDKAcquringSdkError errorWithMessage:kASDKPaymentId details:[NSString stringWithFormat:@"%@ %@ %d",kASDKPaymentIdDescription, kASDKValidationErrorMaxLengthString, kASDKPaymentIdMaxLength] code:0]; diff --git a/ASDKUI.xcodeproj/project.pbxproj b/ASDKUI.xcodeproj/project.pbxproj index 6187f17..3579091 100644 --- a/ASDKUI.xcodeproj/project.pbxproj +++ b/ASDKUI.xcodeproj/project.pbxproj @@ -786,6 +786,7 @@ COPY_PHASE_STRIP = NO; CURRENT_PROJECT_VERSION = 1; DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_BITCODE = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu99; @@ -803,7 +804,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = "$(inherited)"; - IPHONEOS_DEPLOYMENT_TARGET = 9.3; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -838,6 +839,7 @@ COPY_PHASE_STRIP = NO; CURRENT_PROJECT_VERSION = 1; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_BITCODE = NO; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = gnu99; @@ -849,7 +851,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = "$(inherited)"; - IPHONEOS_DEPLOYMENT_TARGET = 9.3; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; MTL_ENABLE_DEBUG_INFO = NO; ONLY_ACTIVE_ARCH = NO; SDKROOT = iphoneos; @@ -870,6 +872,7 @@ DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/ASDKUI", @@ -900,6 +903,7 @@ DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/ASDKUI", @@ -924,6 +928,7 @@ 8316725C1C6479A200533D85 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + ENABLE_BITCODE = YES; IPHONEOS_DEPLOYMENT_TARGET = 8.0; PRODUCT_NAME = "$(TARGET_NAME)"; VALID_ARCHS = "arm64 armv7 armv7s"; @@ -933,6 +938,7 @@ 8316725D1C6479A200533D85 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + ENABLE_BITCODE = YES; IPHONEOS_DEPLOYMENT_TARGET = 8.0; PRODUCT_NAME = "$(TARGET_NAME)"; VALID_ARCHS = "arm64 armv7 armv7s"; diff --git a/ASDKUI/3DSController/ASDK3DSViewController.h b/ASDKUI/3DSController/ASDK3DSViewController.h index 6997d2b..d04dc45 100644 --- a/ASDKUI/3DSController/ASDK3DSViewController.h +++ b/ASDKUI/3DSController/ASDK3DSViewController.h @@ -24,12 +24,12 @@ @interface ASDK3DSViewController : ASDKBaseViewController -- (instancetype)initWithPaymentId:(NSNumber *)paymentId +- (instancetype)initWithPaymentId:(NSString *)paymentId threeDsData:(ASDKThreeDsData *)data acquiringSdk:(ASDKAcquiringSdk *)acquiringSdk; - (void)showFromViewController:(UIViewController *)viewController - success:(void (^)(NSNumber *paymentId))success + success:(void (^)(NSString *paymentId))success failure:(void (^)(ASDKAcquringSdkError *statusError))failure cancel:(void (^)())cancel; diff --git a/ASDKUI/3DSController/ASDK3DSViewController.m b/ASDKUI/3DSController/ASDK3DSViewController.m index f1c68fc..0c92705 100644 --- a/ASDKUI/3DSController/ASDK3DSViewController.m +++ b/ASDKUI/3DSController/ASDK3DSViewController.m @@ -35,10 +35,10 @@ @interface ASDK3DSViewController () @property (nonatomic, weak) IBOutlet UIWebView *webView; -@property (nonatomic, strong) NSNumber *paymentId; +@property (nonatomic, strong) NSString *paymentId; @property (nonatomic, strong) ASDKThreeDsData *threeDsData; -@property (nonatomic, strong) void (^onSuccess)(NSNumber *paymentId); +@property (nonatomic, strong) void (^onSuccess)(NSString *paymentId); @property (nonatomic, strong) void (^onCancelled)(); @property (nonatomic, strong) void (^onError)(ASDKAcquringSdkError *error); @@ -55,7 +55,7 @@ - (void)dealloc NSLog(@"DALLOC %@",NSStringFromClass([self class])); } -- (instancetype)initWithPaymentId:(NSNumber *)paymentId +- (instancetype)initWithPaymentId:(NSString *)paymentId threeDsData:(ASDKThreeDsData *)data acquiringSdk:(ASDKAcquiringSdk *)acquiringSdk { @@ -71,7 +71,7 @@ - (instancetype)initWithPaymentId:(NSNumber *)paymentId } - (void)showFromViewController:(UIViewController *)viewController - success:(void (^)(NSNumber *paymentId))success + success:(void (^)(NSString *paymentId))success failure:(void (^)(ASDKAcquringSdkError *statusError))failure cancel:(void (^)())cancel { diff --git a/ASDKUI/Payment/PaymentFormStarter/ASDKPaymentFormStarter.h b/ASDKUI/Payment/PaymentFormStarter/ASDKPaymentFormStarter.h index 015b825..dca36c8 100644 --- a/ASDKUI/Payment/PaymentFormStarter/ASDKPaymentFormStarter.h +++ b/ASDKUI/Payment/PaymentFormStarter/ASDKPaymentFormStarter.h @@ -21,6 +21,7 @@ #import #import #import "ASDKDesignConfiguration.h" +#import @protocol ASDKAcquiringSdkCardScanner /*! @@ -66,8 +67,24 @@ email:(NSString *)email customKeyboard:(BOOL)keyboard customerKey:(NSString *)customerKey - success:(void (^)(NSNumber *paymentId))onSuccess + success:(void (^)(NSString *paymentId))onSuccess cancelled:(void (^)())onCancelled error:(void(^)(ASDKAcquringSdkError *error))onError; ++ (BOOL)isPayWithAppleAvailable; ++ (NSArray *)payWithAppleSupportedNetworks; + +- (void)payWithApplePayFromViewController:(UIViewController *)presentingViewController + orderId:(NSString *)orderId + amount:(NSNumber *)amount + title:(NSString *)title + description:(NSString *)description + cardId:(NSString *)cardId + email:(NSString *)email + customKeyboard:(BOOL)keyboard + customerKey:(NSString *)customerKey + success:(void (^)(NSString *paymentId))onSuccess + cancelled:(void (^)())onCancelled + error:(void(^)(ASDKAcquringSdkError *error))onError; + @end diff --git a/ASDKUI/Payment/PaymentFormStarter/ASDKPaymentFormStarter.m b/ASDKUI/Payment/PaymentFormStarter/ASDKPaymentFormStarter.m index 3a24291..30eaccc 100644 --- a/ASDKUI/Payment/PaymentFormStarter/ASDKPaymentFormStarter.m +++ b/ASDKUI/Payment/PaymentFormStarter/ASDKPaymentFormStarter.m @@ -24,7 +24,8 @@ #import "ASDKBarButtonItem.h" #import "ASDKCardsListDataController.h" -@interface ASDKPaymentFormStarter () + +@interface ASDKPaymentFormStarter () { UIStatusBarStyle _oldStatusBarStyle; } @@ -39,6 +40,13 @@ @interface ASDKPaymentFormStarter () @property (nonatomic, strong) UIWindow *loaderWindow; +// ApplePay +@property (nonatomic, weak) UIViewController *presentingViewControllerApplePay; +// +@property (nonatomic, strong) void (^onSuccess)(NSString *paymentId); +@property (nonatomic, strong) void (^onCancelled)(); +@property (nonatomic, strong) void (^onError)(ASDKAcquringSdkError *error); + @end @implementation ASDKPaymentFormStarter @@ -103,7 +111,7 @@ - (void)presentPaymentFormFromViewController:(UIViewController *)presentingViewC email:(NSString *)email customKeyboard:(BOOL)keyboard customerKey:(NSString *)customerKey - success:(void (^)(NSNumber *paymentId))onSuccess + success:(void (^)(NSString *paymentId))onSuccess cancelled:(void (^)())onCancelled error:(void(^)(ASDKAcquringSdkError *error))onError { @@ -117,7 +125,7 @@ - (void)presentPaymentFormFromViewController:(UIViewController *)presentingViewC email:email customerKey:customerKey customKeyboard:keyboard - success:^(NSNumber *paymentId) + success:^(NSString *paymentId) { [ASDKPaymentFormStarter resetSharedInstance]; @@ -217,5 +225,99 @@ - (UIWindow *)loaderWindow return _loaderWindow; } +#pragma mark - PKPaymentAuthorizationViewController + ++ (BOOL)isPayWithAppleAvailable +{ + return [PKPaymentAuthorizationViewController canMakePayments] && + [PKPaymentAuthorizationViewController canMakePaymentsUsingNetworks:[ASDKPaymentFormStarter payWithAppleSupportedNetworks]]; +} + ++ (NSArray *)payWithAppleSupportedNetworks +{ + return @[//PKPaymentNetworkAmex, + //PKPaymentNetworkChinaUnionPay, + PKPaymentNetworkDiscover, + //PKPaymentNetworkInterac, + PKPaymentNetworkMasterCard, + //PKPaymentNetworkPrivateLabel, + PKPaymentNetworkVisa]; +} + +- (void)payWithApplePayFromViewController:(UIViewController *)presentingViewController + orderId:(NSString *)orderId + amount:(NSNumber *)amount + title:(NSString *)title + description:(NSString *)description + cardId:(NSString *)cardId + email:(NSString *)email + customKeyboard:(BOOL)keyboard + customerKey:(NSString *)customerKey + success:(void (^)(NSString *paymentId))onSuccess + cancelled:(void (^)())onCancelled + error:(void(^)(ASDKAcquringSdkError *error))onError +{ + self.onSuccess = onSuccess; + self.onError = onError; + self.onCancelled = onCancelled; + + PKPaymentRequest *paymentRequest = [PKPaymentRequest new]; + paymentRequest.merchantIdentifier = @""; + paymentRequest.countryCode = @"RUB"; + paymentRequest.currencyCode = @"RU"; + paymentRequest.supportedNetworks = [ASDKPaymentFormStarter payWithAppleSupportedNetworks]; + // + paymentRequest.merchantCapabilities = PKMerchantCapability3DS; + // + paymentRequest.paymentSummaryItems = @[[PKPaymentSummaryItem summaryItemWithLabel:@"total" amount:[NSDecimalNumber decimalNumberWithDecimal:[amount decimalValue]]]]; + paymentRequest.requiredShippingAddressFields = PKAddressFieldNone; + + // Request shipping information, in this case just postal address. + // if ([_email length] > 0) + // { + // paymentRequest.requiredShippingAddressFields = PKAddressFieldEmail; + // } + // else + // { + // paymentRequest.requiredShippingAddressFields = PKAddressFieldNone; + // } + + PKPaymentAuthorizationViewController *viewController = [[PKPaymentAuthorizationViewController alloc] initWithPaymentRequest:paymentRequest]; + viewController.delegate = self; + + self.presentingViewControllerApplePay = presentingViewController; + [self.presentingViewControllerApplePay presentViewController:viewController animated:YES completion:^{ + + }]; +} + +#pragma mark - PKPaymentAuthorizationViewControllerDelegate + +- (void)paymentAuthorizationViewController:(PKPaymentAuthorizationViewController *)controller + didAuthorizePayment:(PKPayment *)payment + completion:(void (^)(PKPaymentAuthorizationStatus status))completion +{ + if (completion) + { + NSString *paymentDataString = [[NSString alloc] initWithData:payment.token.paymentData encoding:NSUTF8StringEncoding]; + + [self.acquiringSdk finishAuthorizeWithPaymentId:paymentDataString + cardData:@"" + infoEmail:@"" + success:^(ASDKThreeDsData *data, ASDKPaymentInfo *paymentInfo, ASDKPaymentStatus status) { + completion(PKPaymentAuthorizationStatusSuccess); + } + failure:^(ASDKAcquringSdkError *error) { + completion(PKPaymentAuthorizationStatusFailure); + }]; + } +} + +- (void)paymentAuthorizationViewControllerDidFinish:(PKPaymentAuthorizationViewController *)controller +{ + [self.presentingViewControllerApplePay dismissViewControllerAnimated:YES completion:^{ + + }]; +} @end diff --git a/ASDKUI/Payment/PaymentViewController/ASDKPaymentFormViewController.h b/ASDKUI/Payment/PaymentViewController/ASDKPaymentFormViewController.h index 7736585..95f0732 100644 --- a/ASDKUI/Payment/PaymentViewController/ASDKPaymentFormViewController.h +++ b/ASDKUI/Payment/PaymentViewController/ASDKPaymentFormViewController.h @@ -34,10 +34,10 @@ email:(NSString *)email customerKey:(NSString *)customerKey customKeyboard:(BOOL)keyboard - success:(void (^)(NSNumber *paymentId))success + success:(void (^)(NSString *paymentId))success cancelled:(void (^)())cancelled error:(void(^)(ASDKAcquringSdkError *error))error; -@property (nonatomic, strong) NSNumber *paymentId; +@property (nonatomic, strong) NSString *paymentId; @end diff --git a/ASDKUI/Payment/PaymentViewController/ASDKPaymentFormViewController.m b/ASDKUI/Payment/PaymentViewController/ASDKPaymentFormViewController.m index 45dc4f2..e210980 100644 --- a/ASDKUI/Payment/PaymentViewController/ASDKPaymentFormViewController.m +++ b/ASDKUI/Payment/PaymentViewController/ASDKPaymentFormViewController.m @@ -93,7 +93,7 @@ @interface ASDKPaymentFormViewController () Date: Mon, 3 Oct 2016 13:54:51 +0300 Subject: [PATCH 02/28] ASDK-302 --- .../ASDKPaymentFormStarter.h | 12 +- .../ASDKPaymentFormStarter.m | 96 +++++++++----- .../ApplePayBTN_32pt__black_logo_@2x.png | Bin 0 -> 6948 bytes .../ApplePayBTN_32pt__black_logo_@3x.png | Bin 0 -> 8847 bytes .../ApplePayBTN.imageset/Contents.json | 22 ++++ .../ASDKSampleApp/Source/ASDKCardIOScanner.m | 4 +- .../DetailInfoTableViewController.m | 38 +++++- .../DetailInfoTableViewController.xib | 49 ++++--- .../ItemsList/BookItemCell/BookItemCell.h | 1 - .../ItemsList/BookItemCell/BookItemCell.m | 3 + .../ItemsList/BookItemCell/BookItemCell.xib | 42 +++--- .../ItemsList/ItemsListTableViewController.m | 4 +- .../ASDKSampleApp/Source/PayController.h | 16 ++- .../ASDKSampleApp/Source/PayController.m | 121 +++++++++++++++--- .../ShopCart/ShopCartCell/ShopCartCell.m | 2 + .../ShopCart/ShopCartTableViewController.m | 11 +- .../ShopCart/ShopCartTableViewController.xib | 57 +++++---- 17 files changed, 341 insertions(+), 137 deletions(-) create mode 100644 SampleProject/ASDKSampleApp/Resources/Assets.xcassets/ApplePayBTN.imageset/ApplePayBTN_32pt__black_logo_@2x.png create mode 100644 SampleProject/ASDKSampleApp/Resources/Assets.xcassets/ApplePayBTN.imageset/ApplePayBTN_32pt__black_logo_@3x.png create mode 100644 SampleProject/ASDKSampleApp/Resources/Assets.xcassets/ApplePayBTN.imageset/Contents.json diff --git a/ASDKUI/Payment/PaymentFormStarter/ASDKPaymentFormStarter.h b/ASDKUI/Payment/PaymentFormStarter/ASDKPaymentFormStarter.h index dca36c8..6145078 100644 --- a/ASDKUI/Payment/PaymentFormStarter/ASDKPaymentFormStarter.h +++ b/ASDKUI/Payment/PaymentFormStarter/ASDKPaymentFormStarter.h @@ -75,14 +75,16 @@ + (NSArray *)payWithAppleSupportedNetworks; - (void)payWithApplePayFromViewController:(UIViewController *)presentingViewController - orderId:(NSString *)orderId amount:(NSNumber *)amount - title:(NSString *)title + orderId:(NSString *)orderId description:(NSString *)description - cardId:(NSString *)cardId - email:(NSString *)email - customKeyboard:(BOOL)keyboard customerKey:(NSString *)customerKey + recurent:(BOOL)recurent + sendEmail:(BOOL)sendEmail + email:(NSString *)email + appleMerchantId:(NSString *)appleMerchantId + shippingMethods:(NSArray *)shippingMethods + shippingContact:(PKContact *)shippingContact success:(void (^)(NSString *paymentId))onSuccess cancelled:(void (^)())onCancelled error:(void(^)(ASDKAcquringSdkError *error))onError; diff --git a/ASDKUI/Payment/PaymentFormStarter/ASDKPaymentFormStarter.m b/ASDKUI/Payment/PaymentFormStarter/ASDKPaymentFormStarter.m index 30eaccc..14c8400 100644 --- a/ASDKUI/Payment/PaymentFormStarter/ASDKPaymentFormStarter.m +++ b/ASDKUI/Payment/PaymentFormStarter/ASDKPaymentFormStarter.m @@ -237,7 +237,7 @@ + (BOOL)isPayWithAppleAvailable { return @[//PKPaymentNetworkAmex, //PKPaymentNetworkChinaUnionPay, - PKPaymentNetworkDiscover, + //PKPaymentNetworkDiscover, //PKPaymentNetworkInterac, PKPaymentNetworkMasterCard, //PKPaymentNetworkPrivateLabel, @@ -245,14 +245,16 @@ + (BOOL)isPayWithAppleAvailable } - (void)payWithApplePayFromViewController:(UIViewController *)presentingViewController - orderId:(NSString *)orderId amount:(NSNumber *)amount - title:(NSString *)title + orderId:(NSString *)orderId description:(NSString *)description - cardId:(NSString *)cardId - email:(NSString *)email - customKeyboard:(BOOL)keyboard customerKey:(NSString *)customerKey + recurent:(BOOL)recurent + sendEmail:(BOOL)sendEmail + email:(NSString *)email + appleMerchantId:(NSString *)appleMerchantId + shippingMethods:(NSArray *)shippingMethods + shippingContact:(PKContact *)shippingContact success:(void (^)(NSString *paymentId))onSuccess cancelled:(void (^)())onCancelled error:(void(^)(ASDKAcquringSdkError *error))onError @@ -262,33 +264,65 @@ - (void)payWithApplePayFromViewController:(UIViewController *)presentingViewCont self.onCancelled = onCancelled; PKPaymentRequest *paymentRequest = [PKPaymentRequest new]; - paymentRequest.merchantIdentifier = @""; - paymentRequest.countryCode = @"RUB"; - paymentRequest.currencyCode = @"RU"; + paymentRequest.merchantIdentifier = appleMerchantId; + paymentRequest.countryCode = @"RU"; + paymentRequest.currencyCode = @"RUB"; paymentRequest.supportedNetworks = [ASDKPaymentFormStarter payWithAppleSupportedNetworks]; - // paymentRequest.merchantCapabilities = PKMerchantCapability3DS; - // - paymentRequest.paymentSummaryItems = @[[PKPaymentSummaryItem summaryItemWithLabel:@"total" amount:[NSDecimalNumber decimalNumberWithDecimal:[amount decimalValue]]]]; - paymentRequest.requiredShippingAddressFields = PKAddressFieldNone; + //paymentSummaryItems + NSMutableArray *paymentSummaryItems = [NSMutableArray new];// + [paymentSummaryItems addObject:[PKPaymentSummaryItem summaryItemWithLabel:description amount:[NSDecimalNumber decimalNumberWithDecimal:[amount decimalValue]]]]; + for (PKShippingMethod *method in shippingMethods) + { + [paymentSummaryItems addObject:[PKPaymentSummaryItem summaryItemWithLabel:method.identifier amount:[NSDecimalNumber decimalNumberWithDecimal:[amount decimalValue]]]]; + } + + paymentRequest.paymentSummaryItems = paymentSummaryItems; + + //paymentRequest.shippingMethods = shippingMethods; + + PKAddressField addressField = PKAddressFieldNone; + + //if (sendEmail == YES) + { + addressField |= PKAddressFieldEmail; + } + + //if (contact && contact.postalAddress) + { + if (addressField == PKAddressFieldNone) + { + addressField = PKAddressFieldPostalAddress; + addressField |= PKAddressFieldPhone; + } + else + { + addressField |= PKAddressFieldPostalAddress; + addressField |= PKAddressFieldPhone; + } + + addressField = PKAddressFieldPostalAddress|PKAddressFieldPhone|PKAddressFieldEmail|PKAddressFieldName; + } + + paymentRequest.requiredBillingAddressFields = addressField; + paymentRequest.requiredShippingAddressFields = addressField; + + paymentRequest.shippingContact = shippingContact; - // Request shipping information, in this case just postal address. - // if ([_email length] > 0) - // { - // paymentRequest.requiredShippingAddressFields = PKAddressFieldEmail; - // } - // else - // { - // paymentRequest.requiredShippingAddressFields = PKAddressFieldNone; - // } - PKPaymentAuthorizationViewController *viewController = [[PKPaymentAuthorizationViewController alloc] initWithPaymentRequest:paymentRequest]; viewController.delegate = self; - self.presentingViewControllerApplePay = presentingViewController; - [self.presentingViewControllerApplePay presentViewController:viewController animated:YES completion:^{ - - }]; + if (viewController) + { + self.presentingViewControllerApplePay = presentingViewController; + [self.presentingViewControllerApplePay presentViewController:viewController animated:YES completion:^{ + + }]; + } + else + { + onError(nil); + } } #pragma mark - PKPaymentAuthorizationViewControllerDelegate @@ -303,12 +337,14 @@ - (void)paymentAuthorizationViewController:(PKPaymentAuthorizationViewController [self.acquiringSdk finishAuthorizeWithPaymentId:paymentDataString cardData:@"" - infoEmail:@"" + infoEmail:payment.billingContact.emailAddress success:^(ASDKThreeDsData *data, ASDKPaymentInfo *paymentInfo, ASDKPaymentStatus status) { - completion(PKPaymentAuthorizationStatusSuccess); + completion(PKPaymentAuthorizationStatusSuccess); + self.onSuccess(paymentDataString); } failure:^(ASDKAcquringSdkError *error) { - completion(PKPaymentAuthorizationStatusFailure); + completion(PKPaymentAuthorizationStatusFailure); + self.onError(error); }]; } } diff --git a/SampleProject/ASDKSampleApp/Resources/Assets.xcassets/ApplePayBTN.imageset/ApplePayBTN_32pt__black_logo_@2x.png b/SampleProject/ASDKSampleApp/Resources/Assets.xcassets/ApplePayBTN.imageset/ApplePayBTN_32pt__black_logo_@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..755210932254b098699dce9247760bcecc170367 GIT binary patch literal 6948 zcmZ`+2UL^W(hU&lO{I$xBLomgLX#rBgGf?mV%*@_%=FEI&?S$%RsnSrgQ33z}8g(_LI{*L?3t=rs zPD=Q0;V6%|1`E?65h#u@-nqe*?{u6K8g=}Aw$SbgsWFohUAg2*oD7PJ5HClJfin-hpDh zNOWs5`M3iyHMUqaGG@E(Gg1rCIeG+a#u*X$i)0uvtSvX0T)5cPx=YMLPef}()HrQp z1618pA|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dO|`%W?*4TDs9O`#aW4od$VJ`weV2`(+j-aA&0%% zc!CKTW9KanLEDyigZw5Xd&FJfI6Rdk7c#g(?AUoo6hxw%2$|!PX8g#?_QTxw?G+zqr6h#k! zFCr4YF~ajag=&>)v0ARB(zkly$Bl$h5mwE+&N472A`+Qi6u&T~_*9*{w&mT-criN^ ze3^Ha4}z`t`bl~3#IzPyX0Cd2hgGC_OWI>K$!#?WU%DAcFJh!EFSPZqE*Nx?9Zzun5Ht@{|yYK55-{k^z*aIc<4Um1t|4fAoH6Jx&pW^zbI?uVXXE3 z`sTs1!4@^5=#mIF@eWxN?R^oI?rWW5v+c@EtwHEsjh07v8dvgU=b{F#3(IVx_K8sX zK#kmUz5$yx-n&lMEK2=&b=VI&4AN)t={dq38jK1Bp|104JSPJ8D&P|WM>Q`{ZDAB2 zZyB^pq^-B3?d22Zq=BUdD*Uso!sk)DhDb*mURQ7g{%)=#Yf1?bPFIkxYwG9 z#(dk6khc7?POn^#z6_JiFch|b94cS}pB=1pG#-|x^96$Ko*?R)RRBOf7h*o4if7X; zPaH7qK>6xMImRy7Kvj?CDRE&S1p~Dc1wgO^T{7Ng&R=%YCNMb{TYZDpvWQ3R!g)1u z;;sakAuliQ!g?&&>OvZa4akk4wNM>V>;zp#?hnYxBLOI434#r!>Q4-DqwWkKh(!Ro zTw@j~d8XKzDg`kC?_9Nbbm|9Y+R?m45RGmsUnPKe?}h%?!f_AX3DAe%UJygzjSe}JZ7GSw##F7||vb{TcT z1%3BhJ%iYR@P$WCed70Ji+~2qowZe;SoT&0XlI4?OwG^TZ)=VIONoY&5BDOIsBB(V d{Sw*7be@LBVKRXn9RR|kuB@e0tYGoz{{Wb-La6`% literal 0 HcmV?d00001 diff --git a/SampleProject/ASDKSampleApp/Resources/Assets.xcassets/ApplePayBTN.imageset/ApplePayBTN_32pt__black_logo_@3x.png b/SampleProject/ASDKSampleApp/Resources/Assets.xcassets/ApplePayBTN.imageset/ApplePayBTN_32pt__black_logo_@3x.png new file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Vfta~h{S=k;a$);k%aG$?`tXRklBE-ftu)ei#cX#Wc`x#%!?g_> zu&Vqn$k1n#FSJ&`8PD5H^%xadSgKRj^|bg?p`qUo%}$vt!Q~m#REMrO8rzxoUO6e> zVe0(=O$GFibZa0Y)X0dG{ZZYU6`@ zLjulrITQW1I6m#-iq8pi%P&%CDHsSZNJ@;VCu^?wb>pDduZIFrNeK`{yA(RBt~kz%r|w z5aZnJk-#UmMb0ermEq{4?RrE+M5VWtFht8qk92WpeyE@E@jUM54_~9I3JZG-IcLX! z26yxBz5Y0J(9M*IAGVRFsj@2rP>41&?4R$59Ac&6d}uX8lq}U8fzrXlDava_9AB<4 z+f5gZR;_QkUlbQB{@9!xbC$M^A(qeR~Hap68ob7vUOTht=7!RM{ADr3FlS|Bxx_3hwHx#`yh3?Yp;1fL!57b#^ zDUKXQZ|ZMA+UYFXSSB=QQAWy(?rr3grJzEn4#>QIe zIz6QF;MnWP${=%rhMzHcThef%s7(E=*NemqNjK+16EzSE1k#RP@nYWqo3 z_QbSAF%8gtd=}P(zAzAOAYl1Ui_QAyR|^kaTJ+);#DC*G7#?06=YF; zbzN@3QK7+H=or5G#YGq>Q5eDEXsPh~%Iy!<5T~&}%t&ATs}{ltoXm-NtZ_WmZb{vuAR<8Lxr;xz0Bf0K#i;;If0i6)XaWepj>s&d4M@dKfycHz`& zuRu!Af;SPLT2MX)gDG* zs*46|i;z{I>SKK;AoxYq?^+5y0XD`r@^2JHQ7TW5pM<=NHy{e?XcGlbGZ-_+O8oYi z3Ai~BV>U`!_Dg)aE@Nm2uZlDtgJL3}x8D7 #import +#import "CardIO.h" +#import "ASDKCardIOScanner.h" @interface ASDKCardIOScanner () diff --git a/SampleProject/ASDKSampleApp/Source/DetailInfo/DetailInfoTableViewController.m b/SampleProject/ASDKSampleApp/Source/DetailInfo/DetailInfoTableViewController.m index 9b50011..05f5b73 100644 --- a/SampleProject/ASDKSampleApp/Source/DetailInfo/DetailInfoTableViewController.m +++ b/SampleProject/ASDKSampleApp/Source/DetailInfo/DetailInfoTableViewController.m @@ -22,6 +22,7 @@ @interface DetailInfoTableViewController () @property (weak, nonatomic) IBOutlet UIButton *buyButton; @property (weak, nonatomic) IBOutlet UIButton *addToCartButton; +@property (weak, nonatomic) IBOutlet UIButton *buttonApplePay; @property (nonatomic, weak) IBOutlet UILabel *itemCostLabel; @property (weak, nonatomic) IBOutlet UIView *bottomContainerView; @@ -68,6 +69,8 @@ - (void)viewDidLoad [self.itemCostLabel setText:[_item amountAsString]]; self.bottomContainerView.backgroundColor = kMainBlueColor; + + [self.buttonApplePay setEnabled:[PayController isPayWithAppleAvailable]]; } - (void)viewWillAppear:(BOOL)animated @@ -154,7 +157,7 @@ - (void)buyItem description:self.item.bookDescription amount:self.item.cost fromViewController:self - success:^(NSNumber *paymentId) + success:^(NSString *paymentId) { NSLog(@"%@",paymentId); } @@ -168,5 +171,38 @@ - (void)buyItem }]; } +- (IBAction)buttonActionApplePay:(UIButton *)sender +{ + if ([PayController isPayWithAppleAvailable]) + { + PKShippingMethod *method1 = [[PKShippingMethod alloc] init]; + method1.identifier = @"method1"; + method1.detail = @"ShippingMethod"; + + [PayController buyWithApplePayAmount:self.item.cost + description:self.item.title + recurent:YES + email:@"test@gmail.com" + appleMerchantId:@"merchant.tcsbank.ApplePayTestMerchantId" + shippingMethods:@[method1]//(NSArray *) + contact:nil + fromViewController:self + success:^(NSString *paymentId) { NSLog(@"%@",paymentId); } + cancelled:^{ NSLog(@"Canceled"); } + error:^(ASDKAcquringSdkError *error) { NSLog(@"%@",error); }]; + + +// [PayController buyWithApplePayItemWithName:self.item.title +// description:self.item.bookDescription +// amount:self.item.cost +// appleMerchantId:[[NSBundle mainBundle] objectForInfoDictionaryKey:@"AAPLEmporiumBundlePrefix"] +// shippingMethods:nil//(NSArray *)shippingMethods +// contact:nil//(PKContact *)contact +// fromViewController:self +// success:^(NSString *paymentId) { NSLog(@"%@",paymentId); } +// cancelled:^{ NSLog(@"Canceled"); } +// error:^(ASDKAcquringSdkError *error) { NSLog(@"%@",error); }]; + } +} @end diff --git a/SampleProject/ASDKSampleApp/Source/DetailInfo/DetailInfoTableViewController.xib b/SampleProject/ASDKSampleApp/Source/DetailInfo/DetailInfoTableViewController.xib index 4805a7c..a363bf0 100644 --- a/SampleProject/ASDKSampleApp/Source/DetailInfo/DetailInfoTableViewController.xib +++ b/SampleProject/ASDKSampleApp/Source/DetailInfo/DetailInfoTableViewController.xib @@ -1,14 +1,16 @@ - + - + + + @@ -17,11 +19,10 @@ - + - @@ -29,53 +30,62 @@ - + - + - + + + - - + + + - + @@ -85,7 +95,10 @@ - + + + + diff --git a/SampleProject/ASDKSampleApp/Source/ItemsList/BookItemCell/BookItemCell.h b/SampleProject/ASDKSampleApp/Source/ItemsList/BookItemCell/BookItemCell.h index a107b3f..0ad4089 100644 --- a/SampleProject/ASDKSampleApp/Source/ItemsList/BookItemCell/BookItemCell.h +++ b/SampleProject/ASDKSampleApp/Source/ItemsList/BookItemCell/BookItemCell.h @@ -19,7 +19,6 @@ extern NSString *const kDetailsInfoNotification; @property (nonatomic, weak) IBOutlet UILabel *itemDescriptionLabel; @property (nonatomic, weak) IBOutlet UILabel *itemCostLabel; @property (nonatomic, weak) IBOutlet UIButton *itemDetailsButton; - @property (weak, nonatomic) IBOutlet UIView *imageItemContainerView; @property (nonatomic, strong) BookItem *bookItem; diff --git a/SampleProject/ASDKSampleApp/Source/ItemsList/BookItemCell/BookItemCell.m b/SampleProject/ASDKSampleApp/Source/ItemsList/BookItemCell/BookItemCell.m index 2f11d5d..bac7da1 100644 --- a/SampleProject/ASDKSampleApp/Source/ItemsList/BookItemCell/BookItemCell.m +++ b/SampleProject/ASDKSampleApp/Source/ItemsList/BookItemCell/BookItemCell.m @@ -10,6 +10,7 @@ #import "LocalConstants.h" NSString *const kDetailsInfoNotification = @"kDetailsInfoNotification"; + #define kSeparatorLineHeight 1.0f / [[UIScreen mainScreen] scale] @interface BookItemCell () @@ -33,6 +34,8 @@ + (instancetype)cell - (void)awakeFromNib { + [super awakeFromNib]; + self.itemCostLabel.textColor = kMainBlueColor; [self.imageItemContainerView.layer setBorderColor:[UIColor grayColor].CGColor]; [self.imageItemContainerView.layer setBorderWidth:kSeparatorLineHeight]; diff --git a/SampleProject/ASDKSampleApp/Source/ItemsList/BookItemCell/BookItemCell.xib b/SampleProject/ASDKSampleApp/Source/ItemsList/BookItemCell/BookItemCell.xib index d2e651b..03512d8 100644 --- a/SampleProject/ASDKSampleApp/Source/ItemsList/BookItemCell/BookItemCell.xib +++ b/SampleProject/ASDKSampleApp/Source/ItemsList/BookItemCell/BookItemCell.xib @@ -1,9 +1,10 @@ - + - + + @@ -12,18 +13,16 @@ - + - - - + - + @@ -33,48 +32,43 @@ - - - + - - + - + @@ -90,10 +84,8 @@ - - + @@ -135,7 +125,7 @@ - + diff --git a/SampleProject/ASDKSampleApp/Source/ItemsList/ItemsListTableViewController.m b/SampleProject/ASDKSampleApp/Source/ItemsList/ItemsListTableViewController.m index 3d88121..2ea1e24 100644 --- a/SampleProject/ASDKSampleApp/Source/ItemsList/ItemsListTableViewController.m +++ b/SampleProject/ASDKSampleApp/Source/ItemsList/ItemsListTableViewController.m @@ -8,12 +8,10 @@ #import "ItemsListTableViewController.h" #import "BookItemCell.h" - #import "DetailInfoTableViewController.h" - #import "ShopCartTableViewController.h" - #import "AboutViewController.h" +#import "PayController.h" @interface ItemsListTableViewController () diff --git a/SampleProject/ASDKSampleApp/Source/PayController.h b/SampleProject/ASDKSampleApp/Source/PayController.h index a027380..1034d37 100644 --- a/SampleProject/ASDKSampleApp/Source/PayController.h +++ b/SampleProject/ASDKSampleApp/Source/PayController.h @@ -9,6 +9,7 @@ #import #import #import +#import @interface PayController : NSObject @@ -16,8 +17,21 @@ description:(NSString *)description amount:(NSNumber *)amount fromViewController:(UIViewController *)viewController - success:(void (^)(NSNumber *paymentId))onSuccess + success:(void (^)(NSString *paymentId))onSuccess cancelled:(void (^)())onCancelled error:(void(^)(ASDKAcquringSdkError *error))onError; ++ (BOOL)isPayWithAppleAvailable; ++ (void)buyWithApplePayAmount:(NSNumber *)amount + description:(NSString *)description + recurent:(BOOL)recurent + email:(NSString *)email + appleMerchantId:(NSString *)appleMerchantId + shippingMethods:(NSArray *)shippingMethods + contact:(PKContact *)contact + fromViewController:(UIViewController *)viewController + success:(void (^)(NSString *paymentId))onSuccess + cancelled:(void (^)())onCancelled + error:(void(^)(ASDKAcquringSdkError *error))onError; + @end diff --git a/SampleProject/ASDKSampleApp/Source/PayController.m b/SampleProject/ASDKSampleApp/Source/PayController.m index c88f292..ff289e5 100644 --- a/SampleProject/ASDKSampleApp/Source/PayController.m +++ b/SampleProject/ASDKSampleApp/Source/PayController.m @@ -17,39 +17,40 @@ @implementation PayController ++ (ASDKPaymentFormStarter *)paymentFormStarter +{ + ASDKStringKeyCreator *stringKeyCreator = [[ASDKStringKeyCreator alloc] initWithPublicKeyString:kASDKTestPublicKey]; + ASDKAcquiringSdk *acquiringSdk = [ASDKAcquiringSdk acquiringSdkWithTerminalKey:kASDKTestTerminalKey password:kASDKTestPassword publicKeyDataSource:stringKeyCreator]; + + [acquiringSdk setDebug:YES]; + [acquiringSdk setLogger:nil]; + + return [ASDKPaymentFormStarter paymentFormStarterWithAcquiringSdk:acquiringSdk]; +} + ++ (NSString *)customerKey +{ + return @"testCustomerKey1@gmail.com"; +} + + (void)buyItemWithName:(NSString *)name description:(NSString *)description amount:(NSNumber *)amount fromViewController:(UIViewController *)viewController - success:(void (^)(NSNumber *paymentId))onSuccess + success:(void (^)(NSString *paymentId))onSuccess cancelled:(void (^)())onCancelled error:(void(^)(ASDKAcquringSdkError *error))onError { - //NSString *publicKeyPath = [[NSBundle mainBundle] pathForResource:kASDKTestPublicKeyName ofType:@"pem"]; - //ASDKStringKeyCreator *stringKeyCreator = [[ASDKStringKeyCreator alloc] initWithPublicKeyPath:publicKeyPath]; - - ASDKStringKeyCreator *stringKeyCreator = [[ASDKStringKeyCreator alloc] initWithPublicKeyString:kASDKTestPublicKey]; - - ASDKAcquiringSdk *acquiringSdk = [ASDKAcquiringSdk acquiringSdkWithTerminalKey:kASDKTestTerminalKey - password:kASDKTestPassword - publicKeyDataSource:stringKeyCreator]; - - [acquiringSdk setDebug:YES]; - [acquiringSdk setLogger:nil]; - - ASDKPaymentFormStarter *paymentFormStarter = [ASDKPaymentFormStarter paymentFormStarterWithAcquiringSdk:acquiringSdk]; - + ASDKPaymentFormStarter *paymentFormStarter = [PayController paymentFormStarter]; double randomOrderId = arc4random()%10000000; - NSString *customerKey = @"testCustomerKey1@gmail.com"; -// NSString *customerKey = @"hockeyCustomerKey@gmail.com"; - + //Настройка дизайна // ASDKDesignConfiguration *designConfiguration = [[ASDKDesignConfiguration alloc] init]; // [designConfiguration setNavigationBarColor:[UIColor orangeColor] navigationBarItemsTextColor:[UIColor darkGrayColor] navigationBarStyle:UIBarStyleDefault]; // [designConfiguration setPayButtonColor:[UIColor greenColor] payButtonPressedColor:[UIColor blueColor] payButtonTextColor:[UIColor whiteColor]]; // paymentFormStarter.designConfiguration = designConfiguration; - //Настройка сканнера карт + paymentFormStarter.cardScanner = [ASDKCardIOScanner scanner]; [paymentFormStarter presentPaymentFormFromViewController:viewController @@ -60,8 +61,8 @@ + (void)buyItemWithName:(NSString *)name cardId:nil email:nil customKeyboard:YES - customerKey:customerKey - success:^(NSNumber *paymentId) + customerKey:[PayController customerKey] + success:^(NSString *paymentId) { PaymentSuccessViewController *vc = [[PaymentSuccessViewController alloc] init]; vc.amount = amount; @@ -109,4 +110,82 @@ + (void)buyItemWithName:(NSString *)name }]; } ++ (BOOL)isPayWithAppleAvailable +{ + return [ASDKPaymentFormStarter isPayWithAppleAvailable]; +} + ++ (void)buyWithApplePayAmount:(NSNumber *)amount + description:(NSString *)description + recurent:(BOOL)recurent + email:(NSString *)email + appleMerchantId:(NSString *)appleMerchantId + shippingMethods:(NSArray *)shippingMethods + contact:(PKContact *)contact + fromViewController:(UIViewController *)viewController + success:(void (^)(NSString *paymentId))onSuccess + cancelled:(void (^)())onCancelled + error:(void(^)(ASDKAcquringSdkError *error))onError +{ + ASDKPaymentFormStarter *paymentFormStarter = [PayController paymentFormStarter]; + [paymentFormStarter payWithApplePayFromViewController:viewController + amount:amount + orderId:[NSNumber numberWithDouble:(arc4random()%10000000)].stringValue + description:description + customerKey:[PayController customerKey] + recurent:recurent + sendEmail:([email length] > 0) + email:email + appleMerchantId:appleMerchantId + shippingMethods:shippingMethods + contact:contact + success:^(NSString *paymentId) { + PaymentSuccessViewController *vc = [[PaymentSuccessViewController alloc] init]; + vc.amount = amount; + UINavigationController *nc = [[UINavigationController alloc] initWithRootViewController:vc]; + + [viewController presentViewController:nc animated:YES completion:nil]; + + onSuccess(paymentId); + } + cancelled:^{ + UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"Оплата отменена" message:nil preferredStyle:UIAlertControllerStyleAlert]; + + UIAlertAction *cancelAction = [UIAlertAction + actionWithTitle:@"Закрыть" + style:UIAlertActionStyleCancel + handler:^(UIAlertAction *action) + { + [alertController dismissViewControllerAnimated:YES completion:nil]; + }]; + + [alertController addAction:cancelAction]; + + [viewController presentViewController:alertController animated:YES completion:nil]; + + onCancelled(); + } + error:^(ASDKAcquringSdkError *error) { + if (error) + { + UIAlertController *alertController = [UIAlertController alertControllerWithTitle:error.errorMessage message:error.errorDetails preferredStyle:UIAlertControllerStyleAlert]; + + UIAlertAction *cancelAction = [UIAlertAction + actionWithTitle:@"Закрыть" + style:UIAlertActionStyleCancel + handler:^(UIAlertAction *action) + { + [alertController dismissViewControllerAnimated:YES completion:nil]; + }]; + + [alertController addAction:cancelAction]; + + [viewController presentViewController:alertController animated:YES completion:nil]; + } + + onError(error); + }]; + // +} + @end diff --git a/SampleProject/ASDKSampleApp/Source/ShopCart/ShopCartCell/ShopCartCell.m b/SampleProject/ASDKSampleApp/Source/ShopCart/ShopCartCell/ShopCartCell.m index fae04e4..38dd8e6 100644 --- a/SampleProject/ASDKSampleApp/Source/ShopCart/ShopCartCell/ShopCartCell.m +++ b/SampleProject/ASDKSampleApp/Source/ShopCart/ShopCartCell/ShopCartCell.m @@ -14,6 +14,8 @@ @implementation ShopCartCell - (void)awakeFromNib { + [super awakeFromNib]; + // Initialization code self.itemCostLabel.textColor = kMainBlueColor; self.selectionStyle = UITableViewCellSelectionStyleNone; diff --git a/SampleProject/ASDKSampleApp/Source/ShopCart/ShopCartTableViewController.m b/SampleProject/ASDKSampleApp/Source/ShopCart/ShopCartTableViewController.m index ce37778..62af1a5 100644 --- a/SampleProject/ASDKSampleApp/Source/ShopCart/ShopCartTableViewController.m +++ b/SampleProject/ASDKSampleApp/Source/ShopCart/ShopCartTableViewController.m @@ -24,6 +24,7 @@ @interface ShopCartTableViewController () @property (nonatomic, weak) IBOutlet UILabel *totalLabel; @property (nonatomic, weak) IBOutlet UIButton *payButton; +@property (weak, nonatomic) IBOutlet UIButton *buttonApplePay; @property (weak, nonatomic) IBOutlet UIView *bottomContainerView; @@ -59,9 +60,10 @@ - (void)viewDidLoad [self updateTotalLabel]; self.bottomContainerView.backgroundColor = kMainBlueColor; + + [self.buttonApplePay setEnabled:[PayController isPayWithAppleAvailable]]; } - - (void)handleShopCartUpdate { [self updateTotal]; @@ -178,7 +180,7 @@ - (IBAction)buyAction:(id)sender description:@"Много книг" amount:[NSNumber numberWithDouble:_total] fromViewController:self - success:^(NSNumber *paymentId) + success:^(NSString *paymentId) { NSLog(@"%@",paymentId); @@ -194,4 +196,9 @@ - (IBAction)buyAction:(id)sender }]; } +- (IBAction)buttonActionApplePay:(UIButton *)sender +{ + +} + @end diff --git a/SampleProject/ASDKSampleApp/Source/ShopCart/ShopCartTableViewController.xib b/SampleProject/ASDKSampleApp/Source/ShopCart/ShopCartTableViewController.xib index 588f059..477dc43 100644 --- a/SampleProject/ASDKSampleApp/Source/ShopCart/ShopCartTableViewController.xib +++ b/SampleProject/ASDKSampleApp/Source/ShopCart/ShopCartTableViewController.xib @@ -1,13 +1,15 @@ - + - + + + @@ -16,55 +18,53 @@ - + - - - + - - - + + - + + + - @@ -72,7 +72,7 @@ - + @@ -82,7 +82,10 @@ - + + + + From 977f7f7a71c347c8c58f21a56710360e0c329228 Mon Sep 17 00:00:00 2001 From: Budnikov Vyacheslav Date: Tue, 4 Oct 2016 15:14:49 +0300 Subject: [PATCH 03/28] =?UTF-8?q?=D0=B8=D0=BD=D0=B8=D1=86=D0=B8=D0=B0?= =?UTF-8?q?=D0=BB=D0=B8=D0=B7=D0=B0=D1=86=D0=B8=D1=8F=20acquiringSdk=20?= =?UTF-8?q?=D0=BF=D0=B5=D1=80=D0=B5=D0=B4=20=D0=BE=D0=BF=D0=BB=D0=B0=D1=82?= =?UTF-8?q?=D0=BE=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ASDKCore.xcodeproj/project.pbxproj | 12 +- ASDKUI.xcodeproj/project.pbxproj | 45 +++---- .../ASDKPaymentFormStarter.h | 5 +- .../ASDKPaymentFormStarter.m | 113 ++++++++---------- .../DetailInfoTableViewController.m | 38 +++--- .../ASDKSampleApp/Source/PayController.h | 3 +- .../ASDKSampleApp/Source/PayController.m | 6 +- .../ASDKSampleApp/Source/ViewController.m | 9 -- 8 files changed, 105 insertions(+), 126 deletions(-) diff --git a/ASDKCore.xcodeproj/project.pbxproj b/ASDKCore.xcodeproj/project.pbxproj index f2e4777..4a132fd 100644 --- a/ASDKCore.xcodeproj/project.pbxproj +++ b/ASDKCore.xcodeproj/project.pbxproj @@ -704,7 +704,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -748,7 +748,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; @@ -769,9 +769,9 @@ ENABLE_BITCODE = NO; INFOPLIST_FILE = ASDKCore/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - ONLY_ACTIVE_ARCH = NO; + ONLY_ACTIVE_ARCH = YES; OTHER_LDFLAGS = ""; PRODUCT_BUNDLE_IDENTIFIER = ru.tcsbank.ASDKCore; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -791,9 +791,9 @@ ENABLE_BITCODE = NO; INFOPLIST_FILE = ASDKCore/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - ONLY_ACTIVE_ARCH = NO; + ONLY_ACTIVE_ARCH = YES; OTHER_LDFLAGS = ""; PRODUCT_BUNDLE_IDENTIFIER = ru.tcsbank.ASDKCore; PRODUCT_NAME = "$(TARGET_NAME)"; diff --git a/ASDKUI.xcodeproj/project.pbxproj b/ASDKUI.xcodeproj/project.pbxproj index 3579091..ab4342c 100644 --- a/ASDKUI.xcodeproj/project.pbxproj +++ b/ASDKUI.xcodeproj/project.pbxproj @@ -14,6 +14,7 @@ 8316725E1C6479DE00533D85 /* ShellScript */, ); dependencies = ( + C355FAA11DA3C28700073675 /* PBXTargetDependency */, ); name = "ASDKUI-universal"; productName = "ASDKUI-universal"; @@ -23,7 +24,6 @@ /* Begin PBXBuildFile section */ 83129AFF1C68CAAD00A1F5DE /* ASDKMacroses.h in Headers */ = {isa = PBXBuildFile; fileRef = 83129AFE1C68CAAD00A1F5DE /* ASDKMacroses.h */; }; 831672531C64798800533D85 /* ASDKUI.h in Headers */ = {isa = PBXBuildFile; fileRef = 831672521C64798800533D85 /* ASDKUI.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 831672681C647A3400533D85 /* ASDKCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 831672651C647A1200533D85 /* ASDKCore.framework */; }; 8333793F1C7470E20097208D /* ASDKBarButtonItem.h in Headers */ = {isa = PBXBuildFile; fileRef = 8333793D1C7470E20097208D /* ASDKBarButtonItem.h */; }; 833379401C7470E20097208D /* ASDKBarButtonItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 8333793E1C7470E20097208D /* ASDKBarButtonItem.m */; }; 83E156451C71AE6F000BBD57 /* ASDKUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 83E156431C71AE6F000BBD57 /* ASDKUtils.h */; }; @@ -92,6 +92,7 @@ BEDEFFA91C761C370026D454 /* ASDKHighlightedButton.h in Headers */ = {isa = PBXBuildFile; fileRef = BEDEFFA71C761C370026D454 /* ASDKHighlightedButton.h */; }; BEDEFFAA1C761C370026D454 /* ASDKHighlightedButton.m in Sources */ = {isa = PBXBuildFile; fileRef = BEDEFFA81C761C370026D454 /* ASDKHighlightedButton.m */; }; BEDEFFAE1C761CFD0026D454 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BEDEFFAD1C761CFD0026D454 /* AudioToolbox.framework */; }; + C355FAA51DA3C3DF00073675 /* ASDKCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 831672651C647A1200533D85 /* ASDKCore.framework */; }; CA82FD1E1C70ED3A005FD294 /* ASDKPaymentFormHeaderCell.h in Headers */ = {isa = PBXBuildFile; fileRef = CA82FD1C1C70ED3A005FD294 /* ASDKPaymentFormHeaderCell.h */; }; CA82FD1F1C70ED3A005FD294 /* ASDKPaymentFormHeaderCell.m in Sources */ = {isa = PBXBuildFile; fileRef = CA82FD1D1C70ED3A005FD294 /* ASDKPaymentFormHeaderCell.m */; }; CA82FD211C70ED49005FD294 /* ASDKPaymentFormHeaderCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = CA82FD201C70ED49005FD294 /* ASDKPaymentFormHeaderCell.xib */; }; @@ -111,13 +112,20 @@ remoteGlobalIDString = 83166ED31C63984E00533D85; remoteInfo = ASDKCore; }; - 831672661C647A2E00533D85 /* PBXContainerItemProxy */ = { + C355FA9E1DA3C10200073675 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 8316725F1C647A1200533D85 /* ASDKCore.xcodeproj */; proxyType = 1; remoteGlobalIDString = 83166ED21C63984E00533D85; remoteInfo = ASDKCore; }; + C355FAA01DA3C28700073675 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 8316725F1C647A1200533D85 /* ASDKCore.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = 8316723A1C6477E300533D85; + remoteInfo = "ASDKCore-universal"; + }; /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ @@ -212,8 +220,8 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + C355FAA51DA3C3DF00073675 /* ASDKCore.framework in Frameworks */, BEDEFFAE1C761CFD0026D454 /* AudioToolbox.framework in Frameworks */, - 831672681C647A3400533D85 /* ASDKCore.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -598,7 +606,7 @@ buildRules = ( ); dependencies = ( - 831672671C647A2E00533D85 /* PBXTargetDependency */, + C355FA9F1DA3C10200073675 /* PBXTargetDependency */, ); name = ASDKUI; productName = ASDKUI; @@ -742,10 +750,15 @@ /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ - 831672671C647A2E00533D85 /* PBXTargetDependency */ = { + C355FA9F1DA3C10200073675 /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = ASDKCore; - targetProxy = 831672661C647A2E00533D85 /* PBXContainerItemProxy */; + targetProxy = C355FA9E1DA3C10200073675 /* PBXContainerItemProxy */; + }; + C355FAA11DA3C28700073675 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "ASDKCore-universal"; + targetProxy = C355FAA01DA3C28700073675 /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ @@ -804,7 +817,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = "$(inherited)"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -851,7 +864,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = "$(inherited)"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; MTL_ENABLE_DEBUG_INFO = NO; ONLY_ACTIVE_ARCH = NO; SDKROOT = iphoneos; @@ -880,13 +893,9 @@ HEADER_SEARCH_PATHS = "$(inherited)"; INFOPLIST_FILE = ASDKUI/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/ASDKUI/CardIO", - ); - ONLY_ACTIVE_ARCH = NO; + ONLY_ACTIVE_ARCH = YES; PRODUCT_BUNDLE_IDENTIFIER = ru.tcsbank.ASDKUI; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; @@ -911,13 +920,9 @@ HEADER_SEARCH_PATHS = "$(inherited)"; INFOPLIST_FILE = ASDKUI/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/ASDKUI/CardIO", - ); - ONLY_ACTIVE_ARCH = NO; + ONLY_ACTIVE_ARCH = YES; PRODUCT_BUNDLE_IDENTIFIER = ru.tcsbank.ASDKUI; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; diff --git a/ASDKUI/Payment/PaymentFormStarter/ASDKPaymentFormStarter.h b/ASDKUI/Payment/PaymentFormStarter/ASDKPaymentFormStarter.h index 6145078..cd962bb 100644 --- a/ASDKUI/Payment/PaymentFormStarter/ASDKPaymentFormStarter.h +++ b/ASDKUI/Payment/PaymentFormStarter/ASDKPaymentFormStarter.h @@ -69,7 +69,7 @@ customerKey:(NSString *)customerKey success:(void (^)(NSString *paymentId))onSuccess cancelled:(void (^)())onCancelled - error:(void(^)(ASDKAcquringSdkError *error))onError; + error:(void (^)(ASDKAcquringSdkError *error))onError; + (BOOL)isPayWithAppleAvailable; + (NSArray *)payWithAppleSupportedNetworks; @@ -79,7 +79,6 @@ orderId:(NSString *)orderId description:(NSString *)description customerKey:(NSString *)customerKey - recurent:(BOOL)recurent sendEmail:(BOOL)sendEmail email:(NSString *)email appleMerchantId:(NSString *)appleMerchantId @@ -87,6 +86,6 @@ shippingContact:(PKContact *)shippingContact success:(void (^)(NSString *paymentId))onSuccess cancelled:(void (^)())onCancelled - error:(void(^)(ASDKAcquringSdkError *error))onError; + error:(void (^)(ASDKAcquringSdkError *error))onError; @end diff --git a/ASDKUI/Payment/PaymentFormStarter/ASDKPaymentFormStarter.m b/ASDKUI/Payment/PaymentFormStarter/ASDKPaymentFormStarter.m index 14c8400..130de49 100644 --- a/ASDKUI/Payment/PaymentFormStarter/ASDKPaymentFormStarter.m +++ b/ASDKUI/Payment/PaymentFormStarter/ASDKPaymentFormStarter.m @@ -249,7 +249,6 @@ - (void)payWithApplePayFromViewController:(UIViewController *)presentingViewCont orderId:(NSString *)orderId description:(NSString *)description customerKey:(NSString *)customerKey - recurent:(BOOL)recurent sendEmail:(BOOL)sendEmail email:(NSString *)email appleMerchantId:(NSString *)appleMerchantId @@ -257,72 +256,66 @@ - (void)payWithApplePayFromViewController:(UIViewController *)presentingViewCont shippingContact:(PKContact *)shippingContact success:(void (^)(NSString *paymentId))onSuccess cancelled:(void (^)())onCancelled - error:(void(^)(ASDKAcquringSdkError *error))onError + error:(void (^)(ASDKAcquringSdkError *error))onError { + /////////////// self.onSuccess = onSuccess; self.onError = onError; self.onCancelled = onCancelled; - PKPaymentRequest *paymentRequest = [PKPaymentRequest new]; - paymentRequest.merchantIdentifier = appleMerchantId; - paymentRequest.countryCode = @"RU"; - paymentRequest.currencyCode = @"RUB"; - paymentRequest.supportedNetworks = [ASDKPaymentFormStarter payWithAppleSupportedNetworks]; - paymentRequest.merchantCapabilities = PKMerchantCapability3DS; - //paymentSummaryItems - NSMutableArray *paymentSummaryItems = [NSMutableArray new];// - [paymentSummaryItems addObject:[PKPaymentSummaryItem summaryItemWithLabel:description amount:[NSDecimalNumber decimalNumberWithDecimal:[amount decimalValue]]]]; - for (PKShippingMethod *method in shippingMethods) - { - [paymentSummaryItems addObject:[PKPaymentSummaryItem summaryItemWithLabel:method.identifier amount:[NSDecimalNumber decimalNumberWithDecimal:[amount decimalValue]]]]; - } - - paymentRequest.paymentSummaryItems = paymentSummaryItems; - - //paymentRequest.shippingMethods = shippingMethods; - - PKAddressField addressField = PKAddressFieldNone; - - //if (sendEmail == YES) - { - addressField |= PKAddressFieldEmail; - } - - //if (contact && contact.postalAddress) - { - if (addressField == PKAddressFieldNone) - { - addressField = PKAddressFieldPostalAddress; - addressField |= PKAddressFieldPhone; + [self.acquiringSdk initWithAmount:[NSNumber numberWithDouble:100 * amount.doubleValue] orderId:orderId description:nil payForm:nil customerKey:customerKey recurrent:NO + success:^(ASDKInitResponse *response){ + PKPaymentRequest *paymentRequest = [PKPaymentRequest new]; + paymentRequest.merchantIdentifier = appleMerchantId; + paymentRequest.countryCode = @"RU"; + paymentRequest.currencyCode = @"RUB"; + paymentRequest.supportedNetworks = [ASDKPaymentFormStarter payWithAppleSupportedNetworks]; + paymentRequest.merchantCapabilities = PKMerchantCapability3DS; + //paymentSummaryItems + NSMutableArray *paymentSummaryItems = [NSMutableArray new];// + [paymentSummaryItems addObject:[PKPaymentSummaryItem summaryItemWithLabel:description amount:[NSDecimalNumber decimalNumberWithDecimal:[amount decimalValue]]]]; + [paymentSummaryItems addObjectsFromArray:shippingMethods]; + + paymentRequest.paymentSummaryItems = paymentSummaryItems; + + // + PKAddressField addressFieldBilling = PKAddressFieldNone; + if (sendEmail == YES) { addressFieldBilling |= PKAddressFieldEmail; } + // if (shippingContact.postalAddress) { addressFieldBilling |= PKAddressFieldPostalAddress; } + + PKContact *billingContact = [[PKContact alloc] init]; + billingContact.emailAddress = email; + paymentRequest.billingContact = billingContact; + paymentRequest.requiredBillingAddressFields = addressFieldBilling; + + // + PKAddressField addressFieldShipping = PKAddressFieldNone; + if (shippingContact.postalAddress) { addressFieldShipping |= PKAddressFieldPostalAddress; } + if (shippingContact.name) { addressFieldShipping |= PKAddressFieldName; } + if (shippingContact.emailAddress) { addressFieldShipping |= PKAddressFieldEmail; } + if (shippingContact.phoneNumber) { addressFieldShipping |= PKAddressFieldPhone; } + paymentRequest.shippingContact = shippingContact; + paymentRequest.requiredShippingAddressFields = addressFieldShipping; + + //paymentRequest.shippingMethods = shippingMethods; + + PKPaymentAuthorizationViewController *viewController = [[PKPaymentAuthorizationViewController alloc] initWithPaymentRequest:paymentRequest]; + viewController.delegate = self; + + if (viewController) + { + self.presentingViewControllerApplePay = presentingViewController; + [self.presentingViewControllerApplePay presentViewController:viewController animated:YES completion:^{}]; + } + else + { + self.onError(nil); + } } - else - { - addressField |= PKAddressFieldPostalAddress; - addressField |= PKAddressFieldPhone; + failure:^(ASDKAcquringSdkError *error){ + self.onError(error); } - - addressField = PKAddressFieldPostalAddress|PKAddressFieldPhone|PKAddressFieldEmail|PKAddressFieldName; - } - - paymentRequest.requiredBillingAddressFields = addressField; - paymentRequest.requiredShippingAddressFields = addressField; - - paymentRequest.shippingContact = shippingContact; - - PKPaymentAuthorizationViewController *viewController = [[PKPaymentAuthorizationViewController alloc] initWithPaymentRequest:paymentRequest]; - viewController.delegate = self; - - if (viewController) - { - self.presentingViewControllerApplePay = presentingViewController; - [self.presentingViewControllerApplePay presentViewController:viewController animated:YES completion:^{ - - }]; - } - else - { - onError(nil); - } + ]; } #pragma mark - PKPaymentAuthorizationViewControllerDelegate diff --git a/SampleProject/ASDKSampleApp/Source/DetailInfo/DetailInfoTableViewController.m b/SampleProject/ASDKSampleApp/Source/DetailInfo/DetailInfoTableViewController.m index 05f5b73..0f95c2b 100644 --- a/SampleProject/ASDKSampleApp/Source/DetailInfo/DetailInfoTableViewController.m +++ b/SampleProject/ASDKSampleApp/Source/DetailInfo/DetailInfoTableViewController.m @@ -175,33 +175,27 @@ - (IBAction)buttonActionApplePay:(UIButton *)sender { if ([PayController isPayWithAppleAvailable]) { - PKShippingMethod *method1 = [[PKShippingMethod alloc] init]; - method1.identifier = @"method1"; - method1.detail = @"ShippingMethod"; - + PKContact *shippingContact = [[PKContact alloc] init]; + shippingContact.emailAddress = @"test@gmail.com"; + shippingContact.phoneNumber = [CNPhoneNumber phoneNumberWithStringValue:@"+74956481000"]; + CNMutablePostalAddress *postalAddress = [[CNMutablePostalAddress alloc] init]; + [postalAddress setStreet:@"Головинское шоссе, дом 5, корп. 1,"]; + [postalAddress setCountry:@"Россия"]; + [postalAddress setCity:@"Москва"]; + [postalAddress setPostalCode:@"125212"]; + [postalAddress setISOCountryCode:@"643"]; + shippingContact.postalAddress = [postalAddress copy]; + [PayController buyWithApplePayAmount:self.item.cost description:self.item.title - recurent:YES - email:@"test@gmail.com" + email:shippingContact.emailAddress appleMerchantId:@"merchant.tcsbank.ApplePayTestMerchantId" - shippingMethods:@[method1]//(NSArray *) - contact:nil + shippingMethods:nil//@[[PKShippingMethod summaryItemWithLabel:@"Доставка" amount:[NSDecimalNumber decimalNumberWithString:@"300"]]] + shippingContact:shippingContact fromViewController:self - success:^(NSString *paymentId) { NSLog(@"%@",paymentId); } + success:^(NSString *paymentId) { NSLog(@"%@", paymentId); } cancelled:^{ NSLog(@"Canceled"); } - error:^(ASDKAcquringSdkError *error) { NSLog(@"%@",error); }]; - - -// [PayController buyWithApplePayItemWithName:self.item.title -// description:self.item.bookDescription -// amount:self.item.cost -// appleMerchantId:[[NSBundle mainBundle] objectForInfoDictionaryKey:@"AAPLEmporiumBundlePrefix"] -// shippingMethods:nil//(NSArray *)shippingMethods -// contact:nil//(PKContact *)contact -// fromViewController:self -// success:^(NSString *paymentId) { NSLog(@"%@",paymentId); } -// cancelled:^{ NSLog(@"Canceled"); } -// error:^(ASDKAcquringSdkError *error) { NSLog(@"%@",error); }]; + error:^(ASDKAcquringSdkError *error) { NSLog(@"%@", error); }]; } } diff --git a/SampleProject/ASDKSampleApp/Source/PayController.h b/SampleProject/ASDKSampleApp/Source/PayController.h index 1034d37..0c6d20d 100644 --- a/SampleProject/ASDKSampleApp/Source/PayController.h +++ b/SampleProject/ASDKSampleApp/Source/PayController.h @@ -24,11 +24,10 @@ + (BOOL)isPayWithAppleAvailable; + (void)buyWithApplePayAmount:(NSNumber *)amount description:(NSString *)description - recurent:(BOOL)recurent email:(NSString *)email appleMerchantId:(NSString *)appleMerchantId shippingMethods:(NSArray *)shippingMethods - contact:(PKContact *)contact + shippingContact:(PKContact *)shippingContact fromViewController:(UIViewController *)viewController success:(void (^)(NSString *paymentId))onSuccess cancelled:(void (^)())onCancelled diff --git a/SampleProject/ASDKSampleApp/Source/PayController.m b/SampleProject/ASDKSampleApp/Source/PayController.m index ff289e5..f1c92a7 100644 --- a/SampleProject/ASDKSampleApp/Source/PayController.m +++ b/SampleProject/ASDKSampleApp/Source/PayController.m @@ -117,11 +117,10 @@ + (BOOL)isPayWithAppleAvailable + (void)buyWithApplePayAmount:(NSNumber *)amount description:(NSString *)description - recurent:(BOOL)recurent email:(NSString *)email appleMerchantId:(NSString *)appleMerchantId shippingMethods:(NSArray *)shippingMethods - contact:(PKContact *)contact + shippingContact:(PKContact *)shippingContact fromViewController:(UIViewController *)viewController success:(void (^)(NSString *paymentId))onSuccess cancelled:(void (^)())onCancelled @@ -133,12 +132,11 @@ + (void)buyWithApplePayAmount:(NSNumber *)amount orderId:[NSNumber numberWithDouble:(arc4random()%10000000)].stringValue description:description customerKey:[PayController customerKey] - recurent:recurent sendEmail:([email length] > 0) email:email appleMerchantId:appleMerchantId shippingMethods:shippingMethods - contact:contact + shippingContact:shippingContact success:^(NSString *paymentId) { PaymentSuccessViewController *vc = [[PaymentSuccessViewController alloc] init]; vc.amount = amount; diff --git a/SampleProject/ASDKSampleApp/Source/ViewController.m b/SampleProject/ASDKSampleApp/Source/ViewController.m index a91a77f..31f9a89 100644 --- a/SampleProject/ASDKSampleApp/Source/ViewController.m +++ b/SampleProject/ASDKSampleApp/Source/ViewController.m @@ -7,18 +7,9 @@ // #import "ViewController.h" -#import -#import - -#import "ASDKCardIOScanner.h" - -#import "ASDKTestKeys.h" - @interface ViewController () -@property (nonatomic, strong) ASDKCardIOScanner *scannerObject; - @end @implementation ViewController From 6fc4b3317bc3fe90c53d110719b732932da1b768 Mon Sep 17 00:00:00 2001 From: Budnikov Vyacheslav Date: Wed, 5 Oct 2016 18:57:52 +0300 Subject: [PATCH 04/28] ASDK-326 --- .../ASDKExternalCardsCell.m | 3 +- .../ASDKExternalCardsCell.xib | 16 +++---- .../ASDKPayButtonCell.xib | 14 +++--- .../Localization/en.lproj/Localizable.strings | 24 +++++------ .../Localization/ru.lproj/Localizable.strings | 2 +- .../Resources/en.lproj/Localizable.strings | 25 +++++++++++ .../Resources/ru.lproj/Localizable.strings | 18 ++++++++ .../Source/About/AboutViewController.m | 4 +- .../DetailInfoTableViewController.m | 12 +++--- .../DetailInfoTableViewController.xib | 25 +++++------ .../ItemsList/BookItemCell/BookItemCell.m | 5 ++- .../ItemsList/BookItemCell/BookItemCell.xib | 43 +++++++------------ .../ItemsList/ItemsListTableViewController.m | 4 +- .../ASDKSampleApp/Source/PayController.m | 6 +-- .../PaymentSuccessViewController.m | 6 +-- .../ShopCart/ShopCartCell/ShopCartCell.m | 3 ++ .../ShopCart/ShopCartCell/ShopCartCell.xib | 21 ++++----- .../ShopCart/ShopCartTableViewController.m | 17 ++++---- 18 files changed, 139 insertions(+), 109 deletions(-) create mode 100644 SampleProject/ASDKSampleApp/Resources/en.lproj/Localizable.strings diff --git a/ASDKUI/Payment/PaymentViewController/ASDKExternalCardsCell.m b/ASDKUI/Payment/PaymentViewController/ASDKExternalCardsCell.m index 11e4d8f..e2ba4b9 100644 --- a/ASDKUI/Payment/PaymentViewController/ASDKExternalCardsCell.m +++ b/ASDKUI/Payment/PaymentViewController/ASDKExternalCardsCell.m @@ -37,7 +37,8 @@ - (void)awakeFromNib self.titleLabel.textColor = [ASDKDesign colorTextDark]; self.changeCardButton.titleLabel.textColor = [ASDKDesign colorMainBlue]; - + [self.changeCardButton setTitle:LOC(@"PaymentForm.changeCard") forState:UIControlStateNormal]; + self.titleLabel.text = LOC(@"PaymentForm.changeCard"); } diff --git a/ASDKUI/Payment/PaymentViewController/ASDKExternalCardsCell.xib b/ASDKUI/Payment/PaymentViewController/ASDKExternalCardsCell.xib index a5e03db..4fcac11 100644 --- a/ASDKUI/Payment/PaymentViewController/ASDKExternalCardsCell.xib +++ b/ASDKUI/Payment/PaymentViewController/ASDKExternalCardsCell.xib @@ -1,9 +1,10 @@ - + - + + @@ -12,32 +13,29 @@ - + - diff --git a/ASDKUI/Payment/PaymentViewController/ASDKPayButtonCell.xib b/ASDKUI/Payment/PaymentViewController/ASDKPayButtonCell.xib index 7566b91..ec541af 100644 --- a/ASDKUI/Payment/PaymentViewController/ASDKPayButtonCell.xib +++ b/ASDKUI/Payment/PaymentViewController/ASDKPayButtonCell.xib @@ -1,8 +1,9 @@ - + - + + @@ -11,18 +12,17 @@ - + - + diff --git a/ASDKUI/Resources/Localization/en.lproj/Localizable.strings b/ASDKUI/Resources/Localization/en.lproj/Localizable.strings index 9187112..c98e9c0 100644 --- a/ASDKUI/Resources/Localization/en.lproj/Localizable.strings +++ b/ASDKUI/Resources/Localization/en.lproj/Localizable.strings @@ -17,21 +17,21 @@ limitations under the License. */ -"Common.Cancel" = "Отмена"; -"Common.Close" = "Закрыть"; +"Common.Cancel" = "Cancel"; +"Common.Close" = "Close"; -"Title.CardsList" = "Выберите карту"; +"Title.CardsList" = "Select card"; -"paymentForm.title" = "Оплата"; -"PaymentForm.payButtonTitle" = "Оплатить"; -"PaymentForm.summCellTitle" = "На сумму:"; -"PaymentForm.changeCard" = "Изменить"; +"paymentForm.title" = "Payment"; +"PaymentForm.payButtonTitle" = "Pay"; +"PaymentForm.summCellTitle" = "Total sum:"; +"PaymentForm.changeCard" = "сhange"; -"CardsList.AddNewCard" = "Ввести данные новой карты"; +"CardsList.AddNewCard" = "New card number"; -"Transfer.CardNumber.Sender" = "Номер карты для оплаты"; +"Transfer.CardNumber.Sender" = "card number"; -"externalCardsCell.savedCard" = "Сохраненная карта"; -"externalCardsCell.newCard" = "Новая карта"; +"externalCardsCell.savedCard" = "Saved card"; +"externalCardsCell.newCard" = "New card"; -"emailCell.placeholder" = "E-mail для квитанции"; \ No newline at end of file +"emailCell.placeholder" = "E-mail for receipt"; diff --git a/ASDKUI/Resources/Localization/ru.lproj/Localizable.strings b/ASDKUI/Resources/Localization/ru.lproj/Localizable.strings index 9187112..4086e89 100644 --- a/ASDKUI/Resources/Localization/ru.lproj/Localizable.strings +++ b/ASDKUI/Resources/Localization/ru.lproj/Localizable.strings @@ -34,4 +34,4 @@ "externalCardsCell.savedCard" = "Сохраненная карта"; "externalCardsCell.newCard" = "Новая карта"; -"emailCell.placeholder" = "E-mail для квитанции"; \ No newline at end of file +"emailCell.placeholder" = "E-mail для квитанции"; diff --git a/SampleProject/ASDKSampleApp/Resources/en.lproj/Localizable.strings b/SampleProject/ASDKSampleApp/Resources/en.lproj/Localizable.strings new file mode 100644 index 0000000..6281cdb --- /dev/null +++ b/SampleProject/ASDKSampleApp/Resources/en.lproj/Localizable.strings @@ -0,0 +1,25 @@ +/* + Localizable.strings + ASDKSampleApp + + Created by e.orlova on 17.02.16. + Copyright © 2016 TCS Bank. All rights reserved. +*/ + +"OnlineShop" = "Online Shop"; +"Close" = "Close"; +"Cancel" = "Cancel"; +"CanceledPayment" = "The payment is canceled"; +"Done" = "Done"; +"Delete" = "DELETE"; +"Detailds" = "Details"; +"AddToBag" = "ADD TO BAG"; +"Pay" = "PAY"; +"Buy" = "BUY"; +"Bag" = "Bag"; +"BagIsEmpty" = "The bag is empty"; +"Total" = "Total: %@"; +"Books" = "Books"; +"ALotOfBooks" = "A lot of books"; +"BuyingSuccessful" = "Buying in the amount %@ is successful"; +"ProductAddedToBag" = "Product added to cart"; diff --git a/SampleProject/ASDKSampleApp/Resources/ru.lproj/Localizable.strings b/SampleProject/ASDKSampleApp/Resources/ru.lproj/Localizable.strings index b70a633..a0ac11f 100644 --- a/SampleProject/ASDKSampleApp/Resources/ru.lproj/Localizable.strings +++ b/SampleProject/ASDKSampleApp/Resources/ru.lproj/Localizable.strings @@ -5,3 +5,21 @@ Created by e.orlova on 17.02.16. Copyright © 2016 TCS Bank. All rights reserved. */ + +"OnlineShop" = "Интернет магазин"; +"Close" = "Закрыть"; +"Cancel" = "Отмена"; +"CanceledPayment" = "Оплата отменена"; +"Done" = "Готово"; +"Delete" = "УДАЛИТЬ"; +"Detailds" = "ПОДРОБНЕЕ"; +"AddToBag" = "В КОРЗИНУ"; +"Pay" = "ОПЛАТИТЬ"; +"Buy" = "КУПИТЬ"; +"Bag" = "Корзина"; +"BagIsEmpty" = "Корзина пуста"; +"Total" = "Итого: %@"; +"Books" = "Книги"; +"ALotOfBooks" = "Много книг"; +"BuyingSuccessful" = "Buying in the amount %@ is successful"; +"ProductAddedToBag" = "Товар добавлен в корзину"; diff --git a/SampleProject/ASDKSampleApp/Source/About/AboutViewController.m b/SampleProject/ASDKSampleApp/Source/About/AboutViewController.m index e55b180..637bab1 100644 --- a/SampleProject/ASDKSampleApp/Source/About/AboutViewController.m +++ b/SampleProject/ASDKSampleApp/Source/About/AboutViewController.m @@ -22,11 +22,11 @@ - (void)viewDidLoad { [super viewDidLoad]; - [self setTitle:@"Интернет магазин"]; + [self setTitle:NSLocalizedString(@"OnlineShop", @"Интернет магазин")]; [self.versionLabel setText:[self sdkVersionString]]; - UIBarButtonItem *cancelButton = [[UIBarButtonItem alloc] initWithTitle:@"Отмена" + UIBarButtonItem *cancelButton = [[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"Cancel", @"Отмена") style:UIBarButtonItemStylePlain target:self action:@selector(closeSelf)]; diff --git a/SampleProject/ASDKSampleApp/Source/DetailInfo/DetailInfoTableViewController.m b/SampleProject/ASDKSampleApp/Source/DetailInfo/DetailInfoTableViewController.m index 9b50011..243204d 100644 --- a/SampleProject/ASDKSampleApp/Source/DetailInfo/DetailInfoTableViewController.m +++ b/SampleProject/ASDKSampleApp/Source/DetailInfo/DetailInfoTableViewController.m @@ -46,11 +46,11 @@ - (void)viewDidLoad { [super viewDidLoad]; - self.title = @"Интернет магазин"; + self.title = NSLocalizedString(@"OnlineShop", @"Интернет магазин"); [self.myTableView registerNib:[UINib nibWithNibName:NSStringFromClass([BookItemCell class]) bundle:[NSBundle mainBundle]] forCellReuseIdentifier:NSStringFromClass([BookItemCell class])]; - UIBarButtonItem *shopCartButton = [[UIBarButtonItem alloc] initWithTitle:@"Корзина" + UIBarButtonItem *shopCartButton = [[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"Bag", @"Корзина") style:UIBarButtonItemStylePlain target:self action:@selector(openShopCart:)]; @@ -60,8 +60,10 @@ - (void)viewDidLoad self.edgesForExtendedLayout = UIRectEdgeNone; [self.buyButton.layer setCornerRadius:3.0f]; + [self.buyButton setTitle:NSLocalizedString(@"Buy", @"КУПИТЬ") forState:UIControlStateNormal]; [self.addToCartButton.layer setCornerRadius:3.0f]; - + [self.addToCartButton setTitle:NSLocalizedString(@"AddToBag", @"В КОРЗИНУ") forState:UIControlStateNormal]; + [self.buyButton addTarget:self action:@selector(buyItem) forControlEvents:UIControlEventTouchUpInside]; [self.addToCartButton addTarget:self action:@selector(addItemToCart) forControlEvents:UIControlEventTouchUpInside]; @@ -133,10 +135,10 @@ - (void)addItemToCart { [[ShopCart sharedInstance] addItem:self.item.copy]; - UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"Товар добавлен в корзину" message:nil preferredStyle:UIAlertControllerStyleAlert]; + UIAlertController *alertController = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"ProductAddedToBag", @"Товар добавлен в корзину") message:nil preferredStyle:UIAlertControllerStyleAlert]; UIAlertAction *cancelAction = [UIAlertAction - actionWithTitle:@"Закрыть" + actionWithTitle:NSLocalizedString(@"Close", @"Закрыть") style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) { diff --git a/SampleProject/ASDKSampleApp/Source/DetailInfo/DetailInfoTableViewController.xib b/SampleProject/ASDKSampleApp/Source/DetailInfo/DetailInfoTableViewController.xib index 4805a7c..9d358cd 100644 --- a/SampleProject/ASDKSampleApp/Source/DetailInfo/DetailInfoTableViewController.xib +++ b/SampleProject/ASDKSampleApp/Source/DetailInfo/DetailInfoTableViewController.xib @@ -1,8 +1,8 @@ - + - - + + @@ -17,11 +17,10 @@ - + - @@ -29,41 +28,37 @@ - - + @@ -75,7 +70,7 @@ - + diff --git a/SampleProject/ASDKSampleApp/Source/ItemsList/BookItemCell/BookItemCell.m b/SampleProject/ASDKSampleApp/Source/ItemsList/BookItemCell/BookItemCell.m index 2f11d5d..196fe1a 100644 --- a/SampleProject/ASDKSampleApp/Source/ItemsList/BookItemCell/BookItemCell.m +++ b/SampleProject/ASDKSampleApp/Source/ItemsList/BookItemCell/BookItemCell.m @@ -33,11 +33,14 @@ + (instancetype)cell - (void)awakeFromNib { + [super awakeFromNib]; + self.itemCostLabel.textColor = kMainBlueColor; [self.imageItemContainerView.layer setBorderColor:[UIColor grayColor].CGColor]; [self.imageItemContainerView.layer setBorderWidth:kSeparatorLineHeight]; [self.imageItemContainerView.layer setCornerRadius:3.0f]; - + + [self.itemDetailsButton setTitle:NSLocalizedString(@"Detailds", @"ПОДРОБНЕЕ") forState:UIControlStateNormal]; [self.itemDetailsButton.layer setCornerRadius:3.0f]; for (NSLayoutConstraint *heightConstraint in self.bordersHeightConstraint) diff --git a/SampleProject/ASDKSampleApp/Source/ItemsList/BookItemCell/BookItemCell.xib b/SampleProject/ASDKSampleApp/Source/ItemsList/BookItemCell/BookItemCell.xib index d2e651b..d12a606 100644 --- a/SampleProject/ASDKSampleApp/Source/ItemsList/BookItemCell/BookItemCell.xib +++ b/SampleProject/ASDKSampleApp/Source/ItemsList/BookItemCell/BookItemCell.xib @@ -1,9 +1,9 @@ - + - - + + @@ -12,18 +12,16 @@ - + - - - + - + @@ -33,48 +31,43 @@ - - - + - - + - + @@ -90,10 +83,8 @@ - - + @@ -135,7 +124,7 @@ - + diff --git a/SampleProject/ASDKSampleApp/Source/ItemsList/ItemsListTableViewController.m b/SampleProject/ASDKSampleApp/Source/ItemsList/ItemsListTableViewController.m index 3d88121..3a72e84 100644 --- a/SampleProject/ASDKSampleApp/Source/ItemsList/ItemsListTableViewController.m +++ b/SampleProject/ASDKSampleApp/Source/ItemsList/ItemsListTableViewController.m @@ -42,13 +42,13 @@ - (void)viewDidLoad self.view.backgroundColor = [UIColor groupTableViewBackgroundColor]; - [self setTitle:@"Интернет магазин"]; + [self setTitle:NSLocalizedString(@"OnlineShop", @"Интернет магазин")]; [self.tableView registerNib:[UINib nibWithNibName:NSStringFromClass([BookItemCell class]) bundle:[NSBundle mainBundle]] forCellReuseIdentifier:NSStringFromClass([BookItemCell class])]; [self.tableView setSeparatorStyle:UITableViewCellSeparatorStyleNone]; - UIBarButtonItem *shopCartButton = [[UIBarButtonItem alloc] initWithTitle:@"Корзина" + UIBarButtonItem *shopCartButton = [[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"Bag", @"Корзина") style:UIBarButtonItemStylePlain target:self action:@selector(openShopCart:)]; diff --git a/SampleProject/ASDKSampleApp/Source/PayController.m b/SampleProject/ASDKSampleApp/Source/PayController.m index c88f292..46a61b9 100644 --- a/SampleProject/ASDKSampleApp/Source/PayController.m +++ b/SampleProject/ASDKSampleApp/Source/PayController.m @@ -73,10 +73,10 @@ + (void)buyItemWithName:(NSString *)name } cancelled:^ { - UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"Оплата отменена" message:nil preferredStyle:UIAlertControllerStyleAlert]; + UIAlertController *alertController = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"CanceledPayment", @"Оплата отменена") message:nil preferredStyle:UIAlertControllerStyleAlert]; UIAlertAction *cancelAction = [UIAlertAction - actionWithTitle:@"Закрыть" + actionWithTitle:NSLocalizedString(@"Close", @"Закрыть") style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) { @@ -94,7 +94,7 @@ + (void)buyItemWithName:(NSString *)name UIAlertController *alertController = [UIAlertController alertControllerWithTitle:error.errorMessage message:error.errorDetails preferredStyle:UIAlertControllerStyleAlert]; UIAlertAction *cancelAction = [UIAlertAction - actionWithTitle:@"Закрыть" + actionWithTitle:NSLocalizedString(@"Close", @"Закрыть") style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) { diff --git a/SampleProject/ASDKSampleApp/Source/PaymentSuccess/PaymentSuccessViewController.m b/SampleProject/ASDKSampleApp/Source/PaymentSuccess/PaymentSuccessViewController.m index 9b3e433..f2a8c08 100644 --- a/SampleProject/ASDKSampleApp/Source/PaymentSuccess/PaymentSuccessViewController.m +++ b/SampleProject/ASDKSampleApp/Source/PaymentSuccess/PaymentSuccessViewController.m @@ -24,9 +24,9 @@ - (void)viewDidLoad { [super viewDidLoad]; - self.title = @"Интернет магазин"; + self.title = NSLocalizedString(@"OnlineShop", @"Интернет магазин"); - UIBarButtonItem *doneButton = [[UIBarButtonItem alloc] initWithTitle:@"Готово" + UIBarButtonItem *doneButton = [[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"Done", @"Готово") style:UIBarButtonItemStylePlain target:self action:@selector(closeSelf)]; @@ -53,7 +53,7 @@ - (void)setAmount:(NSNumber *)amount - (void)updateAmountLabel { NSString *amountWithCurrency = [NSString stringWithFormat:@"%.2f %@", self.amount.doubleValue, kCurrencyRubSymbol]; - NSString *amountFull = [NSString stringWithFormat:@"Покупка на сумму %@\nпрошла успешно", amountWithCurrency]; + NSString *amountFull = [NSString stringWithFormat:NSLocalizedString(@"BuyingSuccessful", @"Покупка на сумму %@\nпрошла успешно"), amountWithCurrency]; NSMutableAttributedString *resultString = [[NSMutableAttributedString alloc] initWithString:amountFull]; NSRange range = [resultString.string rangeOfString:amountWithCurrency]; diff --git a/SampleProject/ASDKSampleApp/Source/ShopCart/ShopCartCell/ShopCartCell.m b/SampleProject/ASDKSampleApp/Source/ShopCart/ShopCartCell/ShopCartCell.m index fae04e4..728bd07 100644 --- a/SampleProject/ASDKSampleApp/Source/ShopCart/ShopCartCell/ShopCartCell.m +++ b/SampleProject/ASDKSampleApp/Source/ShopCart/ShopCartCell/ShopCartCell.m @@ -14,9 +14,12 @@ @implementation ShopCartCell - (void)awakeFromNib { + [super awakeFromNib]; // Initialization code self.itemCostLabel.textColor = kMainBlueColor; self.selectionStyle = UITableViewCellSelectionStyleNone; + [self.deleteButton setTitle:NSLocalizedString(@"Delete", @"УДАЛИТЬ") forState:UIControlStateNormal]; + } - (void)setSelected:(BOOL)selected animated:(BOOL)animated { diff --git a/SampleProject/ASDKSampleApp/Source/ShopCart/ShopCartCell/ShopCartCell.xib b/SampleProject/ASDKSampleApp/Source/ShopCart/ShopCartCell/ShopCartCell.xib index e7c58ed..d62523b 100644 --- a/SampleProject/ASDKSampleApp/Source/ShopCart/ShopCartCell/ShopCartCell.xib +++ b/SampleProject/ASDKSampleApp/Source/ShopCart/ShopCartCell/ShopCartCell.xib @@ -1,9 +1,9 @@ - + - - + + @@ -12,22 +12,19 @@ - + - - + -