Re: Re: Re: Payments Failing without shipping address

Posts: 73
Joined: 12/10/2007

I think this will work as permenant solution, though I didn't test it. Maybe someone can test for me, I kicking off for the night.

Basically replace the entire assignment of $nvp_request at about line 340 in paypal.module with the following code:

  $nvp_request = array(
    'METHOD' => 'DoDirectPayment',
    'PAYMENTACTION' => variable_get('uc_paypal_wpp_payment_action', 'Sale'),
    'IPADDRESS' => $_SERVER['REMOTE_ADDR'],
    'AMT' => uc_currency_format($amount, FALSE, FALSE, '.'),
    'CREDITCARDTYPE' => $cc_type,
    'ACCT'=>  $order->payment_details['cc_number'],
    'EXPDATE' => $expdate,
    'CVV2' => $order->payment_details['cc_cvv'],
    'FIRSTNAME' => substr($order->billing_first_name, 0, 25),
    'LASTNAME' => substr($order->billing_last_name, 0, 25),
    'STREET' => substr($order->billing_street1, 0, 100),
    'STREET2' => substr($order->billing_street2, 0, 100),
    'CITY' => substr($order->billing_city, 0, 40),
    'STATE' => uc_get_zone_code($order->billing_zone),
    'ZIP' => $order->billing_postal_code,
    'COUNTRYCODE' => $billing_country[0]['country_iso_code_2'],
    'CURRENCYCODE' => variable_get('uc_paypal_wpp_currency', 'USD'),
    'DESC' => substr($desc, 0, 127),
    'INVNUM' => $order_id .'-'. time(),
    'BUTTONSOURCE' => 'Ubercart_ShoppingCart_DP_US',
    'NOTIFYURL' => url('uc_paypal/ipn/'. $order->order_id, NULL, NULL, TRUE),
    'EMAIL' => substr($order->primary_email, 0, 127),
    'PHONENUM' => substr($order->billing_phone, 0, 20),
  );
  if (uc_cart_is_shippable()) {
    $nvp_request['SHIPTONAME'] = substr($order->delivery_first_name .' '. $order->delivery_last_name, 0, 25);
    $nvp_request['SHIPTOSTREET'] = substr($order->delivery_street1, 0, 100);
    $nvp_request['SHIPTOSTREET2'] = substr($order->delivery_street2, 0, 100);
    $nvp_request['SHIPTOCITY'] = substr($order->delivery_city, 0, 40);
    $nvp_request['SHIPTOSTATE'] = uc_get_zone_code($order->delivery_zone);
    $nvp_request['SHIPTOZIP'] = $order->delivery_postal_code;
    $nvp_request['SHIPTOCOUNTRYCODE'] = $delivery_country[0]['country_iso_code_2'];
  }

Upgraded to beta and PayPal Payments Pro does not work By: jdblank (39 replies) Fri, 01/11/2008 - 02:39