How to use the recurly.resource.Resource function in recurly

To help you get started, we’ve selected a few recurly examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github recurly / recurly-client-python / recurly / resources.py View on Github external
class PlanMini(Resource):
    """
    Attributes
    ----------
    code : str
        Unique code to identify the plan. This is used in Hosted Payment Page URLs and in the invoice exports.
    id : str
        Plan ID
    name : str
        This name describes your plan and will appear on the Hosted Payment Page and the subscriber's invoice.
    """

    schema = {"code": str, "id": str, "name": str}


class CouponDiscount(Resource):
    """
    Attributes
    ----------
    currencies : :obj:`list` of :obj:`CouponDiscountPricing`
        This is only present when `type=fixed`.
    percent : int
        This is only present when `type=percent`.
    trial : CouponDiscountTrial
        This is only present when `type=free_trial`.
    type : str
    """

    schema = {
        "currencies": ["CouponDiscountPricing"],
        "percent": int,
        "trial": "CouponDiscountTrial",
github recurly / recurly-client-python / recurly / resources.py View on Github external
id : str
        Coupon Redemption ID
    state : str
        Invoice state
    """

    schema = {
        "coupon": "CouponMini",
        "created_at": datetime,
        "discounted": float,
        "id": str,
        "state": str,
    }


class CouponMini(Resource):
    """
    Attributes
    ----------
    code : str
        The code the customer enters to redeem the coupon.
    coupon_type : str
        Whether the coupon is "single_code" or "bulk". Bulk coupons will require a `unique_code_template` and will generate unique codes through the `/generate` endpoint.
    discount : CouponDiscount
    expired_at : datetime
        The date and time the coupon was expired early or reached its `max_redemptions`.
    id : str
        Coupon ID
    name : str
        The internal name for the coupon.
    state : str
        Indicates if the coupon is redeemable, and if it is not, why.
github recurly / recurly-client-python / recurly / resources.py View on Github external
}


class InvoiceCollection(Resource):
    """
    Attributes
    ----------
    charge_invoice : Invoice
    credit_invoices : :obj:`list` of :obj:`Invoice`
        Credit invoices
    """

    schema = {"charge_invoice": "Invoice", "credit_invoices": ["Invoice"]}


class AccountNote(Resource):
    """
    Attributes
    ----------
    account_id : str
    created_at : datetime
    id : str
    message : str
    user : User
    """

    schema = {
        "account_id": str,
        "created_at": datetime,
        "id": str,
        "message": str,
        "user": "User",
github recurly / recurly-client-python / recurly / resources.py View on Github external
"id": str,
        "interval_length": int,
        "interval_unit": str,
        "name": str,
        "setup_fee_accounting_code": str,
        "state": str,
        "tax_code": str,
        "tax_exempt": bool,
        "total_billing_cycles": int,
        "trial_length": int,
        "trial_unit": str,
        "updated_at": datetime,
    }


class PlanPricing(Resource):
    """
    Attributes
    ----------
    currency : str
        3-letter ISO 4217 currency code.
    setup_fee : float
        Amount of one-time setup fee automatically charged at the beginning of a subscription billing cycle. For subscription plans with a trial, the setup fee will be charged at the time of signup. Setup fees do not increase with the quantity of a subscription plan.
    unit_amount : float
        Unit price
    """

    schema = {"currency": str, "setup_fee": float, "unit_amount": float}


class PlanHostedPages(Resource):
    """
github recurly / recurly-client-python / recurly / resources.py View on Github external
class FraudInfo(Resource):
    """
    Attributes
    ----------
    decision : str
        Kount decision
    risk_rules_triggered : dict
        Kount rules
    score : int
        Kount score
    """

    schema = {"decision": str, "risk_rules_triggered": dict, "score": int}


class BillingInfoUpdatedBy(Resource):
    """
    Attributes
    ----------
    country : str
        Country of IP address, if known by Recurly.
    ip : str
        Customer's IP address when updating their billing information.
    """

    schema = {"country": str, "ip": str}


class CustomField(Resource):
    """
    Attributes
    ----------
github recurly / recurly-client-python / recurly / resources.py View on Github external
"""

    schema = {
        "account": "AccountMini",
        "coupon": "Coupon",
        "created_at": datetime,
        "currency": str,
        "discounted": float,
        "id": str,
        "removed_at": datetime,
        "state": str,
        "updated_at": datetime,
    }


class Coupon(Resource):
    """
    Attributes
    ----------
    applies_to_all_plans : bool
        The coupon is valid for all plans if true. If false then `plans` and `plans_names` will list the applicable plans.
    applies_to_non_plan_charges : bool
        The coupon is valid for one-time, non-plan charges if true.
    code : str
        The code the customer enters to redeem the coupon.
    coupon_type : str
        Whether the coupon is "single_code" or "bulk". Bulk coupons will require a `unique_code_template` and will generate unique codes through the `/generate` endpoint.
    created_at : datetime
        Created at
    discount : CouponDiscount
    duration : str
        - "single_use" coupons applies to the first invoice only.
github recurly / recurly-client-python / recurly / resource.py View on Github external
"""
        Returns
        -------
        Response
            The metadata about the response from the recurly server
        """
        return self.__response


class Empty(Resource):
    """A special resource that represents an empty response"""

    pass


class Page(Resource):
    """A special resource that represents a single page of data

    Attributes
    ----------

    has_more : bool
        True if there is another page of data available
    next : str
        The relative path to the next page of data
    data : :obj:`list` of :obj:`Resource`
        The list of data for this page. The data will be the requested type of Resource.
    """

    def __init__(self, properties):
        vars(self).update(properties)
github recurly / recurly-client-python / recurly / resources.py View on Github external
}


class TransactionPaymentGateway(Resource):
    """
    Attributes
    ----------
    id : str
    name : str
    type : str
    """

    schema = {"id": str, "name": str, "type": str}


class Invoice(Resource):
    """
    Attributes
    ----------
    account : AccountMini
    address : InvoiceAddress
    balance : float
        The outstanding balance remaining on this invoice.
    closed_at : datetime
        Date invoice was marked paid or failed.
    collection_method : str
        An automatic invoice means a corresponding transaction is run using the account's billing information at the same time the invoice is created. Manual invoices are created without a corresponding transaction. The merchant must enter a manual payment transaction or have the customer pay the invoice with an automatic method, like credit card, PayPal, Amazon, or ACH bank payment.
    created_at : datetime
        Created at
    credit_payments : :obj:`list` of :obj:`CreditPayment`
        Credit payments
    currency : str