omnipay-authorizenet AuthorizeNet_CIMを使用して支払い処理をセットアップしようとしています。これに関する多くの文書はありません。omnipay - AuthorizeNet_CIM
手順1)ゲートウェイオブジェクトを正常に作成し、authorize.netサンドボックスサーバーに要求を行うことができます。
ステップ2)は、将来のトークン課金用に「カードを作成する」ことです:$ gateway-> createCard()。これは成功です。 一般Omnipayトークン請求のドキュメントから
:
「... createCard($オプション) - 将来の取引に使用することができcardReferenceを含む応答オブジェクトを返します...」
上記のcreateCard()レスポンスオブジェクトに特定の 'cardReference'が表示されません。
私は$ cardRef配列を作成し、返されたレスポンスCustomerProfileIdとCustomerPaymentProfileIdを取得します。
$profileResult['customerProfileId']=$response->getCustomerProfileId();
$profileResult['paymentProfileId']=$response->getCustomerPaymentProfileId();
ステップ3)は失敗し、購入を生成する機能である:
function create_transaction($cardRef,$amount,$description,$invoice_number){
global $status, $gateway;
try {
// Send purchase request
$response = $gateway->purchase(
array(
'cardReference' => $cardRef ,
'amount' => $amount,
'currency' => 'USD',
'description' => $_POST['description'],
'transactionId' => $invoice_number
)
)->send();
if ($response->isSuccessful()) {
// Payment was successful
$status.='Success: '.$response->getMessage();
} elseif ($response->isRedirect()) {
// Redirect to offsite payment gateway
$response->redirect();
} else {
// Payment failed
$status.='Transaction Failure: '.$response->getMessage();
}
} catch (Exception $e) {
$status.='<strong>Error:</strong> '.$e->getMessage(). "<br/>";
}
}
購入が失敗したと私はResponseオブジェクトを見たとき、要求がcardReferenceに移入されていないようですオブジェクトです。
[cardReference] => Omnipay\AuthorizeNet\Model\CardReference Object
(
[customerProfileId:Omnipay\AuthorizeNet\Model\CardReference:private] =>
[paymentProfileId:Omnipay\AuthorizeNet\Model\CardReference:private] =>
[shippingProfileId:Omnipay\AuthorizeNet\Model\CardReference:private] =>
)
私は明らかにパーチェス法に正しいcardReferenceデータを渡していません。
ご協力いただければ幸いです。私は明らかに文書化されていないOmnipayメソッドを使用するために必要な
おかげ