From c71d1643f53ef640486a48ba292b1a9f790a69de Mon Sep 17 00:00:00 2001 From: crosalot Date: Wed, 14 Feb 2018 14:42:35 +0700 Subject: [PATCH] add Card.retrieve(customer_id, card_id) with rquest from api --- omise/__init__.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/omise/__init__.py b/omise/__init__.py index 241b816..3f0d5d7 100644 --- a/omise/__init__.py +++ b/omise/__init__.py @@ -413,6 +413,22 @@ class Card(_MainResource, Base): '4242' """ + @classmethod + def _instance_path(cls, customer_id, card_id): + return ('customers', customer_id, 'cards', card_id) + + @classmethod + def retrieve(cls, customer_id, card_id): + """Retrieve the card details for the given :param:`card_id`. + + :param customer_id: a customer id of card id. + :type customer_id: str + :param card_id: a card id to retrieve. + :type card_id: str + :rtype: Card + """ + return _as_object(cls._request('get', cls._instance_path(customer_id, card_id))) + def reload(self): """Reload the card details.