WP-e-Commerce icon indicating copy to clipboard operation
WP-e-Commerce copied to clipboard

Purchase log notification doesn't pick up payment gateway

Open webaware opened this issue 9 years ago • 7 comments

The purchase log notifications are not picking up the payment gateway, so notification emails report nothing for Payment Gateway.

This is because the purchase log notification is asking for gateway_name when the gateway name element is gateway.

webaware avatar Sep 02 '16 03:09 webaware

Temporary fix available in plugin:

https://gist.github.com/webaware/4635d476e506c95c26c66a121631a7dc

webaware avatar Sep 02 '16 03:09 webaware

Interesting.

In fact, gateway_name is set as a meta_property, and the get() function of the object should be falling back to that meta property after finding that it doesn't exist as a first-class property of the object.

Is that not your experience? I'd be curious what the $log->get_meta() method returns for you.

JustinSainton avatar Sep 02 '16 03:09 JustinSainton

Indeed it does. Curious. When called from WPSC_Purchase_Log_Notification::get_common_args() it's setting the payment_method element to nothing. When I call it from the wpsc_purchase_log_notification_common_args filter like this, it gets the value:

$gateway_name = $notification->get_purchase_log()->get('gateway_name');

Have fun :)

webaware avatar Sep 02 '16 03:09 webaware

Weird cause i just tested with the test gateway and in the admin report email i get the gateway name: Payment Method: Manual Payment

mihaijoldis avatar Sep 15 '16 09:09 mihaijoldis

That's interesting. Same here. Now try with PayPal Standard.

webaware avatar Sep 15 '16 10:09 webaware

Same: Payment Method: PayPal Payments Standard 2.0

mihaijoldis avatar Sep 15 '16 10:09 mihaijoldis

You had me doubting myself, so I installed a clean WP 4.6.1 using wp-cli and installed plugins from the WP plugins page.

With only wp-e-commerce activated, I still get a blank Payment Method: line in the Transaction Report email when using the PayPal Payments Standard 2.0 integration. I also enabled my eWAY Payment Gateway plugin and I get the same result with it.

I originally saw this on the following environment:

  • WP 4.6 (now 4.6.1) multisite
  • nginx with back end php-fpm / PHP 7.0.8
  • memcached

The test site I built just now:

  • WP 4.6 stand-alone
  • nginx with back end Apache / PHP 5.5
  • no persistent object cache

webaware avatar Sep 16 '16 02:09 webaware