微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

使用 django-paypal 实现经常性付款时出现错误请求错误

如何解决使用 django-paypal 实现经常性付款时出现错误请求错误

def process_payment(request):
    price = request.session.get('price')
    host = request.get_host()
    
    paypal_dict = {
        "cmd": "_xclick-subscriptions","business": 'receiver_email@example.com',"a3": "9.99",# monthly price
        "p3": 1,# duration of each unit (depends on unit)
        "t3": "M",# duration unit ("M for Month")
        "src": "1",# make payments recur
        "sra": "1",# reattempt payment on payment error
        "no_note": "1",# remove extra notes (optional)
        "item_name": "my cool subscription",'currency_code': 'USD','notify_url': 'http://{}{}'.format(host,reverse('paypal-ipn')),'return_url': 'http://{}{}'.format(host,reverse('source:payment_done')),'cancel_return': 'http://{}{}'.format(host,reverse('source:payment_cancelled')),}

    form = PayPalPaymentsForm(initial=paypal_dict)

    # Output the button.
    form.render()
    return render(request,'Prayer/process_payment.html',{'form': form})

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。