Guest User

Untitled

a guest
Jun 18th, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.50 KB | None | 0 0
  1. if ($tresponse != null && $tresponse->getMessages() != null) {
  2. echo " Transaction Response code : " . $tresponse->getResponseCode() . "n";
  3. echo "Charge Credit Card AUTH CODE : " . $tresponse->getAuthCode() . "n";
  4. echo "Charge Credit Card TRANS ID : " . $tresponse->getTransId() . "n";
  5. echo " Code : " . $tresponse->getMessages()[0]->getCode() . "n";
  6. echo " Description : " . $tresponse->getMessages()[0]->getDescription() . "n";
  7. } else {
  8. echo "Transaction Failed n";
  9. if ($tresponse->getErrors() != null) {
  10. echo " Error code : " . $tresponse->getErrors()[0]->getErrorCode() . "n";
  11. echo " Error message : " . $tresponse->getErrors()[0]->getErrorText() . "n";
  12. }
  13. }
  14. } else {
  15. echo "Transaction Failed n";
  16. $tresponse = $response->getTransactionResponse();
  17. if ($tresponse != null && $tresponse->getErrors() != null) {
  18. echo " Error code : " . $tresponse->getErrors()[0]->getErrorCode() . "n";
  19. echo " Error message : " . $tresponse->getErrors()[0]->getErrorText() . "n";
  20. } else {
  21. echo " Error code : " . $response->getMessages()->getMessage()[0]->getCode() . "n";
  22. echo " Error message : " . $response->getMessages()->getMessage()[0]->getText() . "n";
  23. }
  24. }
  25. } else {
  26. echo "No response returned n";
  27. }
Add Comment
Please, Sign In to add comment