Package com.paypal.soap.api

Examples of com.paypal.soap.api.SetExpressCheckoutRequestDetailsType


  public void payPalAuthorizePayment(OrderHeader orderHeader, HttpServletRequest request) throws AuthorizationException, PaymentException, Exception {
    CallerServices caller = new CallerServices();
      caller.setAPIProfile(createProfile());
   
    SetExpressCheckoutRequestType requestHeader = new SetExpressCheckoutRequestType();
    SetExpressCheckoutRequestDetailsType requestDetail = new SetExpressCheckoutRequestDetailsType();
    BasicAmountType ppAmount = new BasicAmountType();
    ppAmount.setCurrencyID(CurrencyCodeType.fromString(orderHeader.getSiteCurrency().getSiteCurrencyClass().getCurrency().getCurrencyCode()));
    float verificationTotal = orderHeader.getOrderTotal() * (extraVerificationPercent + 100) / 100 + extraVerificationAmount;
    ppAmount.set_value(Format.getSimpleFloat(verificationTotal));
    requestDetail.setOrderTotal(ppAmount);
    requestDetail.setPaymentAction(PaymentActionCodeType.fromString("Authorization"));

    ContentBean contentBean = ContentLookupDispatchAction.getContentBean(request);
    requestDetail.setReturnURL(Utility.getSecureURLPrefix(siteDomain) +
                   "/" + ApplicationGlobal.getContextPath() +
                   "/content/checkout/shoppingCartPaymentCallBack.do" +
                   "?process=list" +
                   "&prefix=" + contentBean.getSiteDomain().getSiteDomainPrefix()
                   );
    requestDetail.setCancelURL(Utility.getSecureURLPrefix(siteDomain) +
                   "/" + ApplicationGlobal.getContextPath() +
                   "/content/checkout/shoppingCartCancelCheckout.do?" +
                   "process=cancel" +
                   "&prefix=" + contentBean.getSiteDomain().getSiteDomainPrefix()
                   );
   
    // TODO Park - more customer information
    requestDetail.setOrderDescription("");
    requestDetail.setCustom("");
   
    requestHeader.setSetExpressCheckoutRequestDetails(requestDetail);

    SetExpressCheckoutResponseType response = (SetExpressCheckoutResponseType) caller.call("SetExpressCheckout", requestHeader);
    if (!response.getAck().equals(AckCodeType.Success)) {
View Full Code Here

TOP

Related Classes of com.paypal.soap.api.SetExpressCheckoutRequestDetailsType

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.