{"action":"created","issue":{"url":"https://api.github.com/repos/code-corps/ember-stripe-elements/issues/26","repository_url":"https://api.github.com/repos/code-corps/ember-stripe-elements","labels_url":"https://api.github.com/repos/code-corps/ember-stripe-elements/issues/26/labels{/name}","comments_url":"https://api.github.com/repos/code-corps/ember-stripe-elements/issues/26/comments","events_url":"https://api.github.com/repos/code-corps/ember-stripe-elements/issues/26/events","html_url":"https://github.com/code-corps/ember-stripe-elements/pull/26","id":295116175,"number":26,"title":"[RFC] Allow the usage of separated stripe components to generate token","user":{"login":"sardyy","id":12813036,"avatar_url":"https://avatars0.githubusercontent.com/u/12813036?v=4","gravatar_id":"","url":"https://api.github.com/users/sardyy","html_url":"https://github.com/sardyy","followers_url":"https://api.github.com/users/sardyy/followers","following_url":"https://api.github.com/users/sardyy/following{/other_user}","gists_url":"https://api.github.com/users/sardyy/gists{/gist_id}","starred_url":"https://api.github.com/users/sardyy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sardyy/subscriptions","organizations_url":"https://api.github.com/users/sardyy/orgs","repos_url":"https://api.github.com/users/sardyy/repos","events_url":"https://api.github.com/users/sardyy/events{/privacy}","received_events_url":"https://api.github.com/users/sardyy/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-02-07T12:16:44Z","updated_at":"2018-02-13T17:15:11Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/code-corps/ember-stripe-elements/pulls/26","html_url":"https://github.com/code-corps/ember-stripe-elements/pull/26","diff_url":"https://github.com/code-corps/ember-stripe-elements/pull/26.diff","patch_url":"https://github.com/code-corps/ember-stripe-elements/pull/26.patch"},"body":"## Context\r\n\r\nI've started using this addon but my use case is a bit different from the example described. We wanted to use each of the stripe components (card number, expiry and CVV) separately and then create a token using one these ```stripe elements```. Although the Stripe's documentation says that ```The Element pulls data from other Elements you’ve created on the same instance of elements to tokenize```, it didn't work because it considered just the element I was passing.\r\n\r\nBut there was an important part of the phrase that made me think, ```...you’ve created on the same instance of elements...```. After taking a look at the code, I've realized that each component was being created using a new instance of elements by calling ```get(this, 'stripev3.elements')()``` and consequently, the Stripe.js wasn't able to pull all the data because each of stripe components belonged to a different group.\r\n\r\nThis fix allows us to inject an ```elements``` from our application to the component so all of the stripe elements are created using the same instance and therefore Stripe.js knows how to pull the card information from all of them. \r\n\r\nI hope it can help people with the same use case :)\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/code-corps/ember-stripe-elements/issues/comments/365336735","html_url":"https://github.com/code-corps/ember-stripe-elements/pull/26#issuecomment-365336735","issue_url":"https://api.github.com/repos/code-corps/ember-stripe-elements/issues/26","id":365336735,"user":{"login":"adamlc","id":809944,"avatar_url":"https://avatars1.githubusercontent.com/u/809944?v=4","gravatar_id":"","url":"https://api.github.com/users/adamlc","html_url":"https://github.com/adamlc","followers_url":"https://api.github.com/users/adamlc/followers","following_url":"https://api.github.com/users/adamlc/following{/other_user}","gists_url":"https://api.github.com/users/adamlc/gists{/gist_id}","starred_url":"https://api.github.com/users/adamlc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adamlc/subscriptions","organizations_url":"https://api.github.com/users/adamlc/orgs","repos_url":"https://api.github.com/users/adamlc/repos","events_url":"https://api.github.com/users/adamlc/events{/privacy}","received_events_url":"https://api.github.com/users/adamlc/received_events","type":"User","site_admin":false},"created_at":"2018-02-13T17:15:11Z","updated_at":"2018-02-13T17:15:11Z","author_association":"NONE","body":"On the same subject of using the same elements object it would also be nice to be able to pass [options](https://stripe.com/docs/stripe-js/reference#stripe-elements) to it too."}}
{"actor":{"display_login":"adamlc"}}