Php 如何在bluesnap支付网关中获取交易id和名称
我正在使用PHP中的bluesnap支付网关。而且工作正常。但作为回报,我并没有得到交易id,客户名称也并没有显示在沙箱帐户中 下面是我的事务页面,在该页面上运行blusnap代码并返回所需的输出Php 如何在bluesnap支付网关中获取交易id和名称,php,payment,bluesnap,Php,Payment,Bluesnap,我正在使用PHP中的bluesnap支付网关。而且工作正常。但作为回报,我并没有得到交易id,客户名称也并没有显示在沙箱帐户中 下面是我的事务页面,在该页面上运行blusnap代码并返回所需的输出 require_once('New_folder/vendor/autoload.php'); $environment = 'sandbox'; // or 'production' $keys = \tdanielcox\Bluesnap\Bluesnap::init($environment,
require_once('New_folder/vendor/autoload.php');
$environment = 'sandbox'; // or 'production'
$keys = \tdanielcox\Bluesnap\Bluesnap::init($environment, 'API_111111111111111111111', 'password11');
$response = \tdanielcox\Bluesnap\CardTransaction::create([
'creditCard' => [
'firstName' => 'Jane',
'lastName' => 'Shopper',
'cardNumber' => '3566000020000410',
'expirationMonth' => '02',
'expirationYear' => '2023',
'securityCode' => '123'
],
'amount' => 10.00,
'currency' => 'USD',
'recurringTransaction' => 'ECOMMERCE',
'cardTransactionType' => 'AUTH_CAPTURE',
]);
if ($response->failed())
{
$error = $response->data;
$transaction = $response->data;
echo"<pre>";
print_r($transaction);
echo"</pre>";
// handle error
}
$transaction = $response->data;
echo"<pre>";
print_r($transaction);
echo"</pre>";
//$transaction;
购物者姓名在您的请求中的位置不正确。请尝试以下方法: 资料来源: transactionId总是在响应中返回,请确保显示它的php代码或模型没有任何错误
tdanielcox\Bluesnap\Models\CardTransaction Object
(
[children:protected] => Array
(
[transactionMetaData] => item
[creditCard] => item
[vendorInfo] => item
)
[cardTransactionType] => AUTH_CAPTURE
[amount] => 10
[recurringTransaction] => ECOMMERCE
[merchantTransactionId] =>
[softDescriptor] => BLS*onboardingDefault
[vaultedShopperId] => 27595185
[currency] => USD
[transactionMetaData] =>
[creditCard] => tdanielcox\Bluesnap\Models\CreditCard Object
(
[cardNumber] =>
[encryptedCardNumber] =>
[cardLastFourDigits] => 0410
[cardType] => JCB
[expirationMonth] =>
[expirationYear] =>
[securityCode] =>
[encryptedSecurityCode] =>
[children:protected] => Array
(
)
[cardSubType] => CREDIT
[cardCategory] => STANDARD
[binCategory] => CONSUMER
[cardRegulated] => N
[issuingCountryCode] => us
)
[transactionFraudInfo] =>
[id] => 1031167745
[usdAmount] => 10
[transactionApprovalDate] => 05/29/2020
[transactionApprovalTime] => 00:07:12
[cardHolderInfo] => Array
(
)
[processingInfo] => Array
(
[processingStatus] => success
[cvvResponseCode] => ND
[authorizationCode] => 654321
[avsResponseCodeZip] => U
[avsResponseCodeAddress] => U
[avsResponseCodeName] => U
)
[fraudResultInfo] => Array
(
)
)
create([
'cardHolderInfo' => [
'firstName' => 'Jane',
'lastName' => 'Shopper'
],
'creditCard' => [
'cardNumber' => '3566000020000410',
'expirationMonth' => '02',
'expirationYear' => '2023',
'securityCode' => '123'
],
'amount' => 10.00,
'currency' => 'USD',
'recurringTransaction' => 'ECOMMERCE',
'cardTransactionType' => 'AUTH_CAPTURE',
]);