首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >我想更新paypal订阅(我猜是经典的方法)

我想更新paypal订阅(我猜是经典的方法)
EN

Stack Overflow用户
提问于 2022-03-25 07:20:56
回答 1查看 85关注 0票数 0

我已经使用以下链接实现了订阅:https://overiq.com/django-paypal-integration-with-django-paypal/

这个方法使用的是经典/旧的订阅技术。

我使用这种方法来获得paypal表单的订阅。

代码语言:javascript
复制
def processSubscriptionPaypal(userRequest,price,billing_cycle,billing_cycle_unit,successUrl,cancelUrl,metadata):
    try:
        host = userRequest.get_host()
        host2 = userRequest.get_host() #for paypal-ipn url
        print('http://{}{}'.format(host2,
                                    '/settings/paypal/'))

        paypal_dict  = {
            "cmd": "_xclick-subscriptions",
            'business': settings.PAYPAL_RECEIVER_EMAIL_2,
            "a3": price,  # monthly price
            "p3": billing_cycle,  # duration of each unit (depends on unit)
            "t3": billing_cycle_unit,  # 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': 'Content subscription test yo2',
            # 'custom': {"userId":"1","planId":"2","storeId":"1"},     # custom data, pass something meaningful here
            'custom': metadata,     # custom data, pass something meaningful here
            'currency_code': 'USD',
            'notify_url': 'http://{}{}'.format(host2,
                                    '/settings/paypal/'),
            # 'notify_url': 'http://{}{}'.format(host,
            #                                 reverse('paypal-ipn')),
            'return_url': successUrl,
            'cancel_return': cancelUrl,
        }

        form = PayPalPaymentsForm(initial=paypal_dict, 
               button_type="subscribe")

        return form
    except Exception as e:
        
        print("something went wrong in processSubscriptionPaypal/n",e)
        return False

现在我想更新下一次订阅,我展示了paypal文档,但这是另一种集成paypal的方法,我只使用电子邮件集成了paypal,

我认为这是使用paypal的经典订阅,我用这种方法找不到任何订阅paypal的官方文档,

那么如何用这个方法来更新订阅呢?

此外,如果有人发现任何官方文档,请分享

提前谢谢!!

EN

回答 1

Stack Overflow用户

发布于 2022-03-25 09:31:33

你在使用HTML支付标准订阅。功能非常有限,因为在这种集成中没有API调用。

如果需要进行更改,让用户取消现有订阅,并使用新条款重新订阅。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/71613365

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档