9

Authorize.net の Customer Information Manager API (CIM) を使用しています。私のテストケースは、チェックアウト時に間違った住所を提供するユーザーを中心にしています。

私のアプリケーションは、ユーザーがフォームを送信するたびに顧客プロファイルを作成しようとします:

$txrq = new AuthorizeNetCIM;
$txrsp = $txrq->createCustomerProfileTransaction("AuthCapture", $transaction, 'x_duplicate_window=0');

x_duplicate_window上記のように、SDK ではリクエストの次の部分である「Extra Options」に渡すように設定してみました。

<extraOptions><![CDATA[' . $this->_extraOptions . ']]></extraOptions>

x_duplicate_window にどのような値を使用しても、authorize.net はデフォルトの時間が経過するまで常にエラーを返します。

AuthorizeNet Error: Response Code: 3 Response Subcode: 1 Response Reason Code: 11 Response Reason Text: A duplicate transaction has been submitted.

(潜在的な) ユーザーの 1 人が間違ったアドレスを送信しようとして、自分のエラーに気付き、トランザクションのタイムアウトが発生している間に、さらに 3 分間エラーが発生するのではないかと心配しています。

4

1 に答える 1

9

Authorize.net SDK コードにエラーがあります。

〜360〜364行目CIM.php's method _setPostString()

if ($this->_extraOptions) {
    $this->_xml->addChild("extraOptions");
    $this->_post_string = str_replace("<extraOptions></extraOptions>",'<extraOptions><![CDATA[' . $this->_extraOptions . ']]></extraOptions>', $this->_xml->asXML());
    $this->_extraOptions = false;
}

$this->_xml->addChild("extraOptions");str_replace 呼び出しと一致しないノードになります。<extraOptions/>

str_replace を変更すると、これが修正され、x_duplicate_windowパラメータがうまく渡されます。

if ($this->_extraOptions) {
    $this->_xml->addChild("extraOptions");
    $this->_post_string = str_replace("<extraOptions/>",'<extraOptions><![CDATA[' . $this->_extraOptions . ']]></extraOptions>', $this->_xml->asXML());
    $this->_extraOptions = false;
}
于 2012-07-16T05:05:50.197 に答える