-
Notifications
You must be signed in to change notification settings - Fork 174
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #119 from Toolstation/toolstation
Implementing Express gateway order request
- Loading branch information
Showing
11 changed files
with
171 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
|
||
namespace Omnipay\PayPal\Message; | ||
|
||
/** | ||
* PayPal Express Complete Order Request | ||
*/ | ||
class ExpressCompleteOrderRequest extends ExpressCompleteAuthorizeRequest | ||
{ | ||
public function getData() | ||
{ | ||
$data = parent::getData(); | ||
$data['PAYMENTREQUEST_0_PAYMENTACTION'] = 'Order'; | ||
|
||
return $data; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
|
||
namespace Omnipay\PayPal\Message; | ||
|
||
/** | ||
* PayPal Express Order Request | ||
*/ | ||
class ExpressOrderRequest extends ExpressAuthorizeRequest | ||
{ | ||
public function getData() | ||
{ | ||
$data = parent::getData(); | ||
$data['PAYMENTREQUEST_0_PAYMENTACTION'] = 'Order'; | ||
|
||
return $data; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
/** | ||
* Paypal Item | ||
*/ | ||
|
||
namespace Omnipay\PayPal; | ||
|
||
use Omnipay\Common\Item; | ||
|
||
/** | ||
* Class PayPalItem | ||
* | ||
* @package Omnipay\PayPal | ||
*/ | ||
class PayPalItem extends Item | ||
{ | ||
/** | ||
* {@inheritDoc} | ||
*/ | ||
public function getCode() | ||
{ | ||
return $this->getParameter('code'); | ||
} | ||
|
||
/** | ||
* Set the item code | ||
*/ | ||
public function setCode($value) | ||
{ | ||
return $this->setParameter('code', $value); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
/** | ||
* PayPal Item bag | ||
*/ | ||
|
||
namespace Omnipay\PayPal; | ||
|
||
use Omnipay\Common\ItemBag; | ||
|
||
/** | ||
* Class PayPalItemBag | ||
* | ||
* @package Omnipay\PayPal | ||
*/ | ||
class PayPalItemBag extends ItemBag | ||
{ | ||
/** | ||
* Add an item to the bag | ||
* | ||
* @see Item | ||
* | ||
* @param ItemInterface|array $item An existing item, or associative array of item parameters | ||
*/ | ||
public function add($item) | ||
{ | ||
if ($item instanceof ItemInterface) { | ||
$this->items[] = $item; | ||
} else { | ||
$this->items[] = new PayPalItem($item); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
HTTP/1.1 200 OK | ||
Date: Fri, 15 Feb 2013 19:21:05 GMT | ||
Server: Apache | ||
Content-Length: 292 | ||
Connection: close | ||
Content-Type: text/plain; charset=utf-8 | ||
|
||
TIMESTAMP=2013%2d02%2d15T19%3a21%3a06Z&CORRELATIONID=2b58be2b8e60e&ACK=Failure&VERSION=85%2e0&BUILD=5060305&L_ERRORCODE0=10525&L_SHORTMESSAGE0=Invalid%20Data&L_LONGMESSAGE0=This%20transaction%20cannot%20be%20processed%2e%20The%20amount%20to%20be%20charged%20is%20zero%2e&L_SEVERITYCODE0=Error |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
HTTP/1.1 200 OK | ||
Date: Fri, 15 Feb 2013 19:19:21 GMT | ||
Server: Apache | ||
Content-Length: 136 | ||
Connection: close | ||
Content-Type: text/plain; charset=utf-8 | ||
|
||
TOKEN=EC%2d42721413K79637829&TIMESTAMP=2013%2d02%2d15T19%3a19%3a21Z&CORRELATIONID=37b8b9915987c&ACK=Success&VERSION=85%2e0&BUILD=5060305 |