当前位置: 首页>>代码示例>>Python>>正文


Python PayPalInterface.manage_recurring_payments_profile_status方法代码示例

本文整理汇总了Python中vendor.paypalapi.interface.PayPalInterface.manage_recurring_payments_profile_status方法的典型用法代码示例。如果您正苦于以下问题:Python PayPalInterface.manage_recurring_payments_profile_status方法的具体用法?Python PayPalInterface.manage_recurring_payments_profile_status怎么用?Python PayPalInterface.manage_recurring_payments_profile_status使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在vendor.paypalapi.interface.PayPalInterface的用法示例。


在下文中一共展示了PayPalInterface.manage_recurring_payments_profile_status方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: cancel_premium_paypal

# 需要导入模块: from vendor.paypalapi.interface import PayPalInterface [as 别名]
# 或者: from vendor.paypalapi.interface.PayPalInterface import manage_recurring_payments_profile_status [as 别名]
    def cancel_premium_paypal(self):
        transactions = PayPalIPN.objects.filter(
            custom=self.user.username, txn_type='subscr_signup')
        if not transactions:
            return

        paypal_opts = {
            'API_ENVIRONMENT': 'PRODUCTION',
            'API_USERNAME': settings.PAYPAL_API_USERNAME,
            'API_PASSWORD': settings.PAYPAL_API_PASSWORD,
            'API_SIGNATURE': settings.PAYPAL_API_SIGNATURE,
        }
        paypal = PayPalInterface(**paypal_opts)
        transaction = transactions[0]
        profileid = transaction.subscr_id
        try:
            paypal.manage_recurring_payments_profile_status(
                profileid=profileid, action='Cancel')
        except PayPalAPIResponseError:
            logging.user(self.user,
                         "~FRUser ~SBalready~SN canceled Paypal subscription")
        else:
            logging.user(self.user, "~FRCanceling Paypal subscription")

        return True
开发者ID:gforguru,项目名称:NewsBlur,代码行数:27,代码来源:models.py

示例2: cancel_premium_paypal

# 需要导入模块: from vendor.paypalapi.interface import PayPalInterface [as 别名]
# 或者: from vendor.paypalapi.interface.PayPalInterface import manage_recurring_payments_profile_status [as 别名]
    def cancel_premium_paypal(self):
        transactions = PayPalIPN.objects.filter(custom=self.user.username, txn_type="subscr_signup")
        if not transactions:
            return

        paypal_opts = {
            "API_ENVIRONMENT": "PRODUCTION",
            "API_USERNAME": settings.PAYPAL_API_USERNAME,
            "API_PASSWORD": settings.PAYPAL_API_PASSWORD,
            "API_SIGNATURE": settings.PAYPAL_API_SIGNATURE,
        }
        paypal = PayPalInterface(**paypal_opts)
        transaction = transactions[0]
        profileid = transaction.subscr_id
        paypal.manage_recurring_payments_profile_status(profileid=profileid, action="Cancel")

        logging.user(self.user, "~FRCanceling Paypal subscription")

        return True
开发者ID:bstved,项目名称:NewsBlur,代码行数:21,代码来源:models.py


注:本文中的vendor.paypalapi.interface.PayPalInterface.manage_recurring_payments_profile_status方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。