Skip to content

Commit

Permalink
Client interface - access the form URL through the Response message.
Browse files Browse the repository at this point in the history
  • Loading branch information
judgej committed Aug 18, 2016
1 parent f4eaf30 commit 6d37b46
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,7 @@ This provides the following data to feed into your client:

~~~php
// The endpoint used to check the card details - GET or POST can be used.
$endpoint = $request->getEndpoint();
$endpoint = $response->getRedirectUrl();

// The additional data that must be included with the card data.
// This will be an array that can be JSON encoded for the client JavaScript to use:
Expand Down
5 changes: 3 additions & 2 deletions src/Message/ShopClientAuthorizeResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,13 @@ public function isRedirect()
}

/**
* The URL the form will POST to.
* The URL the form data will POST to.
*/
public function getRedirectUrl()
{
return $this->postUrl;
return $this->request->getEndpoint();
}

public function getRedirectMethod()
{
return 'POST';
Expand Down
19 changes: 18 additions & 1 deletion src/Message/ShopClientCardCheckResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

use Omnipay\Common\Message\RedirectResponseInterface;

class ShopClientCardCheckResponse extends AbstractResponse
class ShopClientCardCheckResponse extends AbstractResponse implements RedirectResponseInterface
{
public function isSuccessful()
{
Expand Down Expand Up @@ -37,4 +37,21 @@ public function getRedirectData()
{
return $this->getData();
}

/**
* Actually either POST or GET will work.
* This is over a secure connection, so GET won't be cached.
*/
public function getRedirectMethod()
{
return 'POST';
}

/**
* The URL the form data will POST to.
*/
public function getRedirectUrl()
{
return $this->request->getEndpoint();
}
}

0 comments on commit 6d37b46

Please sign in to comment.