Update payments API to v1.9

This commit is contained in:
mrak and sdcoffey
2016-10-25 17:29:48 -05:00
committed by jaypatel512 and sdcoffey
parent 7c5ea8b997
commit c2947ff409
92 changed files with 1583 additions and 973 deletions

View File

@@ -0,0 +1,66 @@
<?php
namespace PayPal\Test\Api;
use PayPal\Api\RefundRequest;
/**
* Class RefundRequest
*
* @package PayPal\Test\Api
*/
class RefundRequestTest extends \PHPUnit_Framework_TestCase
{
/**
* Gets Json String of Object RefundRequest
* @return string
*/
public static function getJson()
{
return '{"amount":' .AmountTest::getJson() . ',"description":"TestSample","refund_type":"TestSample","refund_source":"TestSample","reason":"TestSample","invoice_number":"TestSample","refund_advice":true,"is_non_platform_transaction":"TestSample"}';
}
/**
* Gets Object Instance with Json data filled in
* @return RefundRequest
*/
public static function getObject()
{
return new RefundRequest(self::getJson());
}
/**
* Tests for Serialization and Deserialization Issues
* @return RefundRequest
*/
public function testSerializationDeserialization()
{
$obj = new RefundRequest(self::getJson());
$this->assertNotNull($obj);
$this->assertNotNull($obj->getAmount());
$this->assertNotNull($obj->getDescription());
$this->assertNotNull($obj->getRefundSource());
$this->assertNotNull($obj->getReason());
$this->assertNotNull($obj->getInvoiceNumber());
$this->assertNotNull($obj->getRefundAdvice());
$this->assertEquals(self::getJson(), $obj->toJson());
return $obj;
}
/**
* @depends testSerializationDeserialization
* @param RefundRequest $obj
*/
public function testGetters($obj)
{
$this->assertEquals($obj->getAmount(), AmountTest::getObject());
$this->assertEquals($obj->getDescription(), "TestSample");
$this->assertEquals($obj->getRefundSource(), "TestSample");
$this->assertEquals($obj->getReason(), "TestSample");
$this->assertEquals($obj->getInvoiceNumber(), "TestSample");
$this->assertEquals($obj->getRefundAdvice(), true);
}
}