/**
  * Testing adding amount to PayPal refunded amount
  */
 public function testAddRefundedAmount_NotEmpty()
 {
     $oOrderPayment = new oePayPalOrderPayment();
     $oOrderPayment->setRefundedAmount(100);
     $oOrderPayment->addRefundedAmount(100);
     $this->assertEquals(200, $oOrderPayment->getRefundedAmount());
 }
 /**
  * Update the parent transaction's refund amount.
  *
  * @param oePayPalOrderPayment $orderPaymentParent
  * @param float                $amount
  *
  * @return null
  */
 private function updateParentTransactionRefundAmount($orderPaymentParent, $amount)
 {
     $orderPaymentParent->addRefundedAmount($amount);
     $orderPaymentParent->save();
 }
Ejemplo n.º 3
0
 /**
  * Update the parent transaction in case of refund.
  *
  * @param oePayPalOrderPayment $orderPaymentParent
  * @param oePayPalOrderPayment $requestOrderPayment
  *
  * @return null
  */
 protected function updateParentTransaction($orderPaymentParent, $requestOrderPayment)
 {
     if (oePayPalIPNRequestPaymentSetter::REFUND_ACTION == $requestOrderPayment->getAction()) {
         $orderPaymentParent->addRefundedAmount($requestOrderPayment->getAmount());
         $orderPaymentParent->save();
     }
 }