-
Notifications
You must be signed in to change notification settings - Fork 5
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
Update PaymentProvider.swift #83
base: dev
Are you sure you want to change the base?
Conversation
sk1 purchase failed, but return success
update change log
@@ -125,12 +125,20 @@ extension PaymentProvider: SKPaymentTransactionObserver { | |||
forKey: transaction.payment.productIdentifier | |||
), !handlers.isEmpty { | |||
self.dispatchQueueFactory.main().async { | |||
handlers.forEach { $0(queue, .success(transaction)) } | |||
if let error = transaction.error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is only true if the transaction state is set to .failed
. A user can manually check the error
and transactionState
properties of PaymentTransaction
, which should have these values.
I'm not sure we need to throw an error here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sometimes it is necessary to collect error information to improve the payment experience.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zy19890102, why can't you collect the error information using PaymentTransaction
? Could you please provide a minimal example where these changes are necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When users cancel payments, we will ask them for the reason behind the cancellation, whether it is due to the pricing of the product being too high or the subscription service not meeting their needs, in order to adjust our pricing strategy and subscription benefits.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zy19890102 I see, thank you. But I don't get why you can't use the error
property from the transaction.
There is a merge conflict. Please rebase, and could you also run the make fmt command in your terminal to format the codebase according to the project’s code style?
sk1 purchase failed, but return success