Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixe IOS issues #141

Merged
merged 3 commits into from
Sep 14, 2022
Merged

Fixe IOS issues #141

merged 3 commits into from
Sep 14, 2022

Conversation

kefahB
Copy link
Contributor

@kefahB kefahB commented Sep 14, 2022

Hi @triniwiz,

I've fixed the issues #134 and #137 and partially the #135, this fixe reduce the number of call but not fixe it definitely

@triniwiz triniwiz merged commit 0090dcf into triniwiz:master Sep 14, 2022
@kefahB
Copy link
Contributor Author

kefahB commented Sep 14, 2022

@triniwiz thanks .. please don not forged to take care of #133 please

Copy link
Contributor

@justinkurtz justinkurtz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kefahB @triniwiz Having an issue with the changes to fix the payment result handler. I think there might be a mistake but I'm happy help.

.then((value) => {
completion(STPPaymentStatus.Success, null);
.then((value: any) => {
if(!value._native.lastPaymentError || value._native.lastPaymentError == "undefined") {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kefahB @triniwiz I'm having trouble with this change. Every payment fails with the error originating from this line:
Cannot read property 'lastPaymentError' of undefined

In my case, the variable "value" is the result of the promise returned from capturePayment defined in my own code. This is referring to a _native property which my promise doesn't return. Seems like this line of code is supposed to call something else internal to the Stripe pod to get the lastPaymentError?

@kefahB
Copy link
Contributor Author

kefahB commented Sep 29, 2022

Hi @justinkurtz

Strange! before those changes the payment always resolve true even if in the reality is not !

Can you share how do you proceed to capturePayment the payment please ? do you use standard or sheet implementation ?

@justinkurtz
Copy link
Contributor

I think I'm using the standard implementation. I've taken this example and modified it:
apps/demo/src/plugin-demos/nativescript-stripe-src/std-view/stripe.service.ts

I see now that the capturePayment method has been changed since I originally adapted it to my project. Previously (in the commented out code) it just made an HTTP post and returned that. Seems as though I need to adapt the new code in capturePayment from that example.

@justinkurtz
Copy link
Contributor

I wonder if we can add a null safe navigation operator to support use cases that don't immediately confirm payment intents or use 3DS. Changing this line to the below would give more flexibility and make it backwards compatible.

if(!value._native?.lastPaymentError || value._native?.lastPaymentError == "undefined") {

@kefahB
Copy link
Contributor Author

kefahB commented Sep 29, 2022

Effectively it is a good idea .. @triniwiz what do you think ?

@triniwiz
Copy link
Owner

Sounds good 👌

@justinkurtz
Copy link
Contributor

Thank you both! I'll create a pull request! ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants