Maybe this is a dumb question but I really don't know what is the issue with this. I'm trying to capture a previuosly auth_only transaction with the respective auth_code, but in the response I'm always getting that the transaction is auth_capture, no matter what I set on the x_type field. I've already tested it with the sandbox and live credentials. Thanks in advance.
This is the code
$fields = array(
'type' => 'CAPTURE_ONLY',
'auth_code' => '9JZRI3'
);
$this->authorizenet_aim->setFields($fields);
var_dump($this->authorizenet_aim);
$response = $this->authorizenet_aim->authorizeAndCapture();
printing the aim object
["_x_post_fields":protected]=> array(7) { ["version"]=> string(3) "3.1" ["delim_char"]=> string(1) "," ["delim_data"]=> string(4) "TRUE" ["relay_response"]=> string(5) "FALSE" ["encap_char"]=> string(1) "|" ["type"]=> string(12) "CAPTURE_ONLY" ["auth_code"]=> string(6) "9JZRI3" }
this is the response, then it throws a "credit card is required" error.
["transaction_type"]=> string(12) "auth_capture"
Solved! Go to Solution.
03-13-2015 10:21 AM - edited 03-13-2015 10:23 AM
$response = $this->authorizenet_aim->authorizeAndCapture();
There test that you can look at
https://github.com/AuthorizeNet/sdk-php/blob/master/tests/AuthorizeNetAIM_Test.php
you would want to use priorAuthCapture.
Look at the
public function testAuthCaptureVoid() |
03-13-2015 10:54 AM - last edited on 03-13-2015 11:08 AM by RichardH
$response = $this->authorizenet_aim->authorizeAndCapture();
There test that you can look at
https://github.com/AuthorizeNet/sdk-php/blob/master/tests/AuthorizeNetAIM_Test.php
you would want to use priorAuthCapture.
Look at the
public function testAuthCaptureVoid() |
03-13-2015 10:54 AM - last edited on 03-13-2015 11:08 AM by RichardH
I knew it was something silly, thanks a lot!
03-13-2015 11:05 AM