Better payment user experience library with cool animation in Swift

Overview

Twitter Follow Carthage Carthage

๐ŸŽฌ Preview

๐ŸŒŸ Features

  • Easily usable
  • Simple Swift syntax
  • Cool flip animation
  • Compatible with Carthage
  • Compatible with CocoaPods
  • Customizable
  • Universal (iPhone & iPad)
  • Lightweight readable codebase
  • And More...

๐Ÿ“ฒ Installation

Using CocoaPods

Edit your Podfile and specify the dependency:

pod "YRPayment"

Using Carthage

Edit your Cartfile and specify the dependency:

github "yassram/YRPayment"

๐Ÿ’ How to use

In 4 steps:

1. Import YRPayment.

import YRPayment

2. Create a YRPaymentCreditCard instance and link it to a YRPayement instances:

let card = YRPaymentCreditCard()
let payment = YRPayment(creditCard: card)

3. Add your card to a view and set its position:

view.addSubview(card)
card.centerXAnchor.constraint(equalTo: view.centerXAnchor).isActive = true
card.centerYAnchor.constraint(equalTo: view.centerYAnchor).isActive = true

4. link your textFields to the payment object:

payment.numberTextField = NumberTF
payment.holderNameTextField = NameTF
payment.validityTextField = ValidityTF
payment.cryptogramTextField = cryptoTF

(Assuming that NumberTF, NameTF, ValidityTF, cryptoTF are textField alrready created)

5. Enjoooooooy !

๐Ÿ” Extracting data from the credit card

To extract data from the credit card :

  1. Credit card number :
payment.getCardNumber()
  1. Credit card holder name :
payment.getCardHolderName()
  1. Credit card validity :
payment.getCardValidity()
  1. Credit card cryptogram
payment.getCardCryptogram()

๐ŸŽจ Customization : (more features are coming soon)

๐Ÿ’ณ Customizing the credit card type (Symbole):

When creating your creditCard instance (as seen before ๐Ÿ‘† ) MasterCard is default:

let card = YRPaymentCreditCard()

you can specify the symbole you want from the available types:

let card = YRPaymentCreditCard(type: .masterCard)

or specify a custom one by uploading your own image symbole:

let image = UIImage(named: "mySymboleImage")!
let card = YRPaymentCreditCard(type: .custom(image))

More types are coming soon

๐Ÿ•น Enable/Disable flip on user tap:

// Enable
payment.flipOnClick = true

// Disable
payment.flipOnClick = false

๐Ÿ™ Contributing

This is an open source project, so feel free to contribute. How?

  • Open an issue.
  • Send feedback via email.
  • Propose your own fixes, suggestions and open a pull request with the changes.

๐Ÿ“ข Mentions

Did you mention YRPayment in your website, do you use it in your app ? send me a message to be added in this section!


๐Ÿ’ป Author

  • Yassir Ramdani

๐Ÿ“ License

MIT License

Copyright (c) 2019 yassir RAMDANI

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

You might also like...
Welcome Busines Card Built With Swift
Welcome Busines Card Built With Swift

BusinessCard Welcome Busines Card Main screen Contacts screen More info screen

A card viewer demo for Idolmaster Millionlive Theater Days written in Swift UI
A card viewer demo for Idolmaster Millionlive Theater Days written in Swift UI

Misaki Gallery A Millionlive's cards gallery to demostrate Swift UI. All api and

A credit card scanner for iOS written in Swift
A credit card scanner for iOS written in Swift

DGCardScanner A credit card scanner Requirements iOS 13.0+ Swift 5.5+ Xcode 10.0+ Installation SPM File Add Packages https://github.com/donggyushi

A Swift script to create a list of links to release notes for package updates.

spi-release-notes release-notes is a Swift script that creates a list of links to release notes for package updates. Running release-notes performs a

Wizards-pal - Life counter for card games,built with swift
Wizards-pal - Life counter for card games,built with swift

Life counter for card games Made this app in the weekend to help ma boys with ht

Swift implementation of KERI (Key Event Receipt Infrastructure)

keri-swift Swift implementation of KERI (Key Event Receipt Infrastructure) Introduction keri-swift is an open source go implementation of the Key Even

BarcodeScanner is a simple and beautiful wrapper around the camera with barcode capturing functionality and a great user experience.
BarcodeScanner is a simple and beautiful wrapper around the camera with barcode capturing functionality and a great user experience.

Description BarcodeScanner is a simple and beautiful wrapper around the camera with barcode capturing functionality and a great user experience. Barco

Letters animation allows you to click on different letters and accordingly it will animate letters in a cool way. It has a very attractive UI and is very easy to use.
Letters animation allows you to click on different letters and accordingly it will animate letters in a cool way. It has a very attractive UI and is very easy to use.

Letters Animation Cool Letters Animation in iOS written in Swift. Preview Table of content :- Description How to add in your project Requirement Licen

Numbers animation allows you to click on different numbers and accordingly it will animate numbers in a cool way. It has a very attractive UI and is very easy to use.
Numbers animation allows you to click on different numbers and accordingly it will animate numbers in a cool way. It has a very attractive UI and is very easy to use.

Numbers Animation Cool Numbers Animation in iOS written in Swift. Preview Table of content :- Description How to add in your project Requirement Licen

Reading animation allows you to click on the different page numbers and accordingly it will animate page changes in a cool way. It has a very attractive UI and is very easy to use.
Reading animation allows you to click on the different page numbers and accordingly it will animate page changes in a cool way. It has a very attractive UI and is very easy to use.

Reading Animation Cool Reading Animation in iOS written in Swift. Preview Table of content :- Description How to add in your project Requirement Licen

Quiz Game with some cool animation

OhMyQuizApp This repo contains Quiz App project with some cool animation. Please do give me a โญ๏ธ on project if you like my work. This will be encourag

Unified API Library for: Cloud Storage, Social Log-In, Social Interaction, Payment, Email, SMS, POIs, Video & Messaging.
Unified API Library for: Cloud Storage, Social Log-In, Social Interaction, Payment, Email, SMS, POIs, Video & Messaging.

Unified API Library for: Cloud Storage, Social Log-In, Social Interaction, Payment, Email, SMS, POIs, Video & Messaging. Included services are Dropbox, Google Drive, OneDrive, OneDrive for Business, Box, Egnyte, PayPal, Stripe, Google Places, Foursquare, Yelp, YouTube, Vimeo, Twitch, Facebook Messenger, Telegram, Line, Viber, Facebook, GitHub, Google+, LinkedIn, Slack, Twitter, Windows Live, Yahoo, Mailjet, Sendgrid, Twilio, Nexmo, Twizo.

Tinder/Bumble like user image with user details scroll animation
Tinder/Bumble like user image with user details scroll animation

TinderUserProfile Tinder/Bumble like user image with user details scroll animation Add ProfileView.m,ProfileView.h class to your project. Set the clas

A fitness application using swift which can help user to hold a better sleep
A fitness application using swift which can help user to hold a better sleep

Natcap - Good for your sleep This is a fitness application which can help user to hold a better sleep which depends on their previous sleeping habit.

SuggestionsBox helps you build better a product trough your user suggestions. Written in Swift. ๐Ÿ—ณ
SuggestionsBox helps you build better a product trough your user suggestions. Written in Swift. ๐Ÿ—ณ

SuggestionsBox An iOS library to aggregate users feedback about suggestions, features or comments in order to help you build a better product. Swift V

Checkout API Client, Payment Form UI and Utilities in Swift
Checkout API Client, Payment Form UI and Utilities in Swift

Frames iOS Requirements iOS 10.0+ Xcode 12.4+ Swift 5.3+ Documentation Further information on using the Frames SDK is available in the integration gui

Steppe Payment Built With Swift

SteppePayment Example To run the example project, clone the repo, and run pod install from the Example directory first. Requirements Installation Step

This repo contains swift collection of gui, games, menu, animations, music, payment, etc... for iOS, macOS, watchOS and tvOS
This repo contains swift collection of gui, games, menu, animations, music, payment, etc... for iOS, macOS, watchOS and tvOS

Swift-Collections About: This repo contains a collection of projects built using swift and objective-c Contains projects for macOS iOS iPad watchOS tv

A Payment Card UI & Validator for iOS
A Payment Card UI & Validator for iOS

Description Caishen provides an easy-to-use text field to ask users for payment card information and to validate the input. It serves a similar purpos

Comments
  • How to change brand image later on?

    How to change brand image later on?

    @yassram Great library, had a issue I was hoping you could help me with.

    After the card has been displayed on the screen, how can I change its brand icon image to something else.

    I have tried doing the following: self.creditCard.cardType = .custom(UIImage(named: "Custom")

    self.creditCard = YRPaymentCreditCard(type: .custom(image))

    Do I need to redraw the card completely in order to change the brand image?

    opened by hamzabinamin 1
  • Dont install with carthage

    Dont install with carthage

    I get an error when I use carthage for install. the error is: Dependency "YRPayment" has no shared framework schemes for any of the platforms: iOS

    opened by meliksahk 0
Owner
yassir RAMDANI
๐Ÿ“ฑiOS Developer | ๐Ÿ“ŠData scientist | ๐Ÿงฎ GPU enthusiast | ๐ŸŽ“Master's degree in cs majoring in data science and AI (2021).
yassir RAMDANI
A Payment Card UI & Validator for iOS

Description Caishen provides an easy-to-use text field to ask users for payment card information and to validate the input. It serves a similar purpos

Prolific Interactive 766 Dec 28, 2022
Payment Portal Interaction

PaymentInteraction Payment Portal Interaction This Interaction was built keeping in mind Usability,Clean UI,Natural Response. Libraries Used Hero-iOS

Utkarsh Dixit 1 Oct 1, 2021
With SwiftUI payment share app

Splitpayment With SwiftUI payment share app.

Ahmet Onur ลžahin 3 Apr 18, 2022
TPInAppReceipt is a lightweight, pure-Swift library for reading and validating Apple In App Purchase Receipt locally.

TPInAppReceipt is a lightweight, pure-Swift library for reading and validating Apple In App Purchase Receipt locally. Features Read all

Pavel T 520 Jan 4, 2023
Easy to use iOS library with components for input of Credit Card data.

AnimatedCardInput This library allows you to drop into your project two easily customisable, animated components that will make input of Credit Card i

Netguru 39 Oct 16, 2022
A lightweight iOS library for In-App Purchases

#RMStore A lightweight iOS library for In-App Purchases. RMStore adds blocks and notifications to StoreKit, plus receipt verification, content downloa

Robot Media 2.4k Dec 19, 2022
Bank Card Generator with Swift using SnapKit DSL ๐Ÿ’ณ

iCard BankCard & CreditCard generator with Swift 3 using SnapKit DSL iCard is a simple tool for generate Credit & Bank Card , it represent cards as UI

Emrah Korkmaz 334 Nov 28, 2022
Easily integrate Credit Card payments module in iOS App. Swift 4.0

MFCard Buy me a coffee MFCard is an awesome looking Credit Card input & validation control. Written in Swift 3. YOoo, Now MFCard is on Swift 5. Swift

MobileFirst 362 Nov 29, 2022
Lightweight In App Purchases Swift framework for iOS 8.0+, tvOS 9.0+ and macOS 10.10+ โ›บ

SwiftyStoreKit is a lightweight In App Purchases framework for iOS, tvOS, watchOS, macOS, and Mac Catalyst. Features Super easy-to-use block-based API

Andrea Bizzotto 6.1k Jan 7, 2023
Debit/Credit card validation port of the Luhn Algorithm in Swift

SwiftLuhn Warning! This repository is no longer maintained. This is a port of the Luhn Algorithm, generally used for validating debit/credit card deta

Max Kramer 135 Sep 9, 2022