API — Как я могу получить платежный адрес в Authorize.net SDK для PHP?

Я пытаюсь настроить sdk authorize.net для php, и у меня возникают проблемы с правильной работой адреса выставления счета. Я проверил образец на github, и мне удалось заставить транзакции проходить через мой аккаунт в песочнице, но я не знаю, как отобразить платежную информацию. Пожалуйста, имейте в виду, что я не php wiz, поэтому, пожалуйста, не принимайте вещи, если есть более глубокое объяснение.

Вот код …

`<?php
require 'vendor/autoload.php';
use net\authorize\api\contract\v1 as AnetAPI;
use net\authorize\api\controller as AnetController;
define("AUTHORIZENET_LOG_FILE", "phplog");

// Common setup for API credentials
$merchantAuthentication = new AnetAPI\MerchantAuthenticationType();
$merchantAuthentication->setName("My api login");
$merchantAuthentication->setTransactionKey("my api key");

// Create the payment data for a credit card
$creditCard = new AnetAPI\CreditCardType();
$creditCard->setCardNumber("6011000000000012");
$creditCard->setExpirationDate("2038-12");
$paymentOne = new AnetAPI\PaymentType();
$paymentOne->setCreditCard($creditCard);// Create a transaction
$transactionRequestType = new AnetAPI\TransactionRequestType();
$transactionRequestType->setTransactionType( "authCaptureTransaction");
$transactionRequestType->setAmount(9.51);
$transactionRequestType->setPayment($paymentOne);

//Billing Address
$billTo = new AnetAPI\billToType();
$billTo->setfirstName("Jordan");
$billTo->setlastName("Smith");
$billTo->setaddress("381 Indian Ave");
$billTo->setcity("Bridgeport");
$billTo->setstate("CT");
$billTo->setzip("06606");
$billTo->setcountry("USA");$request = new AnetAPI\CreateTransactionRequest();
$request->setMerchantAuthentication($merchantAuthentication);
$request->setTransactionRequest( $transactionRequestType);
$controller = new AnetController\CreateTransactionController($request);
$response = $controller->executeWithApiResponse( \net\authorize\api\constants\ANetEnvironment::SANDBOX);

if ($response != null)
{
$tresponse = $response->getTransactionResponse();

if (($tresponse != null) && ($tresponse->getResponseCode()=="1") )
{
echo "Charge Credit Card AUTH CODE : " . $tresponse->getAuthCode() . "\n";
echo "Charge Credit Card TRANS ID  : " . $tresponse->getTransId() . "\n";
}
else
{
echo  "Charge Credit Card ERROR :  Invalid response\n";
}
}
else
{
echo  "Charge Credit card Null response returned";
}
?>`

Спасибо за любую помощь.

Вот картина детали сделки …введите описание изображения здесь

0

Решение

Задача ещё не решена.

Другие решения

Других решений пока нет …