0

asp.net Web サイトで Paypal トランザクションを処理するために Paypal_base.dll を使用していますが、エラーが発生します。私のコードは次のようになります:

 string Response;
    const string paymentAction = "Sale";
    const string currency = "USD";

    var caller = new NVPCallerServices();
    IAPIProfile profile = ProfileFactory.createSignatureAPIProfile();

    profile.APIUsername = ConfigurationManager.AppSettings["APIUsername"];
    profile.APIPassword = ConfigurationManager.AppSettings["APIPassword"];
    profile.APISignature = ConfigurationManager.AppSettings["token"];

    profile.Environment= "SandBox";
    caller.APIProfile = profile;

    var encoder = new NVPCodec();
    encoder["VERSION"] = "58.0";
    encoder["METHOD"] = "DoDirectPayment";
    encoder["PAYMENTACTION"] = paymentAction;
    encoder["AMT"] = amount;
    encoder["CREDITCARDTYPE"] = creditCardType;
    encoder["ACCT"] = creditCardNumber;
    encoder["EXPDATE"] = expdateMonth;
   // encoder["CVV2"] = cvv2Number;
   // encoder["FIRSTNAME"] = firstName;
   // encoder["LASTNAME"] = lastName;
   // encoder["STREET"] = city + ", " + state + ", " + countryCode;
   // encoder["CITY"] = city;
   // encoder["STATE"] = state;
   // encoder["ZIP"] = zip;
    encoder["COUNTRYCODE"] = countryCode;
    encoder["CURRENCYCODE"] = currency;

    // Execute the API operation and obtain the response.
    string pStrrequestforNvp = encoder.Encode();
    string pStresponsenvp = caller.Call(pStrrequestforNvp);

    var decoder = new NVPCodec();
    decoder.Decode(pStresponsenvp);
    Response = decoder["L_LONGMESSAGE0"];
    if (decoder["ACK"] == "Success")
    {
    }
    return decoder["ACK"];

レスポンス時の値 = デコーダ["L_LONGMESSAGE0"]; は「タイムアウト処理要求」

また、decoder["ACK"] は「失敗」メッセージを返します。

caller.Call(pStrrequestforNvp) には次の値があります。

TIMESTAMP=2013%2d10%2d02T22%3a40%3a04Z&CORRELATIONID=fa19cc06164da&ACK=失敗&L_ERRORCODE0=10001&L_SHORTMESSAGE0=内部%20エラー&L_LONGMESSAGE0=タイムアウト%20処理%20リクエスト

4

0 に答える 0