Closed dottodot closed 5 years ago
Maybe it's out of context?:
this.prButton = this.elements.create('paymentRequestButton', {
paymentRequest: this.paymentRequest.bind(this)
});
Or:
const self = this;
this.prButton = this.elements.create('paymentRequestButton', {
paymentRequest: self.paymentRequest
});
bind give an error of
this.paymentRequest.bind is not a function
and the self approach just give the same result as originally posted and as I'm already attached it to a component property it's pretty must the same thing.
Also the current version used with rxjs-compat only has an issue, doesn't throw any errors but doesn't show a button either.
Hmm, not sure then.
PS: You could always try the branch on my fork: https://github.com/SamuelMarks/ngx-stripe/tree/ng6
OK took a while and after copying the code I was able to work out how to make it work.
Previously I was able to do the following
this.paymentRequest = this.stripeService.paymentRequest({});
this.prButton = this.elements.create('paymentRequestButton', {
paymentRequest: this.paymentRequest
});
but now you need to subscribe to this.stripeService.paymentRequest
and the pass in the the response i.e
this.stripeService.paymentRequest({}).subscribe(paymentRequest => {
this.paymentRequest = paymentRequest;
this.prButton = this.elements.create('paymentRequestButton', {
paymentRequest: this.paymentRequest
});
})
Looks at the Network, many make their own Angular 6 compatible forks: https://github.com/richnologies/ngx-stripe/network
See also, rxjs' official branch: https://github.com/richnologies/ngx-stripe/tree/6.x
This branch works fine just need the docs updating for paymentRequest
as it works slightly different to the previous version as per my comment above
Thanks, I will update the docs
Just given the rxjs6 version a try but the paymentRequestButton doesn't seem to work now
gives an error of