Skip to content

Commit

Permalink
Merge pull request #3 from Jonston/master
Browse files Browse the repository at this point in the history
Create orderType param
  • Loading branch information
num8er authored Sep 5, 2019
2 parents 9d32153 + 9cc33d3 commit 9f2dcc3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
5 changes: 3 additions & 2 deletions src/TranzWarePaymentGatewayRequestFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,16 +108,17 @@ final public function setDebugFile($path_to_file)
* @param float $amount
* @param string $currency
* @param string $description
*
* @param string $orderType
* @return TranzWarePaymentGatewayOrderRequest
*/
final public function createOrderRequest($amount, $currency, $description = '')
final public function createOrderRequest($amount, $currency, $description = '', $orderType = '')
{
$request = new TranzWarePaymentGatewayOrderRequest(
$this->getUrlProvider()->getGatewayUrl(),
$this->getUrlProvider()->getOnOrderApprovedUrl(),
$this->getUrlProvider()->getOnOrderDeclinedUrl(),
$this->getUrlProvider()->getOnOrderCanceledUrl(),
$orderType,
$this->MERCHANT_ID,
$amount,
$currency,
Expand Down
2 changes: 1 addition & 1 deletion src/requests/OrderRequestBodyTemplate.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<Operation>CreateOrder</Operation>
<Language>{{lang}}</Language>
<Order>
<OrderType>Purchase</OrderType>
<OrderType>{{orderType}}</OrderType>
<Merchant>{{merchantId}}</Merchant>
<Amount>{{amount}}</Amount>
<Currency>{{currency}}</Currency>
Expand Down
6 changes: 4 additions & 2 deletions src/requests/TranzWarePaymentGatewayOrderRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class TranzWarePaymentGatewayOrderRequest implements TranzWarePaymentGatewayRequ
* TranzWarePaymentGatewayOrderRequest constructor.
*
* @param string $requestUrl
* @param string $orderType
* @param string $approvalUrl
* @param string $declineUrl
* @param string $cancelUrl
Expand All @@ -23,11 +24,12 @@ class TranzWarePaymentGatewayOrderRequest implements TranzWarePaymentGatewayRequ
* @param string $currency
* @param string $description
* @param string $lang
* @param string $debugToFile
*/
public function __construct($requestUrl, $approvalUrl, $declineUrl, $cancelUrl, $merchantId, $amount, $currency, $description = '', $lang = 'EN', $debugToFile = null)
public function __construct($requestUrl, $approvalUrl, $declineUrl, $cancelUrl, $orderType, $merchantId, $amount, $currency, $description = '', $lang = 'EN', $debugToFile = null)
{
$this->requestAttributes =
compact('requestUrl', 'approvalUrl', 'declineUrl', 'cancelUrl', 'merchantId', 'amount', 'currency', 'description', 'lang');
compact('requestUrl', 'approvalUrl', 'declineUrl', 'cancelUrl', 'orderType', 'merchantId', 'amount', 'currency', 'description', 'lang');
$this->debugToFile = $debugToFile;
}

Expand Down

0 comments on commit 9f2dcc3

Please sign in to comment.