diff --git a/MangoPay/ApiConversions.php b/MangoPay/ApiConversions.php index ee6801d4..ad99f0ef 100644 --- a/MangoPay/ApiConversions.php +++ b/MangoPay/ApiConversions.php @@ -43,22 +43,22 @@ public function GetInstantConversion($id) /** * This call guarantees a conversion rate to let you Create a Quoted Conversion. - * @param Quote $quote - * @return Quote + * @param ConversionQuote $quote + * @return ConversionQuote */ - public function CreateQuote($quote) + public function CreateConversionQuote($quote) { - return $this->CreateObject('create_conversion_quote', $quote, '\MangoPay\Quote'); + return $this->CreateObject('create_conversion_quote', $quote, '\MangoPay\ConversionQuote'); } /** * This endpoint allows the platform to get the details of a quote * @param string $quoteId - * @return Quote + * @return ConversionQuote */ - public function GetQuote($quoteId) + public function GetConversionQuote($quoteId) { - return $this->GetObject('get_conversion_quote', '\MangoPay\Quote', $quoteId); + return $this->GetObject('get_conversion_quote', '\MangoPay\ConversionQuote', $quoteId); } } diff --git a/MangoPay/Quote.php b/MangoPay/ConversionQuote.php similarity index 94% rename from MangoPay/Quote.php rename to MangoPay/ConversionQuote.php index 4293b940..54e0ddcf 100644 --- a/MangoPay/Quote.php +++ b/MangoPay/ConversionQuote.php @@ -4,7 +4,7 @@ use MangoPay\Libraries\EntityBase; -class Quote extends EntityBase +class ConversionQuote extends EntityBase { /** * Expiration date diff --git a/tests/Cases/ConversionsTest.php b/tests/Cases/ConversionsTest.php index d045a67c..372190d8 100644 --- a/tests/Cases/ConversionsTest.php +++ b/tests/Cases/ConversionsTest.php @@ -2,9 +2,9 @@ namespace MangoPay\Tests\Cases; +use MangoPay\ConversionQuote; use MangoPay\InstantConversion; use MangoPay\Money; -use MangoPay\Quote; use MangoPay\TransactionType; class ConversionsTest extends Base @@ -41,8 +41,8 @@ public function test_getInstantConversion() $this->assertSame(TransactionType::Conversion, $returnedInstantConversion->Type); } - public function test_createQuote(){ - $response = $this->createQuote(); + public function test_createConversionQuote(){ + $response = $this->createConversionQuote(); $this->assertNotNull($response); $this->assertNotNull($response->DebitedFunds->Amount); @@ -51,9 +51,9 @@ public function test_createQuote(){ $this->assertSame('ACTIVE', $response->Status); } - public function test_getQuote(){ - $quote = $this->createQuote(); - $response = $this->_api->Conversions->GetQuote($quote->Id); + public function test_getConversionQuote(){ + $quote = $this->createConversionQuote(); + $response = $this->_api->Conversions->GetConversionQuote($quote->Id); $this->assertNotNull($response); $this->assertNotNull($response->DebitedFunds->Amount); @@ -93,10 +93,10 @@ private function createInstantConversion() return $this->_api->Conversions->CreateInstantConversion($instantConversion); } - private function createQuote() + private function createConversionQuote() { - $quote = new Quote(); + $quote = new ConversionQuote(); $creditedFunds = new Money(); $creditedFunds->Currency = 'USD'; $quote->CreditedFunds = $creditedFunds; @@ -109,7 +109,7 @@ private function createQuote() $quote->Duration = 90; $quote->Tag = "Created using the Mangopay PHP SDK"; - return $this->_api->Conversions->CreateQuote($quote); + return $this->_api->Conversions->CreateConversionQuote($quote); } }