Error 400

You are here

1 post / 0 new
Error 400

Running a transaction and receive an Error "400".

Further down in the log you may see "InvalidRequestData: INVALID C_STATE". This means the value billing: state was not populated or invalid. If not set PaymentsJS will submit an empty string for the billing information, but the API is expecting to see valid values.

This indicates you should include the billing information into the request.

Example below with the billing information included:

$UI.Initialize({ // configuring the UI
        apiKey: "<?php echo $developer['ID']; ?>",
        merchantId: "<?php echo $merchant['ID']; ?>", 
        authKey: "<?php echo $authKey; ?>",
        requestType: "<?php echo $requestType; ?>", 
        requestId: "<?php echo $requestId; ?>", 
        amount: "1.00", 
        elementId: "paymentButton", 
        nonce: "<?php echo $nonces['salt']; ?>", 
        debug: true, 
        addFakeData: true, 
        preAuth: false,
        environment: "<?php echo $request['environment']; ?>", 
        postbackUrl: "<?php echo $request['postbackUrl']; ?>",
        billing: {
            name: "John Smith",
            address: "123 Address St",
            city: "Savannah",
            postalCode: "31405"