/** * getTransaction() function - get a single transaction via 'Search' * //TODO not exactly working, returning call help desk, but incoming payload seems ok * @link http://developer.beanstream.com/documentation/analyze-payments/ * * @param string $transaction_id Transaction Id * @return array Transaction data */ public function getTransaction($transaction_id = '') { //get reporting endpoint $endpoint = $this->_endpoint->getPaymentUrl($transaction_id); //process as is $result = $this->_connector->processTransaction('GET', $endpoint, NULL); //send back the result return $result; }
/** * deleteCard() function - Delete a card from a profile via DELETE http method * @link http://developer.beanstream.com/documentation/tokenize-payments/delete-card-profile/ * * @param string $profile_id Profile Id * @param string $card_id Card Id * @return bool TRUE */ public function deleteCard($profile_id, $card_id) { //get this card's endpoint $endpoint = $this->_endpoint->getCardURI($profile_id, $card_id); //process as DELETE $result = $this->_connector->processTransaction('DELETE', $endpoint, NULL); return TRUE; }
/** * makeLegatoTokenPayment() function - Take a payment via a profile * @link http://developer.beanstream.com/documentation/legato/server-to-server-integration-by-api/ * * @param string $token Legato token * @param array $data Order data * @param bool $complete Set to false for pre-auth, default to TRUE * @return array Transaction details */ public function makeLegatoTokenPayment($token, $data = NULL, $complete = TRUE) { //get endpoint $endpoint = $this->_endpoint->getBasePaymentsURL(); //force token $data['payment_method'] = 'token'; //add token vars $data['token']['code'] = $token; $data['token']['name'] = isset($data['name']) ? $data['name'] : ''; $data['token']['complete'] = is_bool($complete) === TRUE ? $complete : TRUE; //process payment via Legato token return $this->_connector->processTransaction('POST', $endpoint, $data); }