Shahzaib Ahmed
Shahzaib Ahmed

Reputation: 171

2CheckOut - Error : Bad Request - Parameter error

Request Data to TwoCheckOut :

Request Data

Response from TwoCheckOut.

{
    "error": "Bad request - parameter error"
}

Here is the Code

     $charge = Twocheckout_Charge::auth(array(
            "sellerId" => '*HIDDEN*',
            "merchantOrderId" => $orderID,
            "token"      => $token,
            "currency"   => $currency,
            "total"      => $itemPrice,
            "billingAddr" => array(
                "name" => $name,
                "addrLine1" => $addrLine1,
                "city" => $city,
                "state" => $state,
                "zipCode" => $zipCode,
                "country" => $country,
                "email" => $email,
                "phoneNumber" => $phoneNumber
            ),
            "shippingAddr" => array(
            "name" => 'Testing Tester',
            "addrLine1" => '123 Test St',
            "city" => 'Columbus',
            "state" => 'OH',
            "zipCode" => '43123',
            "country" => 'USA',
            "email" => '[email protected]',
            "phoneNumber" => '555-555-5555'
            ),
            "demo" => true

        ));

Althought i am getting unauthenticated if i send wrong 'token' key.

EDIT :

MY VIEW JS CODE front end code

Feel free to drop your suggestions

Upvotes: 3

Views: 257

Answers (2)

ahmad
ahmad

Reputation: 11

TCO.loadPubKey('production');

loadPubKey should be 'production' it should not be empty

Upvotes: 0

Shahzaib Ahmed
Shahzaib Ahmed

Reputation: 171

"demo" => 'Y'

Demo key should be 'Y' not true was the issue here

Upvotes: 1

Related Questions