{"id":1785,"url":"https://github.com/orazz/CreditCardForm-iOS","last_synced_at":"2025-08-02T04:32:36.387Z","repository":{"id":56906808,"uuid":"73180483","full_name":"orazz/CreditCardForm-iOS","owner":"orazz","description":"CreditCardForm is iOS framework that allows developers to create the UI which replicates an actual Credit Card.","archived":false,"fork":false,"pushed_at":"2020-05-30T17:09:15.000Z","size":6848,"stargazers_count":1469,"open_issues_count":6,"forks_count":166,"subscribers_count":39,"default_branch":"master","last_synced_at":"2025-07-27T19:54:41.967Z","etag":null,"topics":["credit-card","creditcardform","ios-swift","stripe"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/orazz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-11-08T11:41:11.000Z","updated_at":"2025-07-19T17:11:58.000Z","dependencies_parsed_at":"2022-08-20T19:20:23.680Z","dependency_job_id":null,"html_url":"https://github.com/orazz/CreditCardForm-iOS","commit_stats":null,"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"purl":"pkg:github/orazz/CreditCardForm-iOS","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orazz%2FCreditCardForm-iOS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orazz%2FCreditCardForm-iOS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orazz%2FCreditCardForm-iOS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orazz%2FCreditCardForm-iOS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/orazz","download_url":"https://codeload.github.com/orazz/CreditCardForm-iOS/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orazz%2FCreditCardForm-iOS/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268334618,"owners_count":24233793,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-02T02:00:12.353Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["credit-card","creditcardform","ios-swift","stripe"],"created_at":"2024-01-05T20:15:55.760Z","updated_at":"2025-08-02T04:32:35.977Z","avatar_url":"https://github.com/orazz.png","language":"Swift","funding_links":["https://www.paypal.com/cgi-bin/webscr?cmd=_donations\u0026business=GSV5DLQRJ5AH2\u0026lc=US\u0026item_name=Oraz%20Atakishiyev\u0026item_number=PageMenu\u0026currency_code=USD\u0026bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted"],"categories":["Payments","TextField","Customized Views","Swift"],"sub_categories":["Other Parsing","Other free courses"],"readme":"# CreditCardForm\n\n[![CI Status](https://travis-ci.org/orazz/CreditCardForm-iOS.svg?branch=master)](https://travis-ci.org/orazz/CreditCardForm-iOS)\n\u003ca href=\"https://cocoapods.org/pods/CreditCardForm\"\u003e\u003cimg\nsrc=\"https://img.shields.io/badge/pod-0.2.0-blue.svg\" alt=\"CocoaPods compatible\" /\u003e\u003c/a\u003e\n[![Carthage compatible](https://img.shields.io/badge/Carthage-Compatible-brightgreen.svg?style=flat)](https://github.com/Carthage/Carthage)\n\u003ca href=\"https://developer.apple.com/swift\"\u003e\u003cimg src=\"https://img.shields.io/badge/swift4.2-compatible-4BC51D.svg?style=flat\" alt=\"Swift 4.2 compatible\" /\u003e\u003c/a\u003e\n\u003cimg src=\"https://img.shields.io/badge/platform-iOS-blue.svg?style=flat\" alt=\"Platform iOS\" /\u003e\n\u003ca href=\"https://github.com/orazz/CreditCardForm-iOS/blob/master/LICENSE\"\u003e\u003cimg src=\"http://img.shields.io/badge/license-MIT-blue.svg?style=flat\" alt=\"License: MIT\" /\u003e\u003c/a\u003e\n[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_donations\u0026business=GSV5DLQRJ5AH2\u0026lc=US\u0026item_name=Oraz%20Atakishiyev\u0026item_number=PageMenu\u0026currency_code=USD\u0026bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted)\n\nCreditCardForm is iOS framework that allows developers to create the UI which replicates an actual Credit Card.\n\n\u003cstrong style=\"color:red\"\u003eFixed typo use CreditCardForm instead ~~CreditCardForum~~\u003c/strong\u003e\n\n### Screenshots\n\u003cimg src=\"https://dotjpg.co/aOI6.png\" width=\"300\"\u003e \u003cimg src=\"Example/Screens/dark1.gif\" width=\"300\"\u003e\n\n## Example\n\nTo run the example project, clone the repo, and run `pod install` from the Demo-\\* directory first.\n\n## Supported Cards\n\n- [x] MasterCard\n- [x] Visa\n- [x] JCB\n- [x] Diners\n- [x] Discover\n- [x] Amex\n- [x] UnionPay\n\n## Requirements\n\n* Xcode 8\n* iOS 8.1+\n\n## Installation\n\n#### Using [CocoaPods](http://cocoapods.org)\n\nCreditCardForm is available through CocoaPods. To install it, simply add the following line to your `Podfile`:\n\n```ruby\npod \"CreditCardForm\"\n```\n\n#### Using [Carthage](https://github.com/Carthage/Carthage)\n\nCreditCardForm is available through Carthage. To install it, simply add the following line to your `Cartfile`:\n\n```ruby\ngithub \"orazz/CreditCardForm-iOS\"\n```\n\n#### Manually\n\nIf you prefer not to use either of the aforementioned dependency managers, you can integrate CreditCardForm into your project manually.\n\n1. Download and drop ```CreditCardForm``` in your project.  \n2. Done!  \n\n## Usage example\n\nFirst step: this framework integrated with Stripe, you must install [Stripe](https://stripe.com/docs/mobile/ios)\n\n#### Storyboard\nCreate a view set a class CreditCardFormView (preferred frame size: 300x200). \u003cbr/\u003e \nFollowing this you will have to go through a few simple steps outlined below in order to get everything up and running.\n``` swift\nimport Stripe\nimport CreditCardForm\n```\n#### Swift\n``` swift\n@IBOutlet weak var creditCardForm: CreditCardFormView!\n\n// Stripe textField\nlet paymentTextField = STPPaymentCardTextField()\n```\n\n#### Add the following code in the viewDidLoad function in your view controller\n\n```swift\n// Set up stripe textfield\npaymentTextField.frame = CGRect(x: 15, y: 199, width: self.view.frame.size.width - 30, height: 44)\npaymentTextField.translatesAutoresizingMaskIntoConstraints = false\npaymentTextField.borderWidth = 0\n\nlet border = CALayer()\nlet width = CGFloat(1.0)\nborder.borderColor = UIColor.darkGray.cgColor\nborder.frame = CGRect(x: 0, y: paymentTextField.frame.size.height - width, width:  paymentTextField.frame.size.width, height: paymentTextField.frame.size.height)\nborder.borderWidth = width\npaymentTextField.layer.addSublayer(border)\npaymentTextField.layer.masksToBounds = true\n\nview.addSubview(paymentTextField)\n\nNSLayoutConstraint.activate([\npaymentTextField.topAnchor.constraint(equalTo: creditCardForm.bottomAnchor, constant: 20),\npaymentTextField.centerXAnchor.constraint(equalTo: view.centerXAnchor),\npaymentTextField.widthAnchor.constraint(equalToConstant: self.view.frame.size.width-20),\npaymentTextField.heightAnchor.constraint(equalToConstant: 44)\n])\n```\n\n#### Delegate Methods\n\nIn order to use the delegate methods first set the delegate of Stripe to the parent view controller when setting it up\n\n``` swift\npaymentTextField.delegate = self\n```\n\nAfter that you will be able to set up the following delegate methods inside of your parent view controller\n\n``` swift\nfunc paymentCardTextFieldDidChange(_ textField: STPPaymentCardTextField) {\ncreditCardForm.paymentCardTextFieldDidChange(cardNumber: textField.cardNumber, expirationYear: textField.expirationYear, expirationMonth: textField.expirationMonth, cvc: textField.cvc)\n}\n\nfunc paymentCardTextFieldDidEndEditingExpiration(_ textField: STPPaymentCardTextField) {\ncreditCardForm.paymentCardTextFieldDidEndEditingExpiration(expirationYear: textField.expirationYear)\n}\n\nfunc paymentCardTextFieldDidBeginEditingCVC(_ textField: STPPaymentCardTextField) {\ncreditCardForm.paymentCardTextFieldDidBeginEditingCVC()\n}\n\nfunc paymentCardTextFieldDidEndEditingCVC(_ textField: STPPaymentCardTextField) {\ncreditCardForm.paymentCardTextFieldDidEndEditingCVC()\n}\n```\n\n**You should now be ready to use CreditCardForm!!**\n\n## Customization\n\n**1) Colors**\n``` swift\ncreditCardForm.backgroundColor (UIColor)\ncreditCardForm.cardHolderExpireDateColor (UIColor)\ncreditCardForm.cardHolderExpireDateTextColor (UIColor)\ncreditCardForm.backLineColor (UIColor)\n\n// Brands Color brand name, front color, back color\n[String: [UIColor]]\n\ncreditCardForm.cardGradientColors[Brands.Visa.rawValue] = [UIColor.blue, UIColor.red]\n\n// Set font\ncreditCardForm.cardNumberFont = UIFont(name: \"FontName\", size: 20)!\ncreditCardForm.cardPlaceholdersFont = UIFont(name: \"FontName\", size: 10)!\ncreditCardForm.cardTextFont = UIFont(name: \"FontName\", size: 12)!\n```\n**2) Images**\n``` swift\ncreditCardForm.chipImage (UIImage)\n```\n**3) Placeholders**\n``` swift\ncreditCardForm.cardHolderString (String)\ncreditCardForm.expireDatePlaceholderText (String)\n```\n**Card number: [Configuring the Mask Field](https://github.com/artemkrachulov/AKMaskField#configuring-the-mask-field)**\n``` swift\ncreditCardForm.cardNumberMaskExpression (String)\ncreditCardForm.cardNumberMaskTemplate (String)\n\ncreditCardForm.cardNumberFontSize (CGFloat)\n```    \n## Contribute\n\nWe would love for you to contribute to **CreditCardForm**, check the ``LICENSE`` file for more info.\n\n## Meta\n\n[Oraz Atakishiyev](https://github.com/orazz), [orazz.com](https://orazz.com)\n\n#### 3rd party libraries\n\n[CreditCardValidator](https://github.com/vitkuzmenko/CreditCardValidator) \u003cbr/\u003e\n[AKMaskField](https://github.com/artemkrachulov/AKMaskField)\n\n## License\n\nCreditCardForm is available under the MIT license. See the LICENSE file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Forazz%2FCreditCardForm-iOS","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Forazz%2FCreditCardForm-iOS","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Forazz%2FCreditCardForm-iOS/lists"}