没有debbuger的脚本没有像预期的那样工作

时间:2017-03-27 06:08:14

标签: javascript jquery ajax payment-gateway

目前,我面临着非常奇怪的问题 我正在做的是在我的代码中集成支付网关( Cyber​​Source PaymentGateway )。
首先,我调用Ajax并进行一些操作,之后我获取带参数的json结果,并使用json结果填充所有必需参数并执行提交表单。
问题是,当我提交表格时,付款网关不会工作并给出

  

403 - 未经授权

但如果我把调试器检查脚本,一切正常 以下是我的代码。如果我遗漏了某些东西,请检查并告诉我。

PaymentForm

public void openDatePicker()
{
    // Get Current Date
    final Calendar c = Calendar.getInstance();
    mYear = c.get(Calendar.YEAR);
    mMonth = c.get(Calendar.MONTH);
    mDay = c.get(Calendar.DAY_OF_MONTH);
    final DatePickerDialog datePickerDialog = new DatePickerDialog(rentActivity.this,
        new DatePickerDialog.OnDateSetListener() {
            @Override
            public void onDateSet(DatePicker view, int year,int monthOfYear, int dayOfMonth) 
            {
                endDate.setText(dayOfMonth + "/" + (monthOfYear + 1) + "/" + year);
            }
        }, mYear, mMonth, mDay);

    datePickerDialog.getDatePicker().setMinDate(System.currentTimeMillis()-1000);
    datePickerDialog.show();
}

Ajax Call

<form id='payment_confirmation' method='post' style="display:none">
    <input type='hidden' name='access_key' id='access_key' />
    <input type='hidden' name='profile_id' id='profile_id' />
    <input type='hidden' name='transaction_uuid' id='transaction_uuid' />
    <input type='hidden' name='signed_field_names' id='signed_field_names' value='access_key,profile_id,transaction_uuid,signed_field_names,unsigned_field_names,signed_date_time,locale,transaction_type,reference_number,amount,currency,payment_method,bill_to_forename,bill_to_surname,bill_to_email,bill_to_phone,bill_to_address_line1,bill_to_address_city,bill_to_address_state,bill_to_address_country,bill_to_address_postal_code,ignore_cvn' />
    <input type='hidden' name='unsigned_field_names' id='unsigned_field_names' value='card_type,card_number,card_expiry_date,card_cvn' />
    <input type='hidden' name='signed_date_time' id='signed_date_time' />
    <input type='hidden' name='locale' id='locale' value='en' />
    <input type='hidden' name='ignore_cvn' id='ignore_cvn' value='false' />
    <input type='hidden' name='card_cvn' id='card_cvn' />
    <fieldset>
        <div id='paymentDetailsSection' class='section'>
            <input type='hidden' id='transaction_type' name='transaction_type' size='25' /><br />
            <input type='hidden' id='reference_number' name='reference_number' size='25' /><br />
            <input type='hidden' id='amount' name='amount' size='25' /><br />
            <input type='hidden' id='currency' name='currency' size='25' /><br />
            <input type='hidden' id='payment_method' name='payment_method' value='card' /><br />
            <input type='hidden' id='bill_to_forename' name='bill_to_forename' /><br />
            <input type='hidden' id='bill_to_surname' name='bill_to_surname' /><br />
            <input type='hidden' id='bill_to_email' name='bill_to_email' /><br />
            <input type='hidden' id='bill_to_phone' name='bill_to_phone' /><br />
            <input type='hidden' id='bill_to_address_line1' name='bill_to_address_line1' /><br />
            <input type='hidden' id='bill_to_address_city' name='bill_to_address_city' /><br />
            <input type='hidden' id='bill_to_address_state' name='bill_to_address_state' /><br />
            <input type='hidden' id='bill_to_address_country' name='bill_to_address_country' /><br />
            <input type='hidden' id='bill_to_address_postal_code' name='bill_to_address_postal_code' /><br />
        </div>
    </fieldset>
    <fieldset>
        <div id='UnsignedDataSection' class='section'>
            <input type='hidden' id='card_type' name='card_type' value='001' /><br />
            <input type='hidden' id='card_number' name='card_number' /><br />
            <input type='hidden' id='card_expiry_date' name='card_expiry_date' /><br />
        </div>
        <input type='hidden' id='signature' name='signature' />
    </fieldset>
    <input type='submit' id='btnsubmit' value='Confirm' />
</form>

0 个答案:

没有答案