有没有人使用 CI-Merchant 和 3D Secure 成功集成 Cardsave?
我现在已经设法让 3D Secure 响应我的网站(看起来您需要将“return_url”作为参数添加到其他任何有问题的人的参数中),但交易总是使用失败返回真实卡或授权成功的测试 3D 安全卡。
不幸的是,CI-Merchant 网站上没有任何关于 Cardsave 驱动程序的文档,只有 Paypal 的示例。
失败的交易没有出现在我的 Cardsave 帐户中的任何地方,所以我什至不确定 CI-Merchant 是否正在与 Cardsave 进行通信。
这是我用于测试的代码示例:
public function test_live_payment()
{
$this->load->library('merchant');
$creditcard = $this->input->post('creditcard');
$creditcardtype = $this->input->post('creditcardtype');
$cardmonth = $this->input->post('cardmonth');
$cardyear = $this->input->post('cardyear');
$cardsecurecode = $this->input->post('cardsecurecode');
$cardnameon = $this->input->post('cardnameon');
$address1 = $this->input->post('address1');
$address2 = $this->input->post('address2');
$city = $this->input->post('city');
$postcode = $this->input->post('postcode');
$data['status'] = '';
$data['message'] = '';
$test = TRUE;
if ($test) :
$settings = array (
'merchant_id' => 'TEST ACCOUNT',
'password' => 'XXXX'
);
else :
$settings = array (
'merchant_id' => 'LIVE ACCOUNT',
'password' => 'XXXX'
);
endif;
if ($_POST) :
$this->merchant->load('cardsave');
$this->merchant->initialize($settings);
$data['transaction_id'] = '999' . rand(1, 999);
$params = array(
'amount' => '1.00',
'currency' => 'GBP',
'card_no' => $creditcard,
'name' => $cardnameon,
'exp_month' => $cardmonth,
'exp_year' => 20 . $cardyear,
'csc' => $cardsecurecode,
'transaction_id' => $data['transaction_id'],
'description' => 'Test payment',
'address1' => $address1,
'address2' => $address2,
'city' => $city,
'postcode' => $postcode,
'return_url' => site_url('/test-payment')
);
$response = $this->merchant->purchase($params);
if ($response->success()) :
$gateway_reference = $response->reference();
$data['status'] = 'Success';
$data['message'] = 'The transaction was successfully processed';
else :
$message = $response->message();
$data['status'] = 'Failed';
if ( ! empty($message)) :
$data['message'] = $message;
else :
$data['message'] = 'Transaction failed. No further details received.';
endif;
endif;
endif;
$this->load->view('test_payment_form', $data);
}