Tips and Tricks HQ Support

Support site for Tips and Tricks HQ premium products

  • Home
  • Contact Us
  • Documentation
  • Forum Home
    • Forum
    • Forum Search
    • Forum Login
    • Forum Registration

WPSPayPalStandard.php – secure against null-values

by

Tips and Tricks HQ Support Portal › Forums › WP Photo Seller › WPSPayPalStandard.php – secure against null-values

  • This topic has 3 replies, 2 voices, and was last updated 7 years, 5 months ago by Peter.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • December 2, 2017 at 5:32 pm #14559
    DesMas
    Member

    Hi

    I noticed that in V2.2.8 the PayPal callback can still run into the problem of unexpected null values for the order to be inserted into the table.

    Therefore i suggest to secure the data-array:

    $data = array(
    'bill_first_name' => isset($pp['address_name'])?$pp['address_name']:'',
    'bill_address' => isset($pp['address_street'])?$pp['address_street']:'',
    'bill_city' => isset($pp['address_city'])?$pp['address_city']:'',
    'bill_state' => isset($pp['address_state'])?$pp['address_state']:'',
    'bill_zip' => isset($pp['address_zip'])?$pp['address_zip']:'',
    'bill_country' => isset($pp['address_country'])?$pp['address_country']:'',
    'ship_first_name' => isset($pp['address_name'])?$pp['address_name']:'',
    'ship_address' => isset($pp['address_street'])?$pp['address_street']:'',
    'ship_city' => isset($pp['address_city'])?$pp['address_city']:'',
    'ship_state' => isset($pp['address_state'])?$pp['address_state']:'',
    'ship_zip' => isset($pp['address_zip'])?$pp['address_zip']:'',
    'ship_country' => isset($pp['address_country'])?$pp['address_country']:'',
    'shipping_method' => $deliveryMethod,
    'email' => $pp['payer_email'],
    'phone' => isset($pp['contact_phone'])?$pp['contact_phone']:'',
    'shipping' => $shipping_cost,
    'tax' => isset($pp['tax'])?$pp['tax']:0,
    'subtotal' => $subtotal,
    'total' => $total,
    'coupon' => $coupon_code,
    'discount_amount' => $discount,
    'trans_id' => isset($pp['txn_id'])?$pp['txn_id']:'',
    'ordered_on' => date('Y-m-d H:i:s', WPSCommon::localTs()),
    'status' => $status,
    'ouid' => $ouid,
    'payment_method' => 'Paypal',
    'payment_status' => 'Complete',
    'share_cart_discount_amount' => $share_cart_discount,
    'price_inc_tax' => $tax_included_in_price,
    );

    What do you think about?

    December 3, 2017 at 9:41 pm #76837
    Peter
    Member

    Hi,

    Which specific variables in that array are you referring to?

    December 10, 2017 at 9:09 am #76838
    DesMas
    Member

    Hello

    I noticed the following fields given as NULL:

    – bill_state

    – ship_state

    – phone

    Every time this happens to one of the fields i get the following error in the log:

    [WPSPayPalStandard.php – line 180] Failed to insert the following into the order table: Array

    I can send you the extracted log via mail due to the personal data in it I do now want to post it here in public.

    December 11, 2017 at 2:02 am #76839
    Peter
    Member

    Ok yes I see what you mean now.

    I will add those checks in the code. Thanks for your feedback.

  • Author
    Posts
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.
Log In

Forum Related

  • Forum Home
  • Forum Search
  • Forum Registration
  • Forum Login

Support Related Forms

  • Contact Us
  • Customer Support
  • Request a Plugin Update
  • Request Fresh Download Links

Useful Links

  • Plugin Upgrade Instructions
  • WP eStore Documentation
  • WP eMember Documentation
  • WP Affiliate Platform Documentation
  • Tips and Tricks HQ Home Page
  • Our Projects

Quick Setup Video Tutorials

  • WP eStore Video Tutorial
  • WP eMember Video Tutorial
  • WP Affiliate Platform Video Tutorial
  • Lightbox Ultimate Video Tutorial

Our Other Plugins

  • WP Express Checkout
  • Stripe Payments Plugin
  • Simple Shopping Cart Plugin
  • Simple Download Monitor

Copyright © 2025 | Tips and Tricks HQ