Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/Issue-363' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Angell committed Dec 26, 2015
2 parents 925575a + 9c78a26 commit 8b1877d
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions classes/wc-gateway-paypal-express-angelleye.php
Original file line number Diff line number Diff line change
Expand Up @@ -871,8 +871,7 @@ function paypal_express_checkout($posted = null) {

// Also, recalculate cart totals to reveal any role-based discounts that were unavailable before registering
WC()->cart->calculate_totals();

require_once("lib/NameParser.php");
require_once( PAYPAL_FOR_WOOCOMMERCE_PLUGIN_DIR . '/classes/lib/NameParser.php' );
$parser = new FullNameParser();
$split_name = $parser->split_full_name($result['SHIPTONAME']);
$shipping_first_name = $split_name['fname'];
Expand Down Expand Up @@ -1022,7 +1021,7 @@ function paypal_express_checkout($posted = null) {
* Update meta data with session data
*/
// Parse SHIPTONAME to fist and last name
require_once("lib/NameParser.php");
require_once( PAYPAL_FOR_WOOCOMMERCE_PLUGIN_DIR . '/classes/lib/NameParser.php' );
$parser = new FullNameParser();
$split_name = $parser->split_full_name($this->get_session('shiptoname'));
$shipping_first_name = $split_name['fname'];
Expand Down Expand Up @@ -1286,12 +1285,6 @@ function CallSetExpressCheckout($paymentAmount, $returnURL, $cancelURL, $usePayP
$maxAmount = '';
}

if (isset($_POST['order_comments']) && !empty($_POST['order_comments'])) {
$is_ordernote = "0";
}else {
$is_ordernote ="1";
}


//prefill email
if (isset($posted['billing_email'])) {
Expand All @@ -1315,7 +1308,7 @@ function CallSetExpressCheckout($paymentAmount, $returnURL, $cancelURL, $usePayP
'callbackversion' => '', // The version of the Instant Update API you're using. The default is the current version.
'reqconfirmshipping' => '', // The value 1 indicates that you require that the customer's shipping address is Confirmed with PayPal. This overrides anything in the account profile. Possible values are 1 or 0.
'noshipping' => '', // The value 1 indiciates that on the PayPal pages, no shipping address fields should be displayed. Maybe 1 or 0.
'allownote' => $is_ordernote, // The value 1 indiciates that the customer may enter a note to the merchant on the PayPal page during checkout. The note is returned in the GetExpresscheckoutDetails response and the DoExpressCheckoutPayment response. Must be 1 or 0.
'allownote' => 1, // The value 1 indiciates that the customer may enter a note to the merchant on the PayPal page during checkout. The note is returned in the GetExpresscheckoutDetails response and the DoExpressCheckoutPayment response. Must be 1 or 0.
'addroverride' => '', // The value 1 indiciates that the PayPal pages should display the shipping address set by you in the SetExpressCheckout request, not the shipping address on file with PayPal. This does not allow the customer to edit the address here. Must be 1 or 0.
'localecode' => ($this->use_wp_locale_code == 'yes' && get_locale() != '') ? get_locale() : '', // Locale of pages displayed by PayPal during checkout. Should be a 2 character country code. You can retrive the country code by passing the country name into the class' GetCountryCode() function.
'pagestyle' => '', // Sets the Custom Payment Page Style for payment pages associated with this button/link.
Expand Down Expand Up @@ -1400,7 +1393,7 @@ function CallSetExpressCheckout($paymentAmount, $returnURL, $cancelURL, $usePayP
'shiptozip' => '', // Required if shipping is included. Postal code of shipping address. 20 char max.
'shiptocountrycode' => '', // Required if shipping is included. Country code of shipping address. 2 char max.
'shiptophonenum' => '', // Phone number for shipping address. 20 char max.
'notetext' => '', // Note to the merchant. 255 char max.
'notetext' => isset($posted['order_comments']) ? $posted['order_comments'] : '', // Note to the merchant. 255 char max.
'allowedpaymentmethod' => '', // The payment method type. Specify the value InstantPaymentOnly.
'paymentaction' => $this->payment_action == 'Authorization' ? 'Authorization' : 'Sale', // How you want to obtain the payment. When implementing parallel payments, this field is required and must be set to Order.
'paymentrequestid' => '', // A unique identifier of the specific payment request, which is required for parallel payments.
Expand Down

0 comments on commit 8b1877d

Please sign in to comment.