Base solution for your next web application
Open Closed

Angular - BUG in compoment StripePaymentResultComponent #8682


User avatar
1
denis.karovic created

Hello,

There is an error with this component. If getting payment result is not succesfull after the first attempt and the method controlAgain() needs to be called, there is en error with loosing scope.

Wrong implementation:

  controlAgain() {
        if (this.maxControlCount === 0) {
          return;
        }

        setTimeout(this.getPaymentResult, this.controlTimeout);                         // this makes it looses scope
        this.controlTimeout *= 2;
        this.maxControlCount--;
  }
  

Appropriate Implementation:

controlAgain() {
        if (this.maxControlCount === 0) {
          return;
        }

        setTimeout( () => {
            this.getPaymentResult();
        }, this.controlTimeout);                                                                    // this way scope is perserved
        this.controlTimeout *= 2;
        this.maxControlCount--;
  }
Markdown is supported
Copy & paste or drag & drop images (max 30 MB per image)

2 Answer(s)
  • User Avatar
    1
    ismcagdas created
    Support Team

    Thanks a lot @denis.karovic,

    We will fix it. I have created an issue on https://github.com/aspnetzero/aspnet-zero-core/issues/3071

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)
  • User Avatar
    1
    musa.demir created

    Thanks @denis.karovic. Changes in the dev branch. 2c6ffcc

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)