/** * @group integration */ public function testOperations() { try { $authId = AuthorizationTest::authorize(); $auth = Authorization::get($authId); $amount = new Amount(); $amount->setCurrency("USD"); $amount->setTotal("1.00"); $captr = new Capture(); $captr->setId($authId); $captr->setAmount($amount); $capt = $auth->capture($captr); $captureId = $capt->getId(); $this->assertNotNull($captureId); $refund = new Refund(); $refund->setId($captureId); $refund->setAmount($amount); $capture = Capture::get($captureId); $this->assertNotNull($capture->getId()); $retund = $capture->refund($refund); $this->assertNotNull($retund->getId()); } catch (PayPalConnectionException $ex) { $this->markTestSkipped('Tests failing because of intermittent failures in Paypal Sandbox environment.' . $ex->getMessage()); } }
public static function createRefund() { $refund = new Refund(); $refund->setCreateTime(self::$createTime); $refund->setAmount(AmountTest::createAmount()); $refund->setCaptureId(self::$captureId); $refund->setId(self::$id); $refund->setLinks(array(LinksTest::getObject())); $refund->setParentPayment(self::$parentPayment); return $refund; }
public static function createRefund() { $refund = new Refund(); $refund->setAmount(AmountTest::createAmount()); $refund->setCapture_id(self::$captureId); $refund->setCreate_time(self::$createTime); $refund->setDescription(self::$description); $refund->setId(self::$id); $refund->setLinks(array(LinkTest::createLink())); $refund->setParent_payment(self::$parentPayment); return $refund; }
public function testOperations() { $authId = AuthorizationTest::authorize(); $auth = Authorization::get($authId); $amount = new Amount(); $amount->setCurrency("USD"); $amount->setTotal("1.00"); $captr = new Capture(); $captr->setId($authId); $captr->setAmount($amount); $capt = $auth->capture($captr); $captureId = $capt->getId(); $this->assertNotNull($captureId); $refund = new Refund(); $refund->setId($captureId); $refund->setAmount($amount); $capture = Capture::get($captureId); $this->assertNotNull($capture->getId()); $retund = $capture->refund($refund); $this->assertNotNull($retund->getId()); }