Beispiel #1
0
    def instance_url(self):
        token = util.utf8(self.id)
        extn = quote_plus(token)
        if hasattr(self, "customer"):
            customer = util.utf8(self.customer)

            base = Customer.class_url()
            owner_extn = quote_plus(customer)
            class_base = "sources"

        elif hasattr(self, "recipient"):
            recipient = util.utf8(self.recipient)

            base = Recipient.class_url()
            owner_extn = quote_plus(recipient)
            class_base = "cards"

        elif hasattr(self, "account"):
            account = util.utf8(self.account)

            base = Account.class_url()
            owner_extn = quote_plus(account)
            class_base = "external_accounts"

        else:
            raise error.InvalidRequestError(
                "Could not determine whether card_id %s is "
                "attached to a customer, recipient, or "
                "account." % token,
                "id",
            )

        return "%s/%s/%s/%s" % (base, owner_extn, class_base, extn)
Beispiel #2
0
 def instance_url(self):
     token = util.utf8(self.id)
     customer = util.utf8(self.customer)
     base = Customer.class_url()
     cust_extn = quote_plus(customer)
     extn = quote_plus(token)
     return "%s/%s/balance_transactions/%s" % (base, cust_extn, extn)
Beispiel #3
0
    def instance_url(self):
        token = util.utf8(self.id)
        extn = quote_plus(token)
        if hasattr(self, 'customer'):
            customer = util.utf8(self.customer)

            base = Customer.class_url()
            owner_extn = quote_plus(customer)
            class_base = "sources"

        elif hasattr(self, 'recipient'):
            recipient = util.utf8(self.recipient)

            base = Recipient.class_url()
            owner_extn = quote_plus(recipient)
            class_base = "cards"

        elif hasattr(self, 'account'):
            account = util.utf8(self.account)

            base = Account.class_url()
            owner_extn = quote_plus(account)
            class_base = "external_accounts"

        else:
            raise error.InvalidRequestError(
                "Could not determine whether card_id %s is "
                "attached to a customer, recipient, or "
                "account." % token, 'id')

        return "%s/%s/%s/%s" % (base, owner_extn, class_base, extn)
Beispiel #4
0
    def instance_url(self):
        token = util.utf8(self.id)
        extn = quote_plus(token)
        if hasattr(self, "customer"):
            customer = util.utf8(self.customer)

            base = Customer.class_url()
            owner_extn = quote_plus(customer)
            class_base = "sources"

        elif hasattr(self, "account"):
            account = util.utf8(self.account)

            base = Account.class_url()
            owner_extn = quote_plus(account)
            class_base = "external_accounts"

        else:
            raise error.InvalidRequestError(
                "Could not determine whether bank_account_id %s is "
                "attached to a customer or an account." % token,
                "id",
            )

        return "%s/%s/%s/%s" % (base, owner_extn, class_base, extn)
    def _build_instance_url(cls, customer, sid):
        token = util.utf8(sid)
        extn = quote_plus(token)
        customer = util.utf8(customer)

        base = Customer.class_url()
        owner_extn = quote_plus(customer)

        return "%s/%s/sources/%s" % (base, owner_extn, extn)
Beispiel #6
0
    def _build_instance_url(cls, customer, sid):
        token = util.utf8(sid)
        extn = quote_plus(token)
        customer = util.utf8(customer)

        base = Customer.class_url()
        owner_extn = quote_plus(customer)

        return "%s/%s/sources/%s" % (base, owner_extn, extn)
Beispiel #7
0
    def instance_url(self):
        token = util.utf8(self.id)
        extn = quote_plus(token)

        if hasattr(self, "customer"):
            customer = util.utf8(self.customer)
            base = Customer.class_url()
            cust_extn = quote_plus(customer)
            return "%s/%s/sources/%s" % (base, cust_extn, extn)
        else:
            base = BitcoinReceiver.class_url()
            return "%s/%s" % (base, extn)
    def instance_url(self):
        token = util.utf8(self.id)
        extn = quote_plus(token)

        if hasattr(self, 'customer'):
            customer = util.utf8(self.customer)
            base = Customer.class_url()
            cust_extn = quote_plus(customer)
            return "%s/%s/sources/%s" % (base, cust_extn, extn)
        else:
            base = BitcoinReceiver.class_url()
            return "%s/%s" % (base, extn)
Beispiel #9
0
    def instance_url(self):
        token = util.utf8(self.id)
        extn = urllib.parse.quote_plus(token)
        if hasattr(self, 'customer'):
            customer = util.utf8(self.customer)

            base = Customer.class_url()
            owner_extn = urllib.parse.quote_plus(customer)
            class_base = "sources"

        elif hasattr(self, 'account'):
            account = util.utf8(self.account)

            base = Account.class_url()
            owner_extn = urllib.parse.quote_plus(account)
            class_base = "external_accounts"

        else:
            raise error.InvalidRequestError(
                "Could not determine whether bank_account_id %s is "
                "attached to a customer or an account." % token, 'id')

        return "%s/%s/%s/%s" % (base, owner_extn, class_base, extn)
Beispiel #10
0
 def instance_url(self):
     customer = util.utf8(self.customer)
     base = Customer.class_url()
     cust_extn = quote_plus(customer)
     return "%s/%s/cash_balance" % (base, cust_extn)