Shows details for a refund, by ID.
public static get ( string $refundId, |
||
$refundId | string | |
$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 |
Результат |
/** * @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; } }