Skip to content

Commit

Permalink
Update framework and examples to handle multiple use, optional cvn
Browse files Browse the repository at this point in the history
f
  • Loading branch information
0505gonzalez committed Aug 10, 2017
1 parent 5559793 commit 6568154
Show file tree
Hide file tree
Showing 15 changed files with 122 additions and 72 deletions.
7 changes: 2 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ cardData.cardCvn = "123"
cardData.isMultipleUse = true
Xendit.createToken(fromViewController: self, cardData: cardData) { (token, error) in
if (error != nil) {
// Handle error. Error is of type XenditError
return
Expand Down Expand Up @@ -69,10 +68,9 @@ cardData.cardCvn = @"123";
Swift:
```
let tokenID = "sample-token-id"
let cardCVN = "123"
let amount = 75000
Xendit.createAuthentication(fromViewController: self, tokenId: tokenID!, amount: amount, cardCVN: cardCVN!) { (authentication, error) in
Xendit.createAuthentication(fromViewController: self, tokenId: tokenID!, amount: amount) { (authentication, error) in
DispatchQueue.main.async {
self.activityIndicator.stopAnimating()
}
Expand All @@ -89,10 +87,9 @@ Xendit.createAuthentication(fromViewController: self, tokenId: tokenID!, amount:
Objective-C:
```
NSString *tokenID = @"sample-token-id";
NSString *cvn = @"123";
int amount = 75000;
[Xendit createAuthenticationFromViewController:self tokenId:tokenID amount:amount cardCVN:cvn completion:^(XENAuthentication * _Nullable authentication, XENError * _Nullable error) {
[Xendit createAuthenticationFromViewController:self tokenId:tokenID amount:amount completion:^(XENAuthentication * _Nullable authentication, XENError * _Nullable error) {
if (err != nil) {
// Handle error
return
Expand Down
6 changes: 5 additions & 1 deletion Xendit.framework/Headers/Xendit-Swift.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,9 @@ SWIFT_CLASS_NAMED("CardData")
@property (nonatomic, copy) NSString * _Null_unspecified cardNumber;
@property (nonatomic, copy) NSString * _Null_unspecified cardExpMonth;
@property (nonatomic, copy) NSString * _Null_unspecified cardExpYear;
@property (nonatomic, copy) NSString * _Null_unspecified cardCvn;
@property (nonatomic, copy) NSString * _Nullable cardCvn;
@property (nonatomic, strong) NSNumber * _Null_unspecified amount;
@property (nonatomic) BOOL isMultipleUse;
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
@end

Expand All @@ -182,8 +183,10 @@ SWIFT_CLASS_NAMED("Xendit")
SWIFT_CLASS_PROPERTY(@property (nonatomic, class, copy) NSString * _Nullable publishableKey;)
+ (NSString * _Nullable)publishableKey SWIFT_WARN_UNUSED_RESULT;
+ (void)setPublishableKey:(NSString * _Nullable)value;
+ (void)createTokenFromViewController:(UIViewController * _Nonnull)fromViewController cardData:(XENCardData * _Null_unspecified)cardData shouldAuthenticate:(BOOL)shouldAuthenticate completion:(void (^ _Nonnull)(XENCCToken * _Nullable, XENError * _Nullable))completion;
+ (void)createTokenFromViewController:(UIViewController * _Nonnull)fromViewController cardData:(XENCardData * _Null_unspecified)cardData completion:(void (^ _Nonnull)(XENCCToken * _Nullable, XENError * _Nullable))completion;
+ (void)createAuthenticationFromViewController:(UIViewController * _Nonnull)fromViewController tokenId:(NSString * _Nonnull)tokenId amount:(NSNumber * _Nonnull)amount cardCVN:(NSString * _Nonnull)cardCVN completion:(void (^ _Nonnull)(XENAuthentication * _Nullable, XENError * _Nullable))completion;
+ (void)createAuthenticationFromViewController:(UIViewController * _Nonnull)fromViewController tokenId:(NSString * _Nonnull)tokenId amount:(NSNumber * _Nonnull)amount completion:(void (^ _Nonnull)(XENAuthentication * _Nullable, XENError * _Nullable))completion;
+ (BOOL)isCardNumberValidWithCardNumber:(NSString * _Nonnull)cardNumber SWIFT_WARN_UNUSED_RESULT;
+ (BOOL)isExpiryValidWithCardExpirationMonth:(NSString * _Nonnull)cardExpirationMonth cardExpirationYear:(NSString * _Nonnull)cardExpirationYear SWIFT_WARN_UNUSED_RESULT;
+ (BOOL)isCvnValidWithCreditCardCVN:(NSString * _Nonnull)creditCardCVN SWIFT_WARN_UNUSED_RESULT;
Expand Down Expand Up @@ -212,6 +215,7 @@ SWIFT_CLASS_NAMED("XenditCCToken")
@interface XENCCToken : NSObject
@property (nonatomic, copy) NSString * _Null_unspecified tokenID;
@property (nonatomic, copy) NSString * _Null_unspecified status;
@property (nonatomic, copy) NSString * _Null_unspecified authenticationId;
@property (nonatomic, copy) NSString * _Nullable authenticationURL;
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
@end
Expand Down
Binary file modified Xendit.framework/Modules/Xendit.swiftmodule/arm.swiftmodule
Binary file not shown.
Binary file modified Xendit.framework/Modules/Xendit.swiftmodule/arm64.swiftmodule
Binary file not shown.
Binary file modified Xendit.framework/Modules/Xendit.swiftmodule/i386.swiftmodule
Binary file not shown.
Binary file modified Xendit.framework/Modules/Xendit.swiftmodule/x86_64.swiftmodule
Binary file not shown.
Binary file modified Xendit.framework/Xendit
Binary file not shown.
2 changes: 1 addition & 1 deletion Xendit.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "Xendit"
s.version = "1.0.2"
s.version = "1.1.0"
s.summary = "Xendit makes it easy to collect credit card data securely without it having to touch your server"
s.homepage = "https://www.xendit.co"
s.license = "MIT"
Expand Down
6 changes: 4 additions & 2 deletions XenditExample/XenditExample.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 10.3;
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
Expand Down Expand Up @@ -442,7 +442,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 10.3;
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
Expand Down Expand Up @@ -492,6 +492,7 @@
"$(PROJECT_DIR)/..",
);
INFOPLIST_FILE = XenditExampleObjC/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = co.xendit.XenditExampleObjC;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -508,6 +509,7 @@
"$(PROJECT_DIR)/..",
);
INFOPLIST_FILE = XenditExampleObjC/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = co.xendit.XenditExampleObjC;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down
Loading

0 comments on commit 6568154

Please sign in to comment.