A refund transaction. This is the resource that is returned on GET /refund
Inheritance: extends Refund
 /**
  * @depends testSerializationDeserialization
  * @param DetailedRefund $obj
  */
 public function testGetters($obj)
 {
     $this->assertEquals($obj->getCustom(), "TestSample");
     $this->assertEquals($obj->getInvoiceNumber(), "TestSample");
     $this->assertEquals($obj->getRefundToPayer(), CurrencyTest::getObject());
     $this->assertEquals($obj->getRefundToExternalFunding(), ExternalFundingTest::getObject());
     $this->assertEquals($obj->getRefundFromTransactionFee(), CurrencyTest::getObject());
     $this->assertEquals($obj->getRefundFromReceivedAmount(), CurrencyTest::getObject());
     $this->assertEquals($obj->getTotalRefundedAmount(), CurrencyTest::getObject());
 }
Example #2
0
 /**
  * Refunds a captured payment, by ID. Include an `amount` object in the JSON request body.
  *
  * @param RefundRequest $refundRequest
  * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
  * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls
  * @return DetailedRefund
  */
 public function refundCapturedPayment($refundRequest, $apiContext = null, $restCall = null)
 {
     ArgumentValidator::validate($this->getId(), "Id");
     ArgumentValidator::validate($refundRequest, 'refundRequest');
     $payLoad = $refundRequest->toJSON();
     $json = self::executeCall("/v1/payments/capture/{$this->getId()}/refund", "POST", $payLoad, null, $apiContext, $restCall);
     $ret = new DetailedRefund();
     $ret->fromJson($json);
     return $ret;
 }