我已经使用以下链接实现了订阅:https://overiq.com/django-paypal-integration-with-django-paypal/
这个方法使用的是经典/旧的订阅技术。
我使用这种方法来获得paypal表单的订阅。
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的官方文档,
那么如何用这个方法来更新订阅呢?
此外,如果有人发现任何官方文档,请分享
提前谢谢!!
发布于 2022-03-25 09:31:33
你在使用HTML支付标准订阅。功能非常有限,因为在这种集成中没有API调用。
如果需要进行更改,让用户取消现有订阅,并使用新条款重新订阅。
https://stackoverflow.com/questions/71613365
复制相似问题