All Projects → orazz → Creditcardform Ios

orazz / Creditcardform Ios

Licence: mit
CreditCardForm is iOS framework that allows developers to create the UI which replicates an actual Credit Card.

Programming Languages

swift
15916 projects
ruby
36898 projects - #4 most used programming language
objective c
16641 projects - #2 most used programming language

Projects that are alternatives of or similar to Creditcardform Ios

svelte-stripe-js
Everything you need to add Stripe Elements to your Svelte project
Stars: ✭ 139 (-90.29%)
Mutual labels:  stripe, credit-card
payment-fields
React component for Braintree/Stripe/Square payment fields
Stars: ✭ 17 (-98.81%)
Mutual labels:  stripe, credit-card
CCView
💳 Ready made credit card creation library. 💳
Stars: ✭ 42 (-97.06%)
Mutual labels:  credit-card, creditcardform
ember-credit-card
"make your credit card form dreamy in one line of code"
Stars: ✭ 89 (-93.78%)
Mutual labels:  stripe, credit-card
Nuxt Stripe Module
A NuxtJS module to import Stripe client script.
Stars: ✭ 72 (-94.97%)
Mutual labels:  stripe
Tipsi Stripe
React Native Stripe binding for iOS/Android platforms
Stars: ✭ 1,106 (-22.71%)
Mutual labels:  stripe
Svelte Input Mask
Input masking component for Svelte with simple API and rich customization
Stars: ✭ 56 (-96.09%)
Mutual labels:  credit-card
Stripe Kit
Stars: ✭ 50 (-96.51%)
Mutual labels:  stripe
Gatsby Starter Stripe
🛒 A starter storefront & admin UI with Gatsby, Stripe, & Netlify Functions.
Stars: ✭ 92 (-93.57%)
Mutual labels:  stripe
Cordova Plugin Stripe
A Cordova plugin that lets you use Stripe's Native SDKs for Android and iOS.
Stars: ✭ 90 (-93.71%)
Mutual labels:  stripe
Nova Stripe Theme
A Laravel Nova theme closely resembling Stripe.
Stars: ✭ 71 (-95.04%)
Mutual labels:  stripe
Omise Ios
Omise iOS SDK
Stars: ✭ 63 (-95.6%)
Mutual labels:  credit-card
React Native Stripe Payments
Lightweight, easy to integrate and use React native library for Stripe payments (using Payment Intents) compliant with SCA (strong customer authentication)
Stars: ✭ 78 (-94.55%)
Mutual labels:  stripe
Checkout Netlify Serverless
Sell products on the Jamstack with Netlify Functions and Stripe Checkout!
Stars: ✭ 58 (-95.95%)
Mutual labels:  stripe
Awesomecard
A Flutter package to easily create a Credit Card in your application.
Stars: ✭ 91 (-93.64%)
Mutual labels:  credit-card
Vue Paycard
Credit card component made with Vue.js
Stars: ✭ 52 (-96.37%)
Mutual labels:  credit-card
Sample Vue Shop
See readme for newer repo details! A sample shop that shows how to manage payments with Vue, Stripe, and Serverless Functions
Stars: ✭ 1,166 (-18.52%)
Mutual labels:  stripe
Stripe Payments Demo
Sample store accepting universal payments on the web with Stripe Elements, Payment Request, Apple Pay, Google Pay, Microsoft Pay, and the PaymentIntents API. 💳🌍✨
Stars: ✭ 1,287 (-10.06%)
Mutual labels:  stripe
Ecommerce Netlify
🛍 A JAMstack Ecommerce Site built with Nuxt and Netlify Functions
Stars: ✭ 1,147 (-19.85%)
Mutual labels:  stripe
Parabol
Free online agile retrospective meeting tool
Stars: ✭ 1,145 (-19.99%)
Mutual labels:  stripe

CreditCardForm

CI Status CocoaPods compatible Carthage compatible Swift 4.2 compatible Platform iOS License: MIT Donate

CreditCardForm is iOS framework that allows developers to create the UI which replicates an actual Credit Card.

Fixed typo use CreditCardForm instead CreditCardForum

Screenshots

Example

To run the example project, clone the repo, and run pod install from the Demo-* directory first.

Supported Cards

  • MasterCard
  • Visa
  • JCB
  • Diners
  • Discover
  • Amex
  • UnionPay

Requirements

  • Xcode 8
  • iOS 8.1+

Installation

Using CocoaPods

CreditCardForm is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "CreditCardForm"

Using Carthage

CreditCardForm is available through Carthage. To install it, simply add the following line to your Cartfile:

github "orazz/CreditCardForm-iOS"

Manually

If you prefer not to use either of the aforementioned dependency managers, you can integrate CreditCardForm into your project manually.

  1. Download and drop CreditCardForm in your project.
  2. Done!

Usage example

First step: this framework integrated with Stripe, you must install Stripe

Storyboard

Create a view set a class CreditCardFormView (preferred frame size: 300x200).
Following this you will have to go through a few simple steps outlined below in order to get everything up and running.

import Stripe
import CreditCardForm

Swift

@IBOutlet weak var creditCardForm: CreditCardFormView!

// Stripe textField
let paymentTextField = STPPaymentCardTextField()

Add the following code in the viewDidLoad function in your view controller

// Set up stripe textfield
paymentTextField.frame = CGRect(x: 15, y: 199, width: self.view.frame.size.width - 30, height: 44)
paymentTextField.translatesAutoresizingMaskIntoConstraints = false
paymentTextField.borderWidth = 0

let border = CALayer()
let width = CGFloat(1.0)
border.borderColor = UIColor.darkGray.cgColor
border.frame = CGRect(x: 0, y: paymentTextField.frame.size.height - width, width:  paymentTextField.frame.size.width, height: paymentTextField.frame.size.height)
border.borderWidth = width
paymentTextField.layer.addSublayer(border)
paymentTextField.layer.masksToBounds = true

view.addSubview(paymentTextField)

NSLayoutConstraint.activate([
paymentTextField.topAnchor.constraint(equalTo: creditCardForm.bottomAnchor, constant: 20),
paymentTextField.centerXAnchor.constraint(equalTo: view.centerXAnchor),
paymentTextField.widthAnchor.constraint(equalToConstant: self.view.frame.size.width-20),
paymentTextField.heightAnchor.constraint(equalToConstant: 44)
])

Delegate Methods

In order to use the delegate methods first set the delegate of Stripe to the parent view controller when setting it up

paymentTextField.delegate = self

After that you will be able to set up the following delegate methods inside of your parent view controller

func paymentCardTextFieldDidChange(_ textField: STPPaymentCardTextField) {
creditCardForm.paymentCardTextFieldDidChange(cardNumber: textField.cardNumber, expirationYear: textField.expirationYear, expirationMonth: textField.expirationMonth, cvc: textField.cvc)
}

func paymentCardTextFieldDidEndEditingExpiration(_ textField: STPPaymentCardTextField) {
creditCardForm.paymentCardTextFieldDidEndEditingExpiration(expirationYear: textField.expirationYear)
}

func paymentCardTextFieldDidBeginEditingCVC(_ textField: STPPaymentCardTextField) {
creditCardForm.paymentCardTextFieldDidBeginEditingCVC()
}

func paymentCardTextFieldDidEndEditingCVC(_ textField: STPPaymentCardTextField) {
creditCardForm.paymentCardTextFieldDidEndEditingCVC()
}

You should now be ready to use CreditCardForm!!

Customization

1) Colors

creditCardForm.backgroundColor (UIColor)
creditCardForm.cardHolderExpireDateColor (UIColor)
creditCardForm.cardHolderExpireDateTextColor (UIColor)
creditCardForm.backLineColor (UIColor)

// Brands Color brand name, front color, back color
[String: [UIColor]]

creditCardForm.cardGradientColors[Brands.Visa.rawValue] = [UIColor.blue, UIColor.red]

// Set font
creditCardForm.cardNumberFont = UIFont(name: "FontName", size: 20)!
creditCardForm.cardPlaceholdersFont = UIFont(name: "FontName", size: 10)!
creditCardForm.cardTextFont = UIFont(name: "FontName", size: 12)!

2) Images

creditCardForm.chipImage (UIImage)

3) Placeholders

creditCardForm.cardHolderString (String)
creditCardForm.expireDatePlaceholderText (String)

Card number: Configuring the Mask Field

creditCardForm.cardNumberMaskExpression (String)
creditCardForm.cardNumberMaskTemplate (String)

creditCardForm.cardNumberFontSize (CGFloat)

Contribute

We would love for you to contribute to CreditCardForm, check the LICENSE file for more info.

Meta

Oraz Atakishiyev, orazz.com

3rd party libraries

CreditCardValidator
AKMaskField

License

CreditCardForm is available under the MIT license. See the LICENSE file for more info.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].