From dcb979abe1d47cb52e21042babf08a8b3eec4765 Mon Sep 17 00:00:00 2001 From: lancedouglas1 Date: Sat, 6 May 2017 21:28:52 -0400 Subject: [PATCH] Implement profiles->getCard Propagated profiles->getCard functionality, which was already supported in _endpoint --- src/Beanstream/api/Profiles.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/Beanstream/api/Profiles.php b/src/Beanstream/api/Profiles.php index 0853777..d681307 100644 --- a/src/Beanstream/api/Profiles.php +++ b/src/Beanstream/api/Profiles.php @@ -138,6 +138,26 @@ public function getCards($profile_id) { return $result; } + /** + * getCard() function - Retrieve a particular card in a profile + * @link http://developer.beanstream.com/documentation/tokenize-payments/retrieve-cards-profile/ + * + * @param string $profile_id Profile Id + * @param string $card_id Card Id + * @return array Cards data + */ + public function getCard($profile_id, $card_id) { + + //get this profile's cards endpoint + $endpoint = $this->_endpoint->getCardURI($profile_id); + + //process as is + $result = $this->_connector->processTransaction('GET', $endpoint, NULL); + + //return cards + return $result; + } + /** * addCard() function - Add a card to a profile * @link http://developer.beanstream.com/documentation/tokenize-payments/add-card-profile/