Вопрос по web-services, java – Paypal SetExpressCheckout Soap

1

когда я пытаюсь установить ExpressCheckout, я получаю ack = success, но не возвращаю токен.

версия API PayPal является 87,0 Вот ссылка wsdl:https://www.sandbox.paypal.com/wsdl/PayPalSvc.wsdl

здесь, чтобы команда я использую в axis2-1.6.1 для генерации кода Java

-uri https://www.sandbox.paypal.com/wsdl/PayPalSvc.wsd -p com.paypal.soap 

здесь ссылка на код Java, который сгенерирован с помощью axis2https://docs.google.com/open?id=0B97cB4uxjmztbGgxRER6VjBWcWc

вот код для SetExpressCheckout

    PaymentDetailsType paymentDetails = new PaymentDetailsType();
    BasicAmountType orderTotal = new BasicAmountType();
    orderTotal.setCurrencyID(CurrencyCodeType.USD);
    orderTotal.setString("10.00");
    paymentDetails.setOrderTotal(orderTotal);
    paymentDetails.setPaymentAction(PaymentActionCodeType.Sale);

    SetExpressCheckoutRequestDetailsType requestDetailsType = new SetExpressCheckoutRequestDetailsType();
    requestDetailsType.setCancelURL(buyer.getCancelUrl());
    requestDetailsType.setReturnURL(buyer.getReturnUrl());
    requestDetailsType.setPaymentDetails(new PaymentDetailsType[]{paymentDetails});

    SetExpressCheckoutRequestType requestType = new SetExpressCheckoutRequestType();
    requestType.setVersion("87.0");
    requestType.setSetExpressCheckoutRequestDetails(requestDetailsType);

    SetExpressCheckoutReq req = new SetExpressCheckoutReq();
    req.setSetExpressCheckoutRequest(requestType);

    RequesterCredentials requesterCredentials = new RequesterCredentials();
    CustomSecurityHeaderType customSecurityHeaderType = new CustomSecurityHeaderType();

    UserIdPasswordType userIdPasswordType = new UserIdPasswordType();
    userIdPasswordType.setUsername("<username>");
    userIdPasswordType.setPassword("<pass>");
    userIdPasswordType.setSignature("<signature>");
    customSecurityHeaderType.setCredentials(userIdPasswordType);
    requesterCredentials.setRequesterCredentials(customSecurityHeaderType);

    String endPoint = null;
    endPoint = "https://api-3t.sandbox.paypal.com/2.0/";  //sandbox API Signature   
    PayPalAPIInterfaceServiceStub stub = new PayPalAPIInterfaceServiceStub(endPoint);
    stub._getServiceClient().getOptions().setProperty(HTTPConstants.CHUNKED, false);
    SetExpressCheckoutResponse setExpressCheckout = stub.setExpressCheckout(req, requesterCredentials);

    SetExpressCheckoutResponseType checkoutResponse = setExpressCheckout.getSetExpressCheckoutResponse();
    Calendar timestamp = checkoutResponse.getTimestamp();
    String strdate = null;
    SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy hh:mm:ss");
    if (timestamp != null) {
        strdate = sdf.format(timestamp.getTime());
    }
    System.out.println("Date:" + strdate);
    System.out.println("CorrelationID:" + checkoutResponse.getCorrelationID());
    System.out.println("ack :" + checkoutResponse.getAck());
    if (checkoutResponse.getErrors() != null && checkoutResponse.getErrors().length > 0) {
        PayPalAPIInterfaceServiceStub.ErrorType[] errors = checkoutResponse.getErrors();
        for (int i = 0; i < errors.length; i++) {
            System.out.println(errors[i].getErrorCode());
            System.out.println(errors[i].getLongMessage());

        }
    }
    System.out.println("token:" + checkoutResponse.getToken());

вот результат, который я получаю

Date:17/04/2012 12:33:38
CorrelationID:a7c9fe7283bd
ack :Success
token:null

Как я могу получить успех, но токен пуст? контактное лицо PayPal сообщило, что для CorrelationID уже создан токен EC: a7c9fe7283bd.

заранее спасибо.

Ваш Ответ

3   ответа
1

0

Error: User Rate Limit Exceeded

Error: User Rate Limit Exceeded

Error: User Rate Limit Exceeded

    [System.Xml.Serialization.XmlIgnoreAttribute()]
    public System.Xml.XmlElement Any {
        get {
            return this.anyField;
        }
        set {
            this.anyField = value;
        }
    }

Error: User Rate Limit Exceeded

Error: User Rate Limit Exceeded

Error: User Rate Limit Exceeded

0

Error: User Rate Limit Exceeded

<wsdl:definitions
     ns:version="89.0"
     xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
     xmlns:xs="http://www.w3.org/2001/XMLSchema"
     xmlns="http://schemas.xmlsoap.org/wsdl/" 
     ... >

Error: User Rate Limit Exceeded89.0Error: User Rate Limit Exceeded

Error: User Rate Limit Exceeded

Похожие вопросы