richnologies / ngx-stripe

Angular 6+ wrapper for StripeJS
MIT License
219 stars 77 forks source link

No such payment_intent: 'src_client #107

Closed joepvandepol closed 4 years ago

joepvandepol commented 4 years ago

I've made a reply in my old topic. I'm not sure if closed topics are getting replies. That's why I made another topic.

okay so after a couple of hours I've got something together only I'm stuck I've googled my error code and it says that my API keys are somehow wrong/messed up I've double checked my API keys and there were all fine. Did I forget anything? From what I understand does confirmCardPayment created the payment and checks the payment also. I can see the response from my Stripe dashboard. From that, I can conclude that my API keys are right? Is this the right code for an payment for 1eur ?

Also according to my previous questions the answer was that I could use the function .create({}) but when I do this.stripeService.create({}) but then there's come an error message that the this.stripeService isn't familiar with the create function.

` this.stripeService.createSource(this.card.element, {
  amount: 100, // in cents
    type: 'card',
    currency: 'eur',
    owner: {
      name: 'name'
    },
  }).subscribe((result)=> {
    console.log("result",result);
    this.stripeService
    .confirmCardPayment(`${result.source?.client_secret}`, {
      payment_method: {
        card: this.card.element,
        billing_details: {
          name: 'name',
        },
      },
    }).subscribe((result => { 
      console.log(result);
    }))
  })`

My error code: error: code: "resource_missing" doc_url: "https://stripe.com/docs/error-codes/resource-missing" message: "No such payment_intent: 'src_client'" param: "intent" type: "invalid_request_error" proto: Object proto: Object

richnologies commented 4 years ago

Duplicate of https://github.com/richnologies/ngx-stripe/issues/106