GithubHelp home page GithubHelp logo

yassram / yrpayment Goto Github PK

View Code? Open in Web Editor NEW
182.0 9.0 17.0 15.99 MB

Better payment user experience library with cool animation in Swift

License: MIT License

Objective-C 1.45% Swift 90.73% Ruby 7.82%
swift payment ui animation credit-card

yrpayment's Introduction

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.

yrpayment's People

Contributors

yassram avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

yrpayment's Issues

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

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.