我想更新 paypal 订阅(HTML 支付标准订阅/经典方法)
我已经使用此链接实施订阅: https://overiq.com/django-paypal-integration-with-django -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
现在我想更新现有的订阅, 我显示了贝宝文档,但这是集成贝宝的另一种方法,我仅使用电子邮件集成贝宝,
我认为这是使用贝宝的经典订阅,我找不到任何使用此方法订阅贝宝的官方文档,
那么如何用这种方法更新订阅呢?
另外,如果有人找到任何官方文档,请
提前分享,谢谢!
i have implement subscription using this link :
https://overiq.com/django-paypal-integration-with-django-paypal/
this mathod is using classic/old subscription technique i guess
i used this method to get paypal form to subscribe
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
now i want to update the exising subscription,
i show the paypal documentation but this is the another mathod to integrate paypal, and i had integrate paypal only using email,
i think this is the classic subscription using paypal, and i can not found any official docs for subscription for paypal with this mathod,
so how to update subscription with this mathod?
also if anyone find any official docs please share
thanks in advance !!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您正在使用 HTML付款标准订阅。功能非常有限,因为此集成没有 API 调用。
如果需要进行更改,请让用户取消现有订阅并使用新条款重新订阅。
You're using HTML Payments Standard Subscriptions. Functionality is very limited, since there are no API calls with this integration.
If changes need to be made, have users cancel their existing subscription and re-subscribe with the new terms.