if ($tax > 0) { $total = $total + $tax; } } // Set payment information $payment = array('AMT' => $total, 'TAXAMT' => $tax, 'CURRENCYCODE' => CURRENCY_CODE, 'ITEMAMT' => $itemTotal, 'SHIPPINGAMT' => $shipping, 'NOTIFYURL' => $ipnUrl); Cart66Common::log('[' . basename(__FILE__) . ' - line ' . __LINE__ . "] Setting Payment Details:\n" . print_r($payment, true)); $pp->setPaymentDetails($payment); // Add cart items to PayPal $pp->populatePayPalCartItems(); // Set Express Checkout URLs $returnPage = get_page_by_path('store/express'); $returnUrl = get_permalink($returnPage->ID); $cancelPage = get_page_by_path('store/checkout'); $cancelUrl = get_permalink($cancelPage->ID); $localeCode = Cart66Common::getLocaleCode(); $ecUrls = array('RETURNURL' => $returnUrl, 'CANCELURL' => $cancelUrl, 'LOCALECODE' => $localeCode); $pp->setEcUrls($ecUrls); $response = $pp->SetExpressCheckout(); $ack = strtoupper($response['ACK']); if ('SUCCESS' == $ack || 'SUCCESSWITHWARNING' == $ack) { Cart66Session::set('PayPalProToken', $response['TOKEN']); $expressCheckoutUrl = $pp->getExpressCheckoutUrl($response['TOKEN']); wp_redirect($expressCheckoutUrl); exit; } elseif (empty($ack)) { echo '<pre>Failed to connect via curl to PayPal. The most likely cause is that your PHP installation failed to verify that the CA cert is OK</pre>'; } else { try { throw new Cart66Exception(ucwords($response['L_SHORTMESSAGE0']), 66503); } catch (Cart66Exception $e) {