Skip to content
Advertisement

how to get transaction id and name in bluesnap payment gateway

I am using bluesnap payment gateway in PHP. And it is working properly. But in return I am not getting transaction id and customer name is not showing in sandbox account also.

Below is my transaction page at which blusnap code will be run and return desired output.

require_once('New_folder/vendor/autoload.php');

$environment = 'sandbox'; // or 'production'
$keys = tdanielcoxBluesnapBluesnap::init($environment, 'API_111111111111111111111', 'password11');

$response = tdanielcoxBluesnapCardTransaction::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;

My success response is: In this return transaction id is not showing. And also not getting customer name in bluesnap sandbox panel.

tdanielcoxBluesnapModelsCardTransaction 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] => tdanielcoxBluesnapModelsCreditCard 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
    (
    )

)

Advertisement

Answer

The shopper name is in an incorrect position in your request. Try this instead:

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',
]);

Source: https://developers.bluesnap.com/v8976-JSON/docs/auth-capture

transactionId is always returned in the response, make sure there’s nothing wrong with the php code or model that is displaying it..

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement