Skip to content

Commit

Permalink
rename Quote to ConversionQuote
Browse files Browse the repository at this point in the history
  • Loading branch information
mihaimoiseanu committed Feb 22, 2024
1 parent d848c30 commit 4d86491
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
14 changes: 7 additions & 7 deletions MangoPay/ApiConversions.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

}
2 changes: 1 addition & 1 deletion MangoPay/Quote.php → MangoPay/ConversionQuote.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use MangoPay\Libraries\EntityBase;

class Quote extends EntityBase
class ConversionQuote extends EntityBase
{
/**
* Expiration date
Expand Down
18 changes: 9 additions & 9 deletions tests/Cases/ConversionsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand Down Expand Up @@ -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;
Expand All @@ -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);

}
}

0 comments on commit 4d86491

Please sign in to comment.