{"id":17419669,"url":"https://github.com/bendrucker/angularjs-stripe","last_synced_at":"2026-02-14T19:04:16.978Z","repository":{"id":17189171,"uuid":"19956716","full_name":"bendrucker/angularjs-stripe","owner":"bendrucker","description":"Angular Stripe.js service that returns promises for token calls","archived":false,"fork":false,"pushed_at":"2018-11-13T20:29:21.000Z","size":353,"stargazers_count":334,"open_issues_count":4,"forks_count":71,"subscribers_count":9,"default_branch":"master","last_synced_at":"2026-01-26T16:55:57.781Z","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":"2014-05-19T20:32:23.000Z","updated_at":"2025-12-01T16:27:01.000Z","dependencies_parsed_at":"2022-09-10T22:52:12.198Z","dependency_job_id":null,"html_url":"https://github.com/bendrucker/angularjs-stripe","commit_stats":null,"previous_names":["bendrucker/angular-stripe"],"tags_count":26,"template":false,"template_full_name":null,"purl":"pkg:github/bendrucker/angularjs-stripe","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bendrucker%2Fangularjs-stripe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bendrucker%2Fangularjs-stripe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bendrucker%2Fangularjs-stripe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bendrucker%2Fangularjs-stripe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bendrucker","download_url":"https://codeload.github.com/bendrucker/angularjs-stripe/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bendrucker%2Fangularjs-stripe/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29452616,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-14T15:52:44.973Z","status":"ssl_error","status_checked_at":"2026-02-14T15:52:11.208Z","response_time":53,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2024-10-17T02:29:06.735Z","updated_at":"2026-02-14T19:04:16.956Z","avatar_url":"https://github.com/bendrucker.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"angular-stripe [![Build Status](https://travis-ci.org/bendrucker/angular-stripe.svg?branch=master)](https://travis-ci.org/bendrucker/angular-stripe)\n==============\n\nAngular provider for easy interaction with [Stripe.js](https://stripe.com/docs/stripe.js). angular-stripe wraps Stripe.js's async operations in `$q` promises, making response handling easier and eliminating `$scope.$apply` calls and other repetitive boilerplate in your application. Check out [angular-credit-cards](https://github.com/bendrucker/angular-credit-cards) for validating your credit card forms.\n\n## Installing\n\n```sh\nnpm install --save angular-stripe\n```\n\n## Usage\n\nangular-stripe will load Stripe.js when it's first called. You don't need to directly [include Stripe.js via a `\u003cscript\u003e` tag](https://stripe.com/docs/stripe.js#including-stripejs).\n\n```js\n// node module exports the string 'angular-stripe' for convenience\nangular.module('myApp', [\n  require('angular-stripe')\n])\n\n// otherwise, include the code first then the module name\nangular.module('myApp', [\n  'angular-stripe'\n])\n```\n\n## API\n\n### `stripeProvider`\n\nangular-stripe exposes `stripeProvider` for configuring Stripe.js.\n\n##### `stripeProvider.url`\n\nThe URL that will be used to fetch the Stripe.js library.\n\n##### `stripeProvider.setPublishableKey(key)` -\u003e `undefined`\n\nSets your Stripe [publishable key](https://stripe.com/docs/stripe.js#setting-publishable-key). \n\n```js\nangular\n  .module('myApp', [\n    'angular-stripe'\n  ])\n  .config(function (stripeProvider) {\n    stripeProvider.setPublishableKey('my_key')\n  })\n```\n\n\u003chr\u003e\n\n### `stripe`\n\nInject `stripe` into your services or controllers to access the API methods. `createToken` returns a `$q` promise. If Stripe responds with an error, the promise will be rejected. \n\n---\n\n##### `stripe.setPublishableKey(key)` -\u003e `undefined`\n\nSame as [`stripeProvider.setPublishableKey`](#stripeprovidersetpublishablekeykey---undefined)\n\n---\n\n### `stripe.card`\n\n##### `stripe.card.createToken(card [, params])` -\u003e `promise`\n \nTokenizes a card using [`Stripe.card.createToken`](https://stripe.com/docs/stripe.js#card-createToken). You can optionally pass a `key` property under `params` to use a different publishable key than the default to create that token. This is especially useful for applications using [Stripe Connect](https://stripe.com/connect).\n\nThe following utility methods are also exposed:\n\n* [`validateCardNumber`](https://stripe.com/docs/stripe.js#card-validateCardNumber)\n* [`validateExpiry`](https://stripe.com/docs/stripe.js#card-validateExpiry)\n* [`validateCVC`](https://stripe.com/docs/stripe.js#card-validateCVC)\n* [`cardType`](https://stripe.com/docs/stripe.js#card-cardType)\n\n---\n\n#### `stripe.bankAccount`\n \n##### `stripe.bankAccount.createToken(bankAccount [, params])` -\u003e `promise`\n\nTokenizes a card using [`Stripe.bankAccount.createToken`](https://stripe.com/docs/stripe.js#bank-account-createToken).\n\nThe following utility methods are also exposed:\n\n* [`validateRoutingNumber`](https://stripe.com/docs/stripe.js#bank-account-validateRoutingNumber)\n* [`validateAccountNumber`](https://stripe.com/docs/stripe.js#bank-account-validateAccountNumber)\n\n---\n\n#### `stripe.bitcoinReceiver`\n\n##### `stripe.bitcoinReceiver.createReceiver` -\u003e `promise`\n\nCreates a bitcoin receiver using [`Stripe.bitcoinReceiver.createReceiver`](https://stripe.com/docs/stripe.js#bitcoinreceiver-createreceiver).\n\n##### `stripe.bitcoinReceiver.pollReceiver` -\u003e `promise`\n\nPolls a bitcoin receiver using [`Stripe.bitcoinReceiver.pollReceiver`](https://stripe.com/docs/stripe.js#bitcoinreceiver-pollreceiver). Note that you'll need to implement [additional logic if you need to cancel receivers](https://github.com/bendrucker/stripe-as-promised#bitcoin).\n\nThe following utility methods are also exposed:\n\n* [`cancelReceiverPoll`](https://stripe.com/docs/stripe.js#bitcoinreceiver-cancelreceiverpoll)\n\n---\n\n## Examples\n\n#### Charging a card\n\n```js\napp.controller('PaymentController', function ($scope, $http, stripe) {\n  $scope.charge = function charge () {\n    return stripe.card.createToken($scope.payment.card)\n      .then(function (response) {\n        console.log('token created for card ending in ', response.card.last4)\n        var payment = angular.copy($scope.payment)\n        payment.card = undefined\n        payment.token = response.id\n        return $http.post('https://yourserver.com/payments', payment)\n      })\n      .then(function (payment) {\n        console.log('successfully submitted payment for $', payment.amount)\n      })\n      .catch(function (err) {\n        if (err.type \u0026\u0026 /^Stripe/.test(err.type)) {\n          console.log('Stripe error: ', err.message)\n        }\n        else {\n          console.log('Other error occurred, possibly with your API', err.message)\n        }\n      })\n  }\n})\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbendrucker%2Fangularjs-stripe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbendrucker%2Fangularjs-stripe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbendrucker%2Fangularjs-stripe/lists"}