{"id":17419750,"url":"https://github.com/bendrucker/virtual-credit-cards","last_synced_at":"2025-04-15T00:02:05.032Z","repository":{"id":43111161,"uuid":"61149625","full_name":"bendrucker/virtual-credit-cards","owner":"bendrucker","description":"Credit card form components built with virtual-dom","archived":false,"fork":false,"pushed_at":"2022-03-17T22:56:11.000Z","size":43,"stargazers_count":5,"open_issues_count":2,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-10T08:14:08.793Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/bendrucker.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-06-14T19:20:29.000Z","updated_at":"2022-12-29T10:20:11.000Z","dependencies_parsed_at":"2022-09-06T15:51:53.986Z","dependency_job_id":null,"html_url":"https://github.com/bendrucker/virtual-credit-cards","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bendrucker%2Fvirtual-credit-cards","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bendrucker%2Fvirtual-credit-cards/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bendrucker%2Fvirtual-credit-cards/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bendrucker%2Fvirtual-credit-cards/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bendrucker","download_url":"https://codeload.github.com/bendrucker/virtual-credit-cards/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248981263,"owners_count":21193145,"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","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":[],"created_at":"2024-10-17T02:31:51.058Z","updated_at":"2025-04-15T00:02:05.007Z","avatar_url":"https://github.com/bendrucker.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# virtual-credit-cards [![Build Status](https://travis-ci.org/bendrucker/virtual-credit-cards.svg?branch=master)](https://travis-ci.org/bendrucker/virtual-credit-cards) [![Greenkeeper badge](https://badges.greenkeeper.io/bendrucker/virtual-credit-cards.svg)](https://greenkeeper.io/)\n\n\u003e Credit card form components built with virtual-dom\n\n\n## Install\n\n```\n$ npm install --save virtual-credit-cards\n```\n\n## Demo\n\n```sh\n$ npm run example\n```\n\nAn example form (*example.js*) will open up in your default browser with all three components connected.\n\n## Usage\n\nvirtual-credit-cards comes with inputs for:\n\n* Card numbers\n* Expiration (MM/YY)\n* CVC\n\n```js\nvar NumberInput = require('virtual-credit-cards/number')\n\nvar state = NumberInput()\nNumberInput.render(state())\n//=\u003e VTree\n```\n\n## Components\n\n### Number\n\n#### `NumberInput()` -\u003e `function`\n\nReturns the observable number input state. `state.value` is an observable representation of the parsed card number.\n\n#### `NumberInput.render(state, [options])` -\u003e `object`\n\nRenders a state object into a virtual DOM tree. \n\n#### `NumberInput.validate(state, [types])` -\u003e `boolean`\n\nValidates the current card number state.\n\n##### types\n\nType: `array`  \nDefault: `[]`\n\nAn array of [allowed card types](https://github.com/bendrucker/creditcards-types#card-types). If no value is provided, a valid card of any type will be valid.\n \n### Expiration\n\n#### `ExpirationInput()` -\u003e `function`\n\nReturns the observable number input state. `state.value` is an observable representation of the parsed expiration. It will either be `null` or `{month: Number, year: Number}`, depending on whether the input is complete.\n\n#### `ExpirationInput.render(state, [options])` -\u003e `object`\n\nRenders a state object into a virtual DOM tree. \n\n#### `ExpirationInput.validate(state)` -\u003e `boolean`\n\nValidates the expiration state.\n\n### CVC\n\n#### `CvcInput()` -\u003e `function`\n\nReturns the observable number input state. `state.value` is an observable representation of the parsed CVC.\n\n#### `CvcInput.render(state, [options])` -\u003e `object`\n\nRenders a state object into a virtual DOM tree. \n\n#### `CvcInput.validate(state, [type])` -\u003e `boolean`\n\nValidates the CVC state. \n\n##### type\n\nType: `string`  \nDefault: `null`\n\nIf a [card type](https://github.com/bendrucker/creditcards-types#card-types) is provided, the validator will check that the provided CVC is valid for that card type.\n\n\n## License\n\nMIT © [Ben Drucker](http://bendrucker.me)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbendrucker%2Fvirtual-credit-cards","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbendrucker%2Fvirtual-credit-cards","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbendrucker%2Fvirtual-credit-cards/lists"}