Get amount from django-paypal

2019-09-08 11:38发布

I am using django-paypal to receive payment. I am currently paying as well as receiving payment using sandbox accounts. The payment procedure seems to be working fine.

My problem is once I get back the signal valid_ipn_received, I am trying to get the amount of money from the transaction.

I went through this list of variables returned by Paypal. I also went through this model to see where it is stored. It seems the amount is stored in auth_amount? However I'm getting a 'None' from that variable. Is this because I'm using a sandbox account? How do I get the amount of transaction?

1条回答
叼着烟拽天下
2楼-- · 2019-09-08 12:12

Figured this out a while ago by reading the docs. Posting the answer here.

Apparently, this is how you do it:

amount = ipn_obj.mc_gross
查看更多
登录 后发表回答