授权网卡存在退款

时间:2015-04-06 19:23:33

标签: php payment-gateway authorize.net

我正在使用Card Present技术进行用户交易。现在我需要实现退款功能但我收到错误

  

系统中找不到客户的付款资料ID。因此,这里无法退款。直接从Authorize.net系统退款。

//code for authroize payment is below
$sale = new AuthorizeNetCP(AUTHORIZENET_API_LOGIN_ID, AUTHORIZENET_TRANSACTION_KEY);

$sale->order->invoiceNumber = $user_info['invoiceNumber'];
$sale->order->description = "Order submitted by POS";
$sale->setFields(
                array(
                'amount' => 100,
                'device_type' => '4',
                )
            );
$card_str = explode(";",$cart_data['swiped_card_string']);
$sale->setTrack1Data($card_str[0]);
$response = $sale->authorizeOnly(); 


//Capture payment
// Create new customer profile
$capture = new AuthorizeNetAIM;
$response = $capture->priorAuthCapture($transaction_id,$newordertotal);



//refund code.
$payment = new AuthorizeNetAIM;
$response = $payment->credit($transaction_id, $amount, $card_last_4);

我的回复中没有收到任何客户个人资料ID,请让我知道我做错了方法,还是有其他方式为现有卡用户实施退款。

我也可以对上面提到的函数做出回应。

0 个答案:

没有答案