get() public static method

Shows details for a refund, by ID.
public static get ( string $refundId, ApiContext $apiContext = null, PayPalRestCall $restCall = null ) : Refund
$refundId string
$apiContext PayPal\Rest\ApiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials.
$restCall PayPalRestCall is the Rest Call Service that is used to make rest calls
return Refund
Example #1
0
 /**
  * @dataProvider mockProvider
  * @param Refund $obj
  */
 public function testGet($obj, $mockApiContext)
 {
     $mockPPRestCall = $this->getMockBuilder('\\PayPal\\Transport\\PayPalRestCall')->disableOriginalConstructor()->getMock();
     $mockPPRestCall->expects($this->any())->method('execute')->will($this->returnValue(RefundTest::getJson()));
     $result = $obj->get("refundId", $mockApiContext, $mockPPRestCall);
     $this->assertNotNull($result);
 }
 function get_transaction($id)
 {
     // auth
     $apiContext = $this->apiContext();
     try {
         $payment = Sale::get($id, $apiContext);
         $valid = true;
     } catch (Exception $ex) {
         $this->LoggingManager->log(print_r($ex, true), 'DEBUG');
         $valid = false;
     }
     if ($valid === true) {
         return $payment;
     }
     try {
         $payment = Authorization::get($id, $apiContext);
         $valid = true;
     } catch (Exception $ex) {
         $this->LoggingManager->log(print_r($ex, true), 'DEBUG');
         $valid = false;
     }
     if ($valid === true) {
         return $payment;
     }
     try {
         $payment = Capture::get($id, $apiContext);
         $valid = true;
     } catch (Exception $ex) {
         $this->LoggingManager->log(print_r($ex, true), 'DEBUG');
         $valid = false;
     }
     if ($valid === true) {
         return $payment;
     }
     try {
         $payment = Refund::get($id, $apiContext);
         $valid = true;
     } catch (Exception $ex) {
         $this->LoggingManager->log(print_r($ex, true), 'DEBUG');
         $valid = false;
     }
     if ($valid === true) {
         return $payment;
     }
 }