Git Product home page Git Product logo

angular-firebase-stripe's Issues

No such token

Hi - I followed the stripe course using this repo, and auth works fine, and a Stripe customer ID gets saved to Firebase, but when I try to make a payment, I get an error in Stripe that says 'No such token: src_1DcLikBF7AptWZlc1RM6UqBd'

Does anyone have some guidance how I can fix this?

Thanks in advance.

The pipe 'stripe' could not be found

@codediodeio Hi Jeff, I'm getting the following error. My hunch is it has to do with this line in payment.service:
return this.http.get<StripeObject>(url).map((res: any) => res.data);

ERROR Error: Uncaught (in promise): Error: Template parse errors:
The pipe 'stripe' could not be found ("" class="button is-info" [disabled]="!formComplete || loading" [class.is-loading]="loading">

Pa[ERROR ->]y {{ totalAmount | stripe | currency }}
"): ng:///PaymentPageModule/PaymentFormComponent.html@23:6 The pipe 'stripe' could not be found ("lt?.id" class="notification is-success"> {{ result.id }} has a status of {{ result.status }} for[ERROR ->] {{ result.amount | stripe | currency }}

"): ng:///PaymentPageModule/PaymentFormComponent.html@28:59
Error: Template parse errors:
The pipe 'stripe' could not be found ("" class="button is-info" [disabled]="!formComplete || loading" [class.is-loading]="loading">

Pa[ERROR ->]y {{ totalAmount | stripe | currency }}
"): ng:///PaymentPageModule/PaymentFormComponent.html@23:6 The pipe 'stripe' could not be found ("lt?.id" class="notification is-success"> {{ result.id }} has a status of {{ result.status }} for[ERROR ->] {{ result.amount | stripe | currency }}

"): ng:///PaymentPageModule/PaymentFormComponent.html@28:59
at syntaxError (compiler.js:2430)
at TemplateParser.push../node_modules/@angular/compiler/fesm5/compiler.js.TemplateParser.parse (compiler.js:20604)
at JitCompiler.push../node_modules/@angular/compiler/fesm5/compiler.js.JitCompiler._parseTemplate (compiler.js:26167)
at JitCompiler.push../node_modules/@angular/compiler/fesm5/compiler.js.JitCompiler._compileTemplate (compiler.js:26154)
at compiler.js:26097
at Set.forEach ()
at JitCompiler.push../node_modules/@angular/compiler/fesm5/compiler.js.JitCompiler._compileComponents (compiler.js:26097)
at compiler.js:26007
at Object.then (compiler.js:2421)
at JitCompiler.push../node_modules/@angular/compiler/fesm5/compiler.js.JitCompiler._compileModuleAndComponents (compiler.js:26006)
at resolvePromise (zone.js:831)
at resolvePromise (zone.js:788)
at zone.js:892
at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:423)
at Object.onInvokeTask (core.js:17289)
at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:422)
at Zone.push../node_modules/zone.js/dist/zone.js.Zone.runTask (zone.js:195)
at drainMicroTaskQueue (zone.js:601)

Error deploying function to firebase

While trying to deploy the functions to firebase I am getting this error

src/app/auth.ts(9,28): error TS2339: Property 'data' does not exist on type 'UserRecord'.

I am using the latest version of those libs so maybe something has changed

"firebase-admin": "^5.12.0",
"firebase-functions": "^1.0.1",
"request": "^2.83.0",
"request-promise": "^4.2.2",

vscode tells me that onCreateHandler of UserBuilder returns auth.UserRecord which I guess doesn't define data.

How can I fix this?

Cannot read property 'secret' of undefined

firebase deploy --only functions

=== Deploying to 'stripe-13ae7'...

i deploying functions
Running command: npm --prefix "$RESOURCE_DIR" run build

functions@ build /Users/cesar/Desktop/reviewing Angular/stripe/stripeDemo/functions
tslint -p tslint.json && ./node_modules/.bin/tsc

โœ” functions: Finished running predeploy script.
i functions: ensuring necessary APIs are enabled...
โœ” functions: all necessary APIs are enabled
i functions: preparing functions directory for uploading...

Error: Error occurred while parsing your function triggers.

TypeError: Cannot read property 'secret' of undefined
at Object. (/Users/cesar/Desktop/reviewing Angular/stripe/stripeDemo/functions/lib/app/config.js:36:46)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at Object. (/Users/cesar/Desktop/reviewing Angular/stripe/stripeDemo/functions/lib/index.js:3:1)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)

Does anyone know what's the problem here? I followed the video tutorial and it just doesn't work now. Can anyone give an advice?

Error: Error occurred while parsing your function triggers.

Error: Certificate object must contain a string "private_key" property.
    at FirebaseAppError.FirebaseError [as constructor] (/Users/dhoman/Source/stripeDemo/functions/node_modules/firebase-admin/lib/utils/error.js:39:28)
    at FirebaseAppError.PrefixedFirebaseError [as constructor] (/Users/dhoman/Source/stripeDemo/functions/node_modules/firebase-admin/lib/utils/error.js:85:28)
    at new FirebaseAppError (/Users/dhoman/Source/stripeDemo/functions/node_modules/firebase-admin/lib/utils/error.js:119:28)
    at new Certificate (/Users/dhoman/Source/stripeDemo/functions/node_modules/firebase-admin/lib/auth/credential.js:118:19)

I've tried both methods of
loading the credientials using

export const stripeSecret       = functions.config().stripe.secret;
export const stripePublishable  = functions.config().stripe.publishable;
export const stripeClientId     = functions.config().stripe.clientid; // only used for stripe connect

and

export const stripeSecret       = serviceAccount.stripe.secret;
export const stripePublishable  = serviceAccount.stripe.publishable;
export const stripeClientId     = serviceAccount.stripe.clientid; 

and neither seem to work, I get the same error.

I know the json file is fine because previously I was getting format errors for my json file and I resolved them.

I know the functions.config() is fine because I verified the values when running "firebase functions:config:get"

I thought it was an issue with the runtime that "firebase deploy --only functions" deploys node is 6 (can't specify the version although you can if you use gcloud cmd line instead), but I'm getting the same error when I try the "npm run serve" command

I'm at my wits end, I think it's an issue with the "Certificate object" being updated and one of the dependencies being a mismatch but idk what.

the package.json file in the functions folder is

  "dependencies": {
    "cors": "^2.8.4",
    "express": "^4.16.2",
    "firebase-admin": "^6.0.0",
    "firebase-functions": "^2.0.4",
    "request": "^2.83.0",
    "request-promise": "^4.2.2",
    "stripe": "^5.4.0"
  },

Error when deploying functions

errors on both Mac and PC when trying to deploy firebase functions.

newest tsc installed, with and without the firebase-functions upgrade with and without the firebase admin updates

when running firebase init the firebase.json file gets changed. I have run both versions of the json file but neither one can deploy the functions

changed firebase.json after running firebase init

in firebase.json:
using the %RESOURCE_DIR% trick results in the command hanging and not finishing
using the ./functions trick, the command did not complete.

`=== Deploying to 'angularfirebasedemoapp'...

i deploying functions
Running command: npm --prefix "$RESOURCE_DIR" run lint
npm ERR! missing script: lint

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/loganwalsh/.npm/_logs/2018-04-26T21_19_22_371Z-debug.log

Error: functions predeploy error: Command terminated with non-zero exit code1`

===================================================================
Deploying with the %RESOURCE_DIR% trick

=== Deploying to 'angularfirebasedemoapp'...

i deploying functions
Running command: npm --prefix %RESOURCE_DIR% run build

functions@ build E:_Companies-I-Own\aa\stripeDemo\functions
tslint -p tslint.json && ./node_modules/.bin/tsc

WARNING: E:/_Companies-I-Own/aa/stripeDemo/functions/src/app/api.ts[3, 13]: 'connect' is declared but its value is never read.
WARNING: E:/_Companies-I-Own/aa/stripeDemo/functions/src/app/auth.ts[2, 10]: 'stripe' is declared but its value is never read.
WARNING: E:/_Companies-I-Own/aa/stripeDemo/functions/src/app/auth.ts[2, 22]: 'stripeClientId' is declared but its value is never read.
WARNING: E:/_Companies-I-Own/aa/stripeDemo/functions/src/app/helpers.ts[74, 11]: 'card' is declared but its value is never read.
WARNING: E:/_Companies-I-Own/aa/stripeDemo/functions/src/app/helpers.ts[109, 11]: 'card' is declared but its value is never read.
WARNING: E:/_Companies-I-Own/aa/stripeDemo/functions/src/app/webhooks.ts[2, 1]: All imports are unused.

'.' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! functions@ build: tslint -p tslint.json && ./node_modules/.bin/tsc
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the functions@ build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Logan\AppData\Roaming\npm-cache_logs\2018-04-26T22_45_11_500Z-debug.log

Error: functions predeploy error: Command terminated with non-zero exit code1

===================================================================
Deploying with the ./functions trick

=== Deploying to 'angularfirebasedemoapp'...

i deploying functions
Running command: npm --prefix ./functions run build

functions@ build E:_Companies-I-Own\aa\stripeDemo\functions
tslint -p tslint.json && ./node_modules/.bin/tsc

WARNING: E:/_Companies-I-Own/aa/stripeDemo/functions/src/app/api.ts[3, 13]: 'connect' is declared but its value is never read.
WARNING: E:/_Companies-I-Own/aa/stripeDemo/functions/src/app/auth.ts[2, 10]: 'stripe' is declared but its value is never read.
WARNING: E:/_Companies-I-Own/aa/stripeDemo/functions/src/app/auth.ts[2, 22]: 'stripeClientId' is declared but its value is never read.
WARNING: E:/_Companies-I-Own/aa/stripeDemo/functions/src/app/helpers.ts[74, 11]: 'card' is declared but its value is never read.
WARNING: E:/_Companies-I-Own/aa/stripeDemo/functions/src/app/helpers.ts[109, 11]: 'card' is declared but its value is never read.
WARNING: E:/_Companies-I-Own/aa/stripeDemo/functions/src/app/webhooks.ts[2, 1]: All imports are unused.

'.' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! functions@ build: tslint -p tslint.json && ./node_modules/.bin/tsc
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the functions@ build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Logan\AppData\Roaming\npm-cache_logs\2018-04-26T22_49_06_547Z-debug.log

Error: functions predeploy error: Command terminated with non-zero exit code1
... 

==================================================================

==================================================================

original firebase.json copied from the github


E:_Companies-I-Own\aa\stripeDemo>firebase deploy --only functions

=== Deploying to 'angularfirebasedemoapp'...

i deploying functions
Running command: npm --prefix functions run build

functions@ build E:_Companies-I-Own\aa\stripeDemo\functions
tslint -p tslint.json && ./node_modules/.bin/tsc

WARNING: E:/_Companies-I-Own/aa/stripeDemo/functions/src/app/api.ts[3, 13]: 'connect' is declared but its value is never read.
WARNING: E:/_Companies-I-Own/aa/stripeDemo/functions/src/app/auth.ts[2, 10]: 'stripe' is declared but its value is never read.
WARNING: E:/_Companies-I-Own/aa/stripeDemo/functions/src/app/auth.ts[2, 22]: 'stripeClientId' is declared but its value is never read.
WARNING: E:/_Companies-I-Own/aa/stripeDemo/functions/src/app/helpers.ts[74, 11]: 'card' is declared but its value is never read.
WARNING: E:/_Companies-I-Own/aa/stripeDemo/functions/src/app/helpers.ts[109, 11]: 'card' is declared but its value is never read.
WARNING: E:/_Companies-I-Own/aa/stripeDemo/functions/src/app/webhooks.ts[2, 1]: All imports are unused.

'.' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! functions@ build: tslint -p tslint.json && ./node_modules/.bin/tsc
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the functions@ build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Logan\AppData\Roaming\npm-cache_logs\2018-04-27T20_58_21_890Z-debug.log

Error: functions predeploy error: Command terminated with non-zero exit code1

==================================================================

followed the instructions in Initial Setup video but cannot get past this part.

No matter what I've tried, I cannot get the firebase functions to deploy

npm install failed

node-pre-gyp ERR! Tried to download(403): https://storage.googleapis.com/grpc-precompiled-binaries/node/grpc/v1.10.1/node-v72-win32-x64-unknown.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (node-v72 ABI, unknown) (falling back to source compile with node-gyp)
node-pre-gyp ERR! Pre-built binaries not installable for [email protected] and [email protected] (node-v72 ABI, unknown) (falling back to source compile with node-gyp)
node-pre-gyp ERR! Hit error Connection closed while downloading tarball file

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.