ObjectiveLuhn alternatives and similar libraries
Based on the "Payments" category.
Alternatively, view ObjectiveLuhn alternatives based on common mentions on social networks and blogs.
-
SwiftyStoreKit
Lightweight In App Purchases Swift framework for iOS 8.0+, tvOS 9.0+ and macOS 10.10+ ⛺ -
card.io-iOS-SDK
card.io provides fast, easy credit card scanning in mobile apps -
RevenueCat
In-app purchases and subscriptions made easy. Support for iOS, iPadOS, watchOS, and Mac. -
CreditCardForm-iOS
CreditCardForm is iOS framework that allows developers to create the UI which replicates an actual Credit Card. -
merchantkit
A modern In-App Purchases management framework for iOS. -
TPInAppReceipt
Reading and Validating In App Purchase Receipt Locally. -
MFCard
Easily integrate Credit Card payments module in iOS App. Swift 4.0 -
monza
Ruby Gem for Rails - Easy iTunes In-App Purchase Receipt validation, including auto-renewable subscriptions -
YRPayment
Better payment user experience library with cool animation in Swift -
SwiftLuhn
Debit/Credit card validation port of the Luhn Algorithm in Swift -
TipJarViewController
Easy, drop-in tip jar for iOS apps. -
AnimatedCardInput
Easy to use iOS library with components for input of Credit Card data. -
SwiftInAppPurchase
Simply code In App Purchases with this Swift Framework -
Glassfy
Open source SDK to quickly integrate subscriptions, stop worring about code maintenance, and getting advanced real-time data. Full support for iOS, iPadOS, WatchOS, MacOS
Appwrite - The open-source backend cloud platform
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of ObjectiveLuhn or a related project?
README
Luhn Algorithm
This is a port of the Luhn Algorithm, generally used for validating Credit Card details, to Objective-C (iOS).
Swift port can be found at https://github.com/MaxKramer/SwiftLuhn.
It's as simple as calling one single method; no special formatting is required.
You must run pod install
before opening the Example Project's 'workspace.
Instructions
Import the header:
#import "Luhn.h"
Call the class method returning a BOOL
as to whether the string is valid or not:
BOOL isValid = [Luhn validateString:@"some credit card number"];
if (isValid) {
// process payment
}
else {
// alert user
}
Alternatively, you can use the NSString category (no additional imports required):
NSString *ccNumber = @"378282246310005";
BOOL isValid = [ccNumber isValidCreditCardNumber];
You can also get the type of the credit card i.e. Visa, Diners, Amex, etc:
OLCreditCardType cardType = [ccNumber creditCardType];
// or
OLCreditCardType cardType = [Luhn typeFromString:ccNumber];
If you come across any issues or have a feature request, please open an issue or find me on:
Twitter: @maxkramer
Website: http://maxkramer.co
Sources
Name | Website | Reason |
---|---|---|
Paypal | http://www.paypalobjects.com/en_US/vhelp/paypalmanager_help/credit_card_numbers.htm | List of valid credit card numbers for the unit tests |
Thanks
Ayaka Nonaka for updating the Cocoapod spec and helping me with other aspects of the project!
Twitter: @ayanonagon
License
This project is licensed under the MIT License.
*Note that all licence references and agreements mentioned in the ObjectiveLuhn README section above
are relevant to that project's source code only.