Skip to content

Change return value of getRedirectType to empty array instead of null #186

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Message/ExpressAuthorizeResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function getRedirectMethod()

public function getRedirectData()
{
return null;
return array();
}

protected function getRedirectQueryParameters()
Expand Down
4 changes: 2 additions & 2 deletions src/Message/RestAuthorizeResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,10 @@ public function getRedirectMethod()
/**
* Gets the redirect form data array, if the redirect method is POST.
*
* @return null
* @return array
*/
public function getRedirectData()
{
return null;
return array();
}
}
2 changes: 1 addition & 1 deletion tests/Message/ExpressAuthorizeResponseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function testExpressPurchaseSuccess()
$this->assertFalse($response->isSuccessful());
$this->assertSame('EC-42721413K79637829', $response->getTransactionReference());
$this->assertNull($response->getMessage());
$this->assertNull($response->getRedirectData());
$this->assertEquals(array(), $response->getRedirectData());
$this->assertSame('https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_express-checkout&useraction=commit&token=EC-42721413K79637829', $response->getRedirectUrl());
$this->assertSame('GET', $response->getRedirectMethod());
}
Expand Down
4 changes: 2 additions & 2 deletions tests/Message/ExpressInContextAuthorizeResponseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function testExpressPurchaseSuccess()
$this->assertFalse($response->isSuccessful());
$this->assertSame('EC-42721413K79637829', $response->getTransactionReference());
$this->assertNull($response->getMessage());
$this->assertNull($response->getRedirectData());
$this->assertEquals(array(), $response->getRedirectData());
$this->assertSame('https://www.sandbox.paypal.com/checkoutnow?useraction=commit&token=EC-42721413K79637829', $response->getRedirectUrl());
$this->assertSame('GET', $response->getRedirectMethod());
}
Expand All @@ -42,4 +42,4 @@ public function testExpressPurchaseFailure()
$this->assertNull($response->getTransactionReference());
$this->assertSame('This transaction cannot be processed. The amount to be charged is zero.', $response->getMessage());
}
}
}
4 changes: 2 additions & 2 deletions tests/Message/RestAuthorizeResponseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ public function testRestPurchaseWithoutCardSuccess()
$this->assertSame('PAY-3TJ47806DA028052TKTQGVYI', $response->getTransactionReference());
$this->assertNull($response->getMessage());

$this->assertNull($response->getRedirectData());
$this->assertEquals(array(), $response->getRedirectData());
$this->assertSame('GET', $response->getRedirectMethod());
$this->assertSame('https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=EC-5KV58254GL528393N', $response->getRedirectUrl());
}
}
}