Examples of DoExpressCheckoutPaymentRequestDetailsType


Examples of com.paypal.soap.api.DoExpressCheckoutPaymentRequestDetailsType

      String currencyCode = orderHeader.getSiteCurrency().getSiteCurrencyClass().getCurrency().getCurrencyCode();
      OrderEngine orderEngine = new OrderEngine(orderHeader, null);

      DoExpressCheckoutPaymentRequestType request = new DoExpressCheckoutPaymentRequestType();
     
      DoExpressCheckoutPaymentRequestDetailsType detail = new DoExpressCheckoutPaymentRequestDetailsType();
      detail.setPayerID(payerId);
      detail.setToken(token);
      detail.setPaymentAction(PaymentActionCodeType.fromString("Sale"));
   
      PaymentDetailsType paymentDetail = new PaymentDetailsType();
      BasicAmountType orderTotal = new BasicAmountType();
      orderTotal.setCurrencyID(CurrencyCodeType.fromString(currencyCode));
      orderTotal.set_value(Format.getSimpleFloat(orderHeader.getOrderTotal()));
      paymentDetail.setOrderTotal(orderTotal);

      BasicAmountType priceTotal = new BasicAmountType();
      priceTotal.setCurrencyID(CurrencyCodeType.fromString(currencyCode));
      priceTotal.set_value(Format.getSimpleFloat(orderEngine.getOrderPriceTotal() - orderEngine.getOrderPriceDiscountTotal()));
      paymentDetail.setItemTotal(priceTotal);

      BasicAmountType taxTotal = new BasicAmountType();
      taxTotal.setCurrencyID(CurrencyCodeType.fromString(currencyCode));
      taxTotal.set_value(Format.getSimpleFloat(orderEngine.getOrderTaxTotal()));
      paymentDetail.setTaxTotal(taxTotal);

      float total = orderHeader.getShippingTotal() - orderHeader.getShippingDiscountTotal();
      BasicAmountType shippingTotal = new BasicAmountType();
      shippingTotal.setCurrencyID(CurrencyCodeType.fromString(currencyCode));
      shippingTotal.set_value(Format.getSimpleFloat(total));
      paymentDetail.setShippingTotal(shippingTotal);
/*
      Vector<PaymentDetailsItemType> paymentItems = new Vector<PaymentDetailsItemType>();
      Iterator<?> iterator = orderHeader.getOrderItemDetails().iterator();
      while (iterator.hasNext()) {
        OrderItemDetail orderItemDetail = (OrderItemDetail) iterator.next();
        PaymentDetailsItemType paymentItem = new PaymentDetailsItemType();
        Item item = orderItemDetail.getItem();
        String itemDesc = orderItemDetail.getItemOrderQty()  + " x " + item.getItemShortDesc();
        if (item.getItemShortDesc1().length() > 0) {
          itemDesc += ", " + item.getItemShortDesc1();
        }
        paymentItem.setName(itemDesc);
        paymentItem.setNumber(item.getItemNum());
        paymentItem.setQuantity(BigInteger.valueOf((long) 1));
       
        BasicAmountType itemPriceTotal = new BasicAmountType();
        itemPriceTotal.setCurrencyID(CurrencyCodeType.fromString(currencyCode));
        itemPriceTotal.set_value(Format.getFloatObj(orderItemDetail.getItemDetailAmount() - orderItemDetail.getItemDetailDiscountAmount()));
        paymentItem.setAmount(itemPriceTotal);

        Iterator<?> taxIterator<?> = orderItemDetail.getOrderDetailTaxes().iterator();
        float taxAmount = 0;
        while (taxIterator.hasNext()) {
          OrderDetailTax orderItemTax = (OrderDetailTax) taxIterator.next();
          taxAmount += orderItemTax.getTaxAmount();
        }
        BasicAmountType itemTaxTotal = new BasicAmountType();
        itemTaxTotal.setCurrencyID(CurrencyCodeType.fromString(currencyCode));
        itemTaxTotal.set_value(Format.getFloat(taxAmount));
        paymentItem.setTax(itemTaxTotal);
        paymentItems.add(paymentItem);
      }
      float shippingAmount = orderHeader.getShippingTotal() - orderHeader.getShippingDiscountTotal();
      if (shippingAmount > 0) {
        PaymentDetailsItemType paymentItem = new PaymentDetailsItemType();
        paymentItem.setName("Shipping");
        paymentItem.setNumber("");
        paymentItem.setQuantity(BigInteger.valueOf((long) 1));
       
        BasicAmountType itemPriceTotal = new BasicAmountType();
        itemPriceTotal.setCurrencyID(CurrencyCodeType.fromString(currencyCode));
        itemPriceTotal.set_value(Format.getFloatObj(shippingAmount));
        paymentItem.setAmount(itemPriceTotal);

        Iterator<?> taxIterator<?> = orderHeader.getOrderTaxes().iterator();
        float taxAmount = 0;
        while (taxIterator.hasNext()) {
          OrderDetailTax orderItemTax = (OrderDetailTax) taxIterator.next();
          if (orderItemTax.getOrderItemDetail() != null) {
            continue;
          }
          taxAmount += orderItemTax.getTaxAmount();
        }
        BasicAmountType itemTaxTotal = new BasicAmountType();
        itemTaxTotal.setCurrencyID(CurrencyCodeType.fromString(currencyCode));
        itemTaxTotal.set_value(Format.getFloat(taxAmount));
        paymentItem.setTax(itemTaxTotal);
        paymentItems.add(paymentItem);
      }
     
      PaymentDetailsItemType paymentDetailsItemTypes[] = new PaymentDetailsItemType[paymentItems.size()];
      paymentItems.copyInto(paymentDetailsItemTypes);
*/
//      paymentDetail.setPaymentDetailsItem(paymentDetailsItemTypes);
     
      detail.setPaymentDetails(0, paymentDetail);
//      detail.setPaymentDetails(paymentDetail);

      request.setDoExpressCheckoutPaymentRequestDetails(detail);
     
      DoExpressCheckoutPaymentResponseType response = (DoExpressCheckoutPaymentResponseType) caller.call("DoExpressCheckoutPayment", request);
View Full Code Here

Examples of eBLBaseComponents.apis.ebay.DoExpressCheckoutPaymentRequestDetailsType

      dpReq.getDoDirectPaymentRequestDetails().getPaymentDetails().setButtonSource(JavaCommerce.VERSION);
    }
    else if (_request instanceof DoExpressCheckoutPaymentRequestType) {
      DoExpressCheckoutPaymentRequestType ecReq = (DoExpressCheckoutPaymentRequestType) _request;
      if (ecReq.getDoExpressCheckoutPaymentRequestDetails() == null) {
        ecReq.setDoExpressCheckoutPaymentRequestDetails(new DoExpressCheckoutPaymentRequestDetailsType());
      }
      if (ecReq.getDoExpressCheckoutPaymentRequestDetails().getPaymentDetails() == null) {
        ecReq.getDoExpressCheckoutPaymentRequestDetails().setPaymentDetails(new PaymentDetailsType());
      }
      if (LOG.isDebugEnabled()) {
View Full Code Here

Examples of eBLBaseComponents.apis.ebay.DoExpressCheckoutPaymentRequestDetailsType

   * @param _request
   * @param _response
   * @throws ServletException
   */
  protected final void runDoExpressCheckoutPayment(HttpServletRequest _request, HttpServletResponse _response) throws ServletException {
    DoExpressCheckoutPaymentRequestDetailsType request = APIUtil
        .buildDoExpressCheckoutPaymentDetailsRequest(_request);
    APICredential credentials;
    try {
      credentials = getAPICredentials(_request);
    } catch (APIException e) {
View Full Code Here

Examples of eBLBaseComponents.apis.ebay.DoExpressCheckoutPaymentRequestDetailsType

    return address;
  }

  public static final DoExpressCheckoutPaymentRequestDetailsType buildDoExpressCheckoutPaymentDetailsRequest(
      HttpServletRequest _request) {
    DoExpressCheckoutPaymentRequestDetailsType request = new DoExpressCheckoutPaymentRequestDetailsType();
    PaymentDetailsType details = buildPaymentDetails(_request);
    request.setPaymentDetails(details);
   
    if (_request.getParameter("payerID") != null) {
      request.setPayerID(_request.getParameter("payerID"));
    }
    if (_request.getParameter(PARAM_PAYMENT_ACTION) != null) {
      request.setPaymentAction(PaymentActionCodeType.fromString(_request
          .getParameter(PARAM_PAYMENT_ACTION)));
    }
    if (_request.getParameter(PARAM_TOKEN) != null) {
      request.setToken(_request.getParameter(PARAM_TOKEN));
    }
    return request;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.