使用Authorize.net AIM API支付退款 [英] Refund payments using Authorize.net AIM API
本文介绍了使用Authorize.net AIM API支付退款的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我试图找到一种方式来支付退款使用Authorize.net的AIM API。我发现,设在这里的样品code: https://github.com/stymiee/Authorize.Net -XML 。这里是code,我从样品使用:
要求(../../的config.inc.php');
需要(../../ AuthnetXML.class.php');$ XML =新AuthnetXML(AUTHNET_LOGIN,AUTHNET_TRANSKEY,AuthnetXML :: USE_DEVELOPMENT_SERVER);
$ XML的> createTransactionRequest(阵列(
REFID'=>兰特(1000000,100000000),
transactionRequest'=>阵列(
TRANSACTIONTYPE'=> refundTransaction',
'量'=> 5,
'支付'=>阵列(
信用卡式'=>阵列(
cardNumber'=> XXXX1111',
EXPIRATIONDATE'=> '122016'
)
)
AUTH code'=> '2165668159'
)
));
我不断收到一个错误信息说,该卡code缺失。上缺什么,允许退票办理任何想法?
新的code:
$ XML =新AuthnetXML(AUTHNET_LOGIN,AUTHNET_TRANSKEY);
$ XML的> createTransactionRequest(阵列(
REFID'=>兰特(1000000,100000000),
transactionRequest'=>阵列(
TRANSACTIONTYPE'=> refundTransaction',
'量'=> 1.00,
'支付'=>阵列(
信用卡式'=>阵列(
cardNumber'=> XXXX1014',
EXPIRATIONDATE'=> '122025',
)
)
refTransId'=> '4928163616',
)
));
解决方案
$ XML =新AuthnetXML(AUTHNET_LOGIN,AUTHNET_TRANSKEY);
$ XML的> createTransactionRequest(阵列(
REFID'=>兰特(1000000,100000000),
transactionRequest'=>阵列(
TRANSACTIONTYPE'=> refundTransaction',
'量'=> 1.00,
'支付'=>阵列(
信用卡式'=>阵列(
cardNumber'=> XXXX1014',
EXPIRATIONDATE'=> '122025',
)
)
refTransId'=> '4928163616',
transactionSettings'=>阵列(
'设置'=>阵列(
0 =>阵列(
settingName'=> emailCustomer',
settingValue'=> '真正'
)
)
)
)
));
I am trying to find a way to refund payments using Authorize.net's AIM API. I found sample code located here: https://github.com/stymiee/Authorize.Net-XML. Here is the code that I am using from the sample:
require('../../config.inc.php');
require('../../AuthnetXML.class.php');
$xml = new AuthnetXML(AUTHNET_LOGIN, AUTHNET_TRANSKEY, AuthnetXML::USE_DEVELOPMENT_SERVER);
$xml->createTransactionRequest(array(
'refId' => rand(1000000, 100000000),
'transactionRequest' => array(
'transactionType' => 'refundTransaction',
'amount' => 5,
'payment' => array(
'creditCard' => array(
'cardNumber' => 'XXXX1111',
'expirationDate' => '122016'
)
),
'authCode' => '2165668159'
),
));
I keep getting an error message saying that the card code is missing. Any thoughts on what is missing to allow a refund to go through?
NEW CODE:
$xml = new AuthnetXML(AUTHNET_LOGIN, AUTHNET_TRANSKEY);
$xml->createTransactionRequest(array(
'refId' => rand(1000000, 100000000),
'transactionRequest' => array(
'transactionType' => 'refundTransaction',
'amount' => 1.00,
'payment' => array(
'creditCard' => array(
'cardNumber' => 'XXXX1014',
'expirationDate' => '122025',
)
),
'refTransId' => '4928163616',
),
));
解决方案
$xml = new AuthnetXML(AUTHNET_LOGIN, AUTHNET_TRANSKEY);
$xml->createTransactionRequest(array(
'refId' => rand(1000000, 100000000),
'transactionRequest' => array(
'transactionType' => 'refundTransaction',
'amount' => 1.00,
'payment' => array(
'creditCard' => array(
'cardNumber' => 'XXXX1014',
'expirationDate' => '122025',
)
),
'refTransId' => '4928163616',
'transactionSettings' => array(
'setting' => array(
0 => array(
'settingName' => 'emailCustomer',
'settingValue' => 'true'
),
)
),
),
));
这篇关于使用Authorize.net AIM API支付退款的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文