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

因为交易冻结的状态处理不正确,导致代码报错 #4

Open
rockingdice opened this issue Aug 23, 2021 · 3 comments
Open

Comments

@rockingdice
Copy link

如题,我收到了来自paypal的邮件,提示如下:
image

服务器在执行

	payment, err := client.ExecuteApprovedPayment(req.PaymentID, req.PayerID)
	if err != nil {
		return errors.Wrap(err, "")
	}

时,err是错误:

2021/08/23 18:37:38 : json: cannot unmarshal string into Go struct field Sale.transactions.related_resources.sale.payment_hold_reasons of type paypal.PaymentHoldReason

我怀疑是这里出了问题:
image
所以临时将那几句话注释掉了,但是不清楚这样改会不会有别的问题。

因为这个问题会导致用户没办法在付费后正确得到货物,还请尽快解决,谢谢!

@rockingdice
Copy link
Author

如题,我收到了来自paypal的邮件,提示如下:
image

服务器在执行

	payment, err := client.ExecuteApprovedPayment(req.PaymentID, req.PayerID)
	if err != nil {
		return errors.Wrap(err, "")
	}

时,err是错误:

2021/08/23 18:37:38 : json: cannot unmarshal string into Go struct field Sale.transactions.related_resources.sale.payment_hold_reasons of type paypal.PaymentHoldReason

我怀疑是这里出了问题:
image
所以临时将那几句话注释掉了,但是不清楚这样改会不会有别的问题。

因为这个问题会导致用户没办法在付费后正确得到货物,还请尽快解决,谢谢!

顺便解释一下,用户最终还是会获得的,因为我也处理了webhook。但是因为这里报错,导致之后的逻辑没有处理,我也不能忽视其他的错误,所以只能先这么处理一下了。源代码这么处理我是没看懂为什么,所以还请作者尽快查看一下…!

@smartwalle
Copy link
Owner

这个错误和paypal 发你的邮件应该没有任何关系。

这个错误是 json 解析的时候类型不匹配,需要你把上图中的 data 打印出来看看。

@rockingdice
Copy link
Author

暂时这样修改以后还没遇到问题,我收集一下data数据后再反馈过来吧。

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

No branches or pull requests

2 participants