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)) {
throw new PaymentException(response.getAck().getValue().toString());
}