Pig Destroyer
Pig Destroyer

Reputation: 65

Unauthorized Error : 2Checkout API

instead of giving me a success callback, 2check out gives me an error of

Unauthorized

i searched about this issue, they say that it happens when billingAdr is empty or hidden, but i did not hide it and its not empty at all

here's my code

        '2checkout' => [
        'sellerId'       => '901348038',
        'publishableKey' => '39EBE63B-XXXX-4DD1-XXXX-XXXXXXXXXXXX',
        'privateKey'     => '3F1B005E-XXXX-4431-XXXX-XXXXXXXXXXXX',
        'sandbox' => 'true',
    ],

code in my script

        var tokenRequest = function() {
        // Setup token request arguments
        var args = {
            sellerId: "901348038",
            publishableKey: "39EBE63B-XXXX-4DD1-XXXX-XXXXXXXXXXXX",
            ccNo: $("#ccNo").val(),
            cvv: $("#cvv").val(),
            expMonth: $("#expMonth").val(),
            expYear: $("#expYear").val()
        };

        // Make the token request
        TCO.requestToken(successCallback, errorCallback, args);

    };

hoping that someone can help me about this

Upvotes: 1

Views: 1781

Answers (1)

Luis Roberto
Luis Roberto

Reputation: 472

a Typo in billingAdr, it should be billingAddr

Upvotes: 0

Related Questions