diff --git a/README.md b/README.md index 6c63216..0c556d7 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ ## Install # See https://facebook.github.io/react-native/docs/getting-started.html#content yarn + pod install # ios only # Environment settings cp env-example .env diff --git a/env-example b/env-example index 4b08559..af40e08 100644 --- a/env-example +++ b/env-example @@ -2,4 +2,5 @@ EVENT_API_URL=https://studentersamfundet.no DUSKEN_API_URL=https://galtinn.neuf.no DUSKEN_PURCHASE_URL=https://galtinn.neuf.no/?utm_source=purchase-button&utm_medium=app DUSKEN_FORGOT_PASSWORD_URL=https://galtinn.neuf.no/auth/password_reset/ -SENTRY_DSN= \ No newline at end of file +SENTRY_DSN= +STRIPE_PUBLISHABLE_KEY= \ No newline at end of file diff --git a/package.json b/package.json index 73b2550..6255e02 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,8 @@ "redux": "^3.7.2", "redux-logger": "^3.0.6", "redux-persist": "^4.9.1", - "redux-thunk": "^2.2.0" + "redux-thunk": "^2.2.0", + "tipsi-stripe": "^3.7.0" }, "devDependencies": { "babel-jest": "20.0.3", diff --git a/src/modules/membership/Charge.js b/src/modules/membership/Charge.js new file mode 100644 index 0000000..df8cf07 --- /dev/null +++ b/src/modules/membership/Charge.js @@ -0,0 +1,15 @@ +import stripe from 'tipsi-stripe' +import Config from 'react-native-config'; + +stripe.init({ + publishableKey: Config.STRIPE_PUBLISHABLE_KEY, +}); + +class Charge { + openStripe() { + stripe.createTokenWithCard().then((data) => { + // returns a token.tokenId which should be saved + + }) + } +} \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index a973df5..509d8eb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4432,6 +4432,12 @@ time-stamp@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/time-stamp/-/time-stamp-1.0.1.tgz#9f4bd23559c9365966f3302dbba2b07c6b99b151" +tipsi-stripe@^3.7.0: + version "3.7.0" + resolved "https://registry.yarnpkg.com/tipsi-stripe/-/tipsi-stripe-3.7.0.tgz#9812ea9ffb9f1b8d08d3e86600195967021496ca" + dependencies: + prop-types "^15.5.10" + tmp@^0.0.31: version "0.0.31" resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.31.tgz#8f38ab9438e17315e5dbd8b3657e8bfb277ae4a7"