當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。