From 57139f0529879507c7407cd4bdf923cb000b9833 Mon Sep 17 00:00:00 2001 From: Budnikov Vyacheslav Date: Mon, 27 Nov 2017 11:28:24 +0300 Subject: [PATCH] fix warning Add sum NumberFormatter for amount fraction digits --- ASDKCore.xcodeproj/project.pbxproj | 8 +++ .../Request/ASDKRequestSubmitRandomAmount.h | 2 +- .../Request/ASDKRequestSubmitRandomAmount.m | 3 +- .../Request/Init/ASDKInitRequest.h | 4 +- .../Request/Init/ASDKInitRequest.m | 2 +- ASDKCore/ASDKUtils.h | 29 ++++++++++ ASDKCore/ASDKUtils.m | 56 +++++++++++++++++++ .../Init/ASDKInitRequestBuilder.m | 7 ++- .../ASDKCardsListDataController.h | 4 +- .../ASDKCardsListDataController.m | 4 +- .../ASDKPaymentFormStarter.h | 8 +-- .../ASDKPaymentFormStarter.m | 6 +- .../ASDKSampleApp/Resources/books.json | 2 +- .../ASDKSampleApp/Source/ASDKCardIOScanner.m | 4 +- .../ASDKSampleApp/Source/PayController.h | 6 +- .../ASDKSampleApp/Source/PayController.m | 6 +- .../Source/SettingsViewController.m | 2 +- 17 files changed, 124 insertions(+), 29 deletions(-) create mode 100644 ASDKCore/ASDKUtils.h create mode 100644 ASDKCore/ASDKUtils.m diff --git a/ASDKCore.xcodeproj/project.pbxproj b/ASDKCore.xcodeproj/project.pbxproj index 0c6e0e0..c2e9bb0 100644 --- a/ASDKCore.xcodeproj/project.pbxproj +++ b/ASDKCore.xcodeproj/project.pbxproj @@ -49,6 +49,8 @@ 2C6E6BAA1F94CB0300B345B9 /* ASDKRequestSubmitRandomAmount.m in Sources */ = {isa = PBXBuildFile; fileRef = 2C6E6BA81F94CB0300B345B9 /* ASDKRequestSubmitRandomAmount.m */; }; 2C6E6BAD1F94CC2700B345B9 /* ASDKRequestBuilderSubmitRandomAmount.h in Headers */ = {isa = PBXBuildFile; fileRef = 2C6E6BAB1F94CC2700B345B9 /* ASDKRequestBuilderSubmitRandomAmount.h */; }; 2C6E6BAE1F94CC2700B345B9 /* ASDKRequestBuilderSubmitRandomAmount.m in Sources */ = {isa = PBXBuildFile; fileRef = 2C6E6BAC1F94CC2700B345B9 /* ASDKRequestBuilderSubmitRandomAmount.m */; }; + 2CFBF58E1FCBFD180060C87F /* ASDKUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 2CFBF58C1FCBFD180060C87F /* ASDKUtils.h */; }; + 2CFBF58F1FCBFD180060C87F /* ASDKUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 2CFBF58D1FCBFD180060C87F /* ASDKUtils.m */; }; 83166ED71C63984E00533D85 /* ASDKCore.h in Headers */ = {isa = PBXBuildFile; fileRef = 83166ED61C63984E00533D85 /* ASDKCore.h */; settings = {ATTRIBUTES = (Public, ); }; }; 83166F2F1C63988F00533D85 /* ASDKBaseObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 83166EE11C63988F00533D85 /* ASDKBaseObject.h */; settings = {ATTRIBUTES = (Public, ); }; }; 83166F301C63988F00533D85 /* ASDKBaseObject.m in Sources */ = {isa = PBXBuildFile; fileRef = 83166EE21C63988F00533D85 /* ASDKBaseObject.m */; }; @@ -150,6 +152,8 @@ 2C6E6BA81F94CB0300B345B9 /* ASDKRequestSubmitRandomAmount.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ASDKRequestSubmitRandomAmount.m; sourceTree = ""; }; 2C6E6BAB1F94CC2700B345B9 /* ASDKRequestBuilderSubmitRandomAmount.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ASDKRequestBuilderSubmitRandomAmount.h; sourceTree = ""; }; 2C6E6BAC1F94CC2700B345B9 /* ASDKRequestBuilderSubmitRandomAmount.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ASDKRequestBuilderSubmitRandomAmount.m; sourceTree = ""; }; + 2CFBF58C1FCBFD180060C87F /* ASDKUtils.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ASDKUtils.h; sourceTree = ""; }; + 2CFBF58D1FCBFD180060C87F /* ASDKUtils.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ASDKUtils.m; sourceTree = ""; }; 83166ED31C63984E00533D85 /* ASDKCore.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = ASDKCore.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 83166ED61C63984E00533D85 /* ASDKCore.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ASDKCore.h; sourceTree = ""; }; 83166ED81C63984E00533D85 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; @@ -264,6 +268,8 @@ 946C39A21C64921A0036D1AF /* ASDKApiKeys.h */, 83166F151C63988F00533D85 /* CryptoUtils */, 83166F181C63988F00533D85 /* RequestBuilder */, + 2CFBF58C1FCBFD180060C87F /* ASDKUtils.h */, + 2CFBF58D1FCBFD180060C87F /* ASDKUtils.m */, ); path = ASDKCore; sourceTree = ""; @@ -608,6 +614,7 @@ 83166F411C63988F00533D85 /* ASDKAcquiringResponse.h in Headers */, 946C399E1C648F940036D1AF /* ASDKCardData.h in Headers */, 2C352DAB1E4B1707008215A5 /* ASDKCancelRequestBuilder.h in Headers */, + 2CFBF58E1FCBFD180060C87F /* ASDKUtils.h in Headers */, 2C1C13451F8F6184002B636F /* ASDKRequestAttachCard.h in Headers */, 943FC86D1C6881650044C707 /* ASDKPaymentInfo.h in Headers */, 83166F4F1C63988F00533D85 /* ASDKAcquiringApi.h in Headers */, @@ -761,6 +768,7 @@ 83871B801C6CC5EF00D69603 /* ASDKStringKeyCreator.m in Sources */, 83166F501C63988F00533D85 /* ASDKAcquiringApi.m in Sources */, 83166F4A1C63988F00533D85 /* ASDKGetStateResponse.m in Sources */, + 2CFBF58F1FCBFD180060C87F /* ASDKUtils.m in Sources */, 2C6E6BA01F949F9700B345B9 /* ASDKResponseGetAddCardState.m in Sources */, 2C1C134A1F8F8112002B636F /* ASDKResponseAddCardInit.m in Sources */, 83166F5D1C63988F00533D85 /* ASDKGetCardListRequestBuilder.m in Sources */, diff --git a/ASDKCore/API Objects/Request/ASDKRequestSubmitRandomAmount.h b/ASDKCore/API Objects/Request/ASDKRequestSubmitRandomAmount.h index 260eb72..f83eaf5 100644 --- a/ASDKCore/API Objects/Request/ASDKRequestSubmitRandomAmount.h +++ b/ASDKCore/API Objects/Request/ASDKRequestSubmitRandomAmount.h @@ -23,7 +23,7 @@ @interface ASDKRequestSubmitRandomAmount : ASDKAcquiringRequest @property (nonatomic, copy) NSString *requestKey; -@property (nonatomic, strong) NSNumber *amount; +@property (nonatomic, strong) NSString *amount; - (instancetype)initWithTerminalKey:(NSString *)terminalKey token:(NSString *)token diff --git a/ASDKCore/API Objects/Request/ASDKRequestSubmitRandomAmount.m b/ASDKCore/API Objects/Request/ASDKRequestSubmitRandomAmount.m index 4f36352..2a339e5 100644 --- a/ASDKCore/API Objects/Request/ASDKRequestSubmitRandomAmount.m +++ b/ASDKCore/API Objects/Request/ASDKRequestSubmitRandomAmount.m @@ -19,6 +19,7 @@ // #import "ASDKRequestSubmitRandomAmount.h" +#import "ASDKUtils.h" @implementation ASDKRequestSubmitRandomAmount @@ -30,7 +31,7 @@ - (instancetype)initWithTerminalKey:(NSString *)terminalKey if (self = [super initWithTerminalKey:terminalKey token:token]) { _requestKey = requestKey; - _amount = amount; + _amount = [ASDKUtils amountWholeDigits:amount.doubleValue]; } return self; diff --git a/ASDKCore/API Objects/Request/Init/ASDKInitRequest.h b/ASDKCore/API Objects/Request/Init/ASDKInitRequest.h index 2283f50..40a1800 100644 --- a/ASDKCore/API Objects/Request/Init/ASDKInitRequest.h +++ b/ASDKCore/API Objects/Request/Init/ASDKInitRequest.h @@ -23,7 +23,7 @@ @interface ASDKInitRequest : ASDKAcquiringRequest @property (nonatomic, copy) NSString *payType; -@property (nonatomic, strong) NSNumber *amount; +@property (nonatomic, strong) NSString *amount; @property (nonatomic, copy) NSString *orderId; @property (nonatomic, copy) NSString *customerKey; @property (nonatomic, copy) NSString *requestDescription; @@ -33,7 +33,7 @@ @property (nonatomic, strong) NSDictionary *receiptData; - (ASDKInitRequest *)initWithTerminalKey:(NSString *)terminalKey - amount:(NSNumber *)amount + amount:(NSString *)amount orderId:(NSString *)orderId description:(NSString *)description token:(NSString *)token diff --git a/ASDKCore/API Objects/Request/Init/ASDKInitRequest.m b/ASDKCore/API Objects/Request/Init/ASDKInitRequest.m index 0ab4ae5..9031585 100644 --- a/ASDKCore/API Objects/Request/Init/ASDKInitRequest.m +++ b/ASDKCore/API Objects/Request/Init/ASDKInitRequest.m @@ -23,7 +23,7 @@ @implementation ASDKInitRequest - (ASDKInitRequest *)initWithTerminalKey:(NSString *)terminalKey - amount:(NSNumber *)amount + amount:(NSString *)amount orderId:(NSString *)orderId description:(NSString *)description token:(NSString *)token diff --git a/ASDKCore/ASDKUtils.h b/ASDKCore/ASDKUtils.h new file mode 100644 index 0000000..53df4e5 --- /dev/null +++ b/ASDKCore/ASDKUtils.h @@ -0,0 +1,29 @@ +// +// ASDKUtils.h +// ASDKCore +// +// Created by v.budnikov on 27.11.2017. +// Copyright © 2017 Tinkoff Bank. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +#import + +extern NSString *const kSumDecimalSeparator; + +@interface ASDKUtils : NSObject + ++ (NSString *)amountWholeDigits:(double)amount; + +@end diff --git a/ASDKCore/ASDKUtils.m b/ASDKCore/ASDKUtils.m new file mode 100644 index 0000000..ab5055b --- /dev/null +++ b/ASDKCore/ASDKUtils.m @@ -0,0 +1,56 @@ +// +// ASDKUtils.m +// ASDKCore +// +// Copyright © 2017 Tinkoff Bank. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +#import "ASDKUtils.h" + +NSString *const kSumDecimalSeparator = @","; + +@implementation ASDKUtils + ++ (NSNumberFormatter *)sumNumberFormatter +{ + static NSNumberFormatter *sumNumberFormatter = nil; + + if (sumNumberFormatter == nil) + { + sumNumberFormatter = [[NSNumberFormatter alloc] init]; + [sumNumberFormatter setGroupingSize:0]; + [sumNumberFormatter setDecimalSeparator:kSumDecimalSeparator]; + [sumNumberFormatter setNumberStyle:NSNumberFormatterDecimalStyle]; + [sumNumberFormatter setMaximumFractionDigits:2]; + [sumNumberFormatter setMinimumFractionDigits:2]; + } + + return sumNumberFormatter; +} + ++ (NSString *)amountWholeDigits:(double)amount +{ + NSString *string = [[self sumNumberFormatter] stringFromNumber:[NSNumber numberWithDouble:amount]]; + NSArray *array = [string componentsSeparatedByString:kSumDecimalSeparator]; + + if ([array count] == 2) + { + return [array objectAtIndex:0]; + } + + return string; +} + +@end diff --git a/ASDKCore/RequestBuilder/Init/ASDKInitRequestBuilder.m b/ASDKCore/RequestBuilder/Init/ASDKInitRequestBuilder.m index c6260dd..e066610 100644 --- a/ASDKCore/RequestBuilder/Init/ASDKInitRequestBuilder.m +++ b/ASDKCore/RequestBuilder/Init/ASDKInitRequestBuilder.m @@ -17,10 +17,11 @@ // limitations under the License. #import "ASDKInitRequestBuilder.h" +#import "ASDKUtils.h" @interface ASDKInitRequestBuilder () -@property (nonatomic, strong) NSNumber *amount; +@property (nonatomic, strong) NSString *amount; @property (nonatomic, copy) NSString *orderId; @property (nonatomic, copy) NSString *customerKey; @property (nonatomic, copy) NSString *requestDescription; @@ -50,7 +51,7 @@ + (ASDKInitRequestBuilder *)builderWithAmount:(NSNumber *)amount if (builder) { - builder.amount = [NSNumber numberWithInteger:[NSString stringWithFormat:@"%.0f", amount.doubleValue].integerValue]; + builder.amount = [ASDKUtils amountWholeDigits:amount.doubleValue]; builder.orderId = orderId; builder.requestDescription = description; builder.payType = payType; @@ -215,7 +216,7 @@ - (NSDictionary *)parametersForToken kASDKPassword : [self password]}]; if (self.amount) { - [parameters setObject:self.amount.stringValue forKey:kASDKAmount]; + [parameters setObject:self.amount forKey:kASDKAmount]; } if (self.orderId.length > 0) diff --git a/ASDKUI/Payment/CardListDataSource/ASDKCardsListDataController.h b/ASDKUI/Payment/CardListDataSource/ASDKCardsListDataController.h index 0715aa7..63b5575 100644 --- a/ASDKUI/Payment/CardListDataSource/ASDKCardsListDataController.h +++ b/ASDKUI/Payment/CardListDataSource/ASDKCardsListDataController.h @@ -33,11 +33,11 @@ - (ASDKCard *)cardWithRebillId; - (ASDKCard *)cardWithIdentifier:(NSString *)indentifier; -- (void)updateCardsListWithSuccessBlock:(void (^)())onSuccess +- (void)updateCardsListWithSuccessBlock:(void (^)(void))onSuccess errorBlock:(void (^)(ASDKAcquringSdkError *error))onError; - (void)removeCardWithCardId:(NSNumber *)cardId - successBlock:(void (^)())onSuccess + successBlock:(void (^)(void))onSuccess errorBlock:(void (^)(ASDKAcquringSdkError *error))onError; diff --git a/ASDKUI/Payment/CardListDataSource/ASDKCardsListDataController.m b/ASDKUI/Payment/CardListDataSource/ASDKCardsListDataController.m index a757cfc..d694119 100644 --- a/ASDKUI/Payment/CardListDataSource/ASDKCardsListDataController.m +++ b/ASDKUI/Payment/CardListDataSource/ASDKCardsListDataController.m @@ -112,7 +112,7 @@ - (ASDKCard *)cardWithIdentifier:(NSString *)indentifier } -- (void)updateCardsListWithSuccessBlock:(void (^)())onSuccess +- (void)updateCardsListWithSuccessBlock:(void (^)(void))onSuccess errorBlock:(void (^)(ASDKAcquringSdkError *error))onError { if (self.acquiringSdk && self.customerKey) @@ -161,7 +161,7 @@ - (void)updateCardsListWithSuccessBlock:(void (^)())onSuccess } - (void)removeCardWithCardId:(NSNumber *)cardId - successBlock:(void (^)())onSuccess + successBlock:(void (^)(void))onSuccess errorBlock:(void (^)(ASDKAcquringSdkError *error))onError { if (self.acquiringSdk && self.customerKey) diff --git a/ASDKUI/Payment/PaymentFormStarter/ASDKPaymentFormStarter.h b/ASDKUI/Payment/PaymentFormStarter/ASDKPaymentFormStarter.h index c49cabf..4a1e6e3 100644 --- a/ASDKUI/Payment/PaymentFormStarter/ASDKPaymentFormStarter.h +++ b/ASDKUI/Payment/PaymentFormStarter/ASDKPaymentFormStarter.h @@ -33,7 +33,7 @@ */ - (void)scanCardSuccess:(void (^)(NSString *cardNumber))success failure:(void (^)(ASDKAcquringSdkError *error))failure - cancel:(void (^)())cancel; + cancel:(void (^)(void))cancel; @end @@ -71,7 +71,7 @@ additionalPaymentData:(NSDictionary *)data receiptData:(NSDictionary *)receiptData success:(void (^)(ASDKPaymentInfo *paymentInfo))onSuccess - cancelled:(void (^)())onCancelled + cancelled:(void (^)(void))onCancelled error:(void (^)(ASDKAcquringSdkError *error))onError; - (void)chargeWithRebillId:(NSNumber *)rebillId @@ -140,7 +140,7 @@ additionalPaymentData:(NSDictionary *)additionalPaymentData //JSON объект содержащий дополнительные параметры, например @{@"Email" : @"a@test.ru"} receiptData:(NSDictionary *)receiptData // JSON объект с данными чека, обязательно должен быть объект Items в который вложены позиции чека Email и Taxation - Система налогообложения, значения: osn, usn_income, usn_income_outcome, envd, esn, или patent success:(void (^)(ASDKPaymentInfo *paymentInfo))onSuccess - cancelled:(void (^)())onCancelled + cancelled:(void (^)(void))onCancelled error:(void (^)(ASDKAcquringSdkError *error))onError NS_AVAILABLE_IOS(9_0); - (void)checkStatusTransaction:(NSString *)paymentId @@ -148,7 +148,7 @@ error:(void (^)(ASDKAcquringSdkError *error))onError; - (void)refundTransaction:(NSString *)paymentId - success:(void (^)())onSuccess + success:(void (^)(void))onSuccess error:(void (^)(ASDKAcquringSdkError *error))onError; /*! diff --git a/ASDKUI/Payment/PaymentFormStarter/ASDKPaymentFormStarter.m b/ASDKUI/Payment/PaymentFormStarter/ASDKPaymentFormStarter.m index a78df89..a9c8e0c 100644 --- a/ASDKUI/Payment/PaymentFormStarter/ASDKPaymentFormStarter.m +++ b/ASDKUI/Payment/PaymentFormStarter/ASDKPaymentFormStarter.m @@ -132,7 +132,7 @@ - (void)presentPaymentFormFromViewController:(UIViewController *)presentingViewC additionalPaymentData:(NSDictionary *)data receiptData:(NSDictionary *)receiptData success:(void (^)(ASDKPaymentInfo *paymentInfo))onSuccess - cancelled:(void (^)())onCancelled + cancelled:(void (^)(void))onCancelled error:(void(^)(ASDKAcquringSdkError *error))onError { [self prepareDesign]; @@ -289,7 +289,7 @@ - (void)payWithApplePayFromViewController:(UIViewController *)presentingViewCont additionalPaymentData:(NSDictionary *)additionalPaymentData receiptData:(NSDictionary *)receiptData success:(void (^)(ASDKPaymentInfo *paymentInfo))onSuccess - cancelled:(void (^)())onCancelled + cancelled:(void (^)(void))onCancelled error:(void (^)(ASDKAcquringSdkError *error))onError { /////////////// @@ -366,7 +366,7 @@ - (void)checkStatusTransaction:(NSString *)paymentId } - (void)refundTransaction:(NSString *)paymentId - success:(void (^)())onSuccess + success:(void (^)(void))onSuccess error:(void (^)(ASDKAcquringSdkError *error))onError { [self.acquiringSdk rejectTrancastionWithPaymentId:paymentId success:^(ASDKCancelResponse *response) { diff --git a/SampleProject/ASDKSampleApp/Resources/books.json b/SampleProject/ASDKSampleApp/Resources/books.json index 6a64241..c2798ef 100644 --- a/SampleProject/ASDKSampleApp/Resources/books.json +++ b/SampleProject/ASDKSampleApp/Resources/books.json @@ -18,7 +18,7 @@ "cover": "cover3", "title": "Чайка по имени Джонатан Ливингстон", "author" : "Ричард Бах", - "cost" : 720800.0312, + "cost" : 720800.0301, "description" : "Короткое описание" } ] diff --git a/SampleProject/ASDKSampleApp/Source/ASDKCardIOScanner.m b/SampleProject/ASDKSampleApp/Source/ASDKCardIOScanner.m index e00abcd..ed2ec49 100644 --- a/SampleProject/ASDKSampleApp/Source/ASDKCardIOScanner.m +++ b/SampleProject/ASDKSampleApp/Source/ASDKCardIOScanner.m @@ -13,7 +13,7 @@ @interface ASDKCardIOScanner () @property (nonatomic, strong) void (^successBlock)(NSString *cardNumber); -@property (nonatomic, strong) void (^cancelBlock)(); +@property (nonatomic, strong) void (^cancelBlock)(void); @end @@ -96,7 +96,7 @@ - (void)userDidCancelPaymentViewController:(CardIOPaymentViewController *)paymen - (void)scanCardSuccess:(void (^)(NSString *cardNumnber))success failure:(void (^)(ASDKAcquringSdkError *error))failure - cancel:(void (^)())cancel + cancel:(void (^)(void))cancel { self.successBlock = success; self.cancelBlock = cancel; diff --git a/SampleProject/ASDKSampleApp/Source/PayController.h b/SampleProject/ASDKSampleApp/Source/PayController.h index 678fe5d..05ebb1d 100644 --- a/SampleProject/ASDKSampleApp/Source/PayController.h +++ b/SampleProject/ASDKSampleApp/Source/PayController.h @@ -22,7 +22,7 @@ receiptData:(NSDictionary *)receiptData fromViewController:(UIViewController *)viewController success:(void (^)(ASDKPaymentInfo *paymentInfo))onSuccess - cancelled:(void (^)())onCancelled + cancelled:(void (^)(void))onCancelled error:(void(^)(ASDKAcquringSdkError *error))onError; + (void)chargeWithRebillId:(NSNumber *)rebillId @@ -47,7 +47,7 @@ receiptData:(NSDictionary *)receiptData fromViewController:(UIViewController *)viewController success:(void (^)(ASDKPaymentInfo *paymentIfo))onSuccess - cancelled:(void (^)())onCancelled + cancelled:(void (^)(void))onCancelled error:(void(^)(ASDKAcquringSdkError *error))onError; + (void)checkStatusTransaction:(NSString *)paymentId @@ -57,7 +57,7 @@ + (void)refundTransaction:(NSString *)paymentId fromViewController:(UIViewController *)viewController - success:(void (^)())onSuccess + success:(void (^)(void))onSuccess error:(void (^)(ASDKAcquringSdkError *error))onError; + (void)attachCard:(NSString *)cardCheckType additionalData:(NSDictionary *)data fromViewController:(UIViewController *)viewController diff --git a/SampleProject/ASDKSampleApp/Source/PayController.m b/SampleProject/ASDKSampleApp/Source/PayController.m index 24b190b..75cea35 100644 --- a/SampleProject/ASDKSampleApp/Source/PayController.m +++ b/SampleProject/ASDKSampleApp/Source/PayController.m @@ -103,7 +103,7 @@ + (void)buyItemWithName:(NSString *)name receiptData:(NSDictionary *)receiptData fromViewController:(UIViewController *)viewController success:(void (^)(ASDKPaymentInfo *paymentInfo))onSuccess - cancelled:(void (^)())onCancelled + cancelled:(void (^)(void))onCancelled error:(void(^)(ASDKAcquringSdkError *error))onError { ASDKPaymentFormStarter *paymentFormStarter = [PayController paymentFormStarter]; @@ -250,7 +250,7 @@ + (void)buyWithApplePayAmount:(NSNumber *)amount receiptData:(NSDictionary *)receiptData fromViewController:(UIViewController *)viewController success:(void (^)(ASDKPaymentInfo *paymentIfo))onSuccess - cancelled:(void (^)())onCancelled + cancelled:(void (^)(void))onCancelled error:(void(^)(ASDKAcquringSdkError *error))onError { ASDKPaymentFormStarter *paymentFormStarter = [PayController paymentFormStarter]; @@ -309,7 +309,7 @@ + (void)checkStatusTransaction:(NSString *)paymentId + (void)refundTransaction:(NSString *)paymentId fromViewController:(UIViewController *)viewController - success:(void (^)())onSuccess + success:(void (^)(void))onSuccess error:(void (^)(ASDKAcquringSdkError *error))onError { ASDKPaymentFormStarter *paymentFormStarter = [PayController paymentFormStarter]; diff --git a/SampleProject/ASDKSampleApp/Source/SettingsViewController.m b/SampleProject/ASDKSampleApp/Source/SettingsViewController.m index 6779a12..eff12af 100644 --- a/SampleProject/ASDKSampleApp/Source/SettingsViewController.m +++ b/SampleProject/ASDKSampleApp/Source/SettingsViewController.m @@ -244,7 +244,7 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath if ([self cellTypeForIndexPath:indexPath] == CellTypeAddNewCard) { - [PayController attachCard:self.addNewCardCheckType additionalData:nil fromViewController:self success:^(ASDKResponseAddCardInit *response) { + [PayController attachCard:@"AUTO"/*self.addNewCardCheckType*/ additionalData:nil fromViewController:self success:^(ASDKResponseAddCardInit *response) { // } cancelled:^{ //