Package com.ebay.sdk

Examples of com.ebay.sdk.ApiAccount


        String apiServerUrl = (String)config.get("apiServerUrl");

       if (token != null) {
           apiCredential.seteBayToken(token);
       } else if (devID != null && appID != null && certID != null) {
           ApiAccount apiAccount = new ApiAccount();
           apiAccount.setApplication(appID);
           apiAccount.setCertificate(certID);
           apiAccount.setDeveloper(devID);
           apiCredential.setApiAccount(apiAccount);
       }
       ApiContext apiContext = new ApiContext();
       apiContext.setApiCredential(apiCredential);
       apiContext.setApiServerUrl(apiServerUrl);
View Full Code Here


        String apiServerUrl = (String)config.get("apiServerUrl");

       if (token != null) {
           apiCredential.seteBayToken(token);
       } else if (devID != null && appID != null && certID != null) {
           ApiAccount apiAccount = new ApiAccount();
           apiAccount.setApplication(appID);
           apiAccount.setCertificate(certID);
           apiAccount.setDeveloper(devID);
           apiCredential.setApiAccount(apiAccount);
       }
       ApiContext apiContext = new ApiContext();
       apiContext.setApiCredential(apiCredential);
       apiContext.setApiServerUrl(apiServerUrl);
View Full Code Here

        String apiServerUrl = (String)config.get("apiServerUrl");

       if (token != null) {
           apiCredential.seteBayToken(token);
       } else if (devID != null && appID != null && certID != null) {
           ApiAccount apiAccount = new ApiAccount();
           apiAccount.setApplication(appID);
           apiAccount.setCertificate(certID);
           apiAccount.setDeveloper(devID);
           apiCredential.setApiAccount(apiAccount);
       }
       ApiContext apiContext = new ApiContext();
       apiContext.setApiCredential(apiCredential);
       apiContext.setApiServerUrl(apiServerUrl);
View Full Code Here

        String apiServerUrl = (String)config.get("apiServerUrl");

       if (token != null) {
           apiCredential.seteBayToken(token);
       } else if (devID != null && appID != null && certID != null) {
           ApiAccount apiAccount = new ApiAccount();
           apiAccount.setApplication(appID);
           apiAccount.setCertificate(certID);
           apiAccount.setDeveloper(devID);
           apiCredential.setApiAccount(apiAccount);
       }
       ApiContext apiContext = new ApiContext();
       apiContext.setApiCredential(apiCredential);
       apiContext.setApiServerUrl(apiServerUrl);
View Full Code Here

  }
 
  private void populateUI() {
      this.txtTokenData.setText(_apiContext.getApiCredential().geteBayToken());

      ApiAccount ac = _apiContext.getApiCredential().getApiAccount();

      if (this.enableApiCredentials) {
        this.txtDeveloperID.setText(ac.getDeveloper());
        this.txtApplicationID.setText(ac.getApplication());
        this.txtCertificate.setText(ac.getCertificate());
      } else {
        this.txtDeveloperID.setEnabled(false);
        this.txtApplicationID.setEnabled(false);
        this.txtCertificate.setEnabled(false);
      }
View Full Code Here

//          this.txtCertificate.getText().length() == 0) {
//        throw new Exception(
//            "Please enter the application ID, developer ID and certificate ID.");
//      }

      ApiAccount ac = _apiContext.getApiCredential().getApiAccount();
 
      ac.setApplication(this.txtApplicationID.getText());
      ac.setDeveloper(this.txtDeveloperID.getText());
      ac.setCertificate(this.txtCertificate.getText());
    }

    s = this.txtTokenData.getText();
    if( s.length() == 0 && needToken)
        throw new Exception("Please enter the API token.");
View Full Code Here

    ruNameField.setPreferredSize(new Dimension(160, 21));
  }

 
  private boolean validateApiAccount() {
    ApiAccount acc = this.apiContext.getApiCredential().getApiAccount();
    if (acc == null) return false;
    if (acc.getDeveloper().length() == 0) return false;
    if (acc.getApplication().length() == 0) return false;
    if (acc.getCertificate().length() == 0) return false;
    return true;
  }
View Full Code Here

        String tokenString = apiContext.getApiCredential().geteBayToken();
       
        //some api calls(GetTokenStatus, RevokeToken) need full credentials
        if(enableFullCredentials) {
            SOAPElement credNode = reqCred.addChildElement("Credentials", EBayConstants.EBL_PREFIX);
            ApiAccount ac = apiContext.getApiCredential().getApiAccount();
            credNode.addChildElement("AppId", EBayConstants.EBL_PREFIX).addTextNode(ac.getApplication());
            credNode.addChildElement("DevId", EBayConstants.EBL_PREFIX).addTextNode(ac.getDeveloper());
            credNode.addChildElement("AuthCert", EBayConstants.EBL_PREFIX).addTextNode(ac.getCertificate());
           
            reqCred.addChildElement("eBayAuthToken", EBayConstants.EBL_PREFIX).addTextNode(tokenString);
           
            return;
        }
       
        //some api calls(GetSessionID/FetchToken) only need Api Account
        if(needApiAccountOnly) {
            SOAPElement credNode = reqCred.addChildElement("Credentials", EBayConstants.EBL_PREFIX);
            ApiAccount ac = apiContext.getApiCredential().getApiAccount();
            credNode.addChildElement("AppId", EBayConstants.EBL_PREFIX).addTextNode(ac.getApplication());
            credNode.addChildElement("DevId", EBayConstants.EBL_PREFIX).addTextNode(ac.getDeveloper());
            credNode.addChildElement("AuthCert", EBayConstants.EBL_PREFIX).addTextNode(ac.getCertificate());
           
            //for FetchToken call, need Username if SecretID is used
            eBayAccount ec = apiContext.getApiCredential().geteBayAccount();
            if (ec != null && ec.getUsername() != null) {
              credNode.addChildElement("Username", EBayConstants.EBL_PREFIX).addTextNode(ec.getUsername());
            }
           
            return;
        }
 
        if (tokenString == null || tokenString.length() == 0) {
          SOAPElement credNode = reqCred.addChildElement("Credentials", EBayConstants.EBL_PREFIX);
          ApiAccount ac = apiContext.getApiCredential().getApiAccount();
          credNode.addChildElement("AppId", EBayConstants.EBL_PREFIX).addTextNode(ac.getApplication());
          credNode.addChildElement("DevId", EBayConstants.EBL_PREFIX).addTextNode(ac.getDeveloper());
          credNode.addChildElement("AuthCert", EBayConstants.EBL_PREFIX).addTextNode(ac.getCertificate());
        } else {
            reqCred.addChildElement("eBayAuthToken", EBayConstants.EBL_PREFIX).addTextNode(tokenString);
        }
  }
View Full Code Here

TOP

Related Classes of com.ebay.sdk.ApiAccount

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.