Merge remote-tracking branch 'upstream/4.6' into 4.6-master-2015-10-14-11-04-09
[civicrm-core.git] / CRM / Core / Payment / PayPalImpl.php
index e513bace19376ec2ec0350cca74a26455d4de2a2..0aa2061ea6c2630839c32d33b2a9b13e5695cc0d 100644 (file)
@@ -553,6 +553,7 @@ class CRM_Core_Payment_PayPalImpl extends CRM_Core_Payment {
     $result = $this->invokeAPI($args);
     return array(
       'fee_amount' => $result['feeamt'],
+      'net_amount' => $params['gross_amount'] - $result['feeamt'],
     );
   }
 
@@ -575,7 +576,7 @@ class CRM_Core_Payment_PayPalImpl extends CRM_Core_Payment {
         $error[] = ts('Password is not set in the Administer » System Settings » Payment Processors.');
       }
     }
-    if (!$this->_paymentProcessor['user_name']) {
+    if (empty($this->_paymentProcessor['user_name'])) {
       $error[] = ts('User Name is not set in the Administer » System Settings » Payment Processors.');
     }