WP-e-Commerce
WP-e-Commerce copied to clipboard
Purchase log notification doesn't pick up payment gateway
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.
Temporary fix available in plugin:
https://gist.github.com/webaware/4635d476e506c95c26c66a121631a7dc
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.
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 :)
Weird cause i just tested with the test gateway and in the admin report email i get the gateway name: Payment Method: Manual Payment
That's interesting. Same here. Now try with PayPal Standard.
Same: Payment Method: PayPal Payments Standard 2.0
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