Skip to content

Commit

Permalink
Publish v1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
magenest-vincentdinh committed Dec 5, 2019
1 parent 6d178ba commit 6bb1d2d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
10 changes: 6 additions & 4 deletions Classes/SagepayAbstractApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,10 @@ protected function sortData()
$data = array();
foreach ($this->mandatory as $key)
{
$data[$key] = $unsorted[$key];
unset($unsorted[$key]);
if(isset($data[$key])){
$data[$key] = $unsorted[$key];
unset($unsorted[$key]);
}
}
$data += $unsorted;
$this->data = $data;
Expand All @@ -295,9 +297,9 @@ protected function checkMandatoryFields()

foreach ($this->mandatory as $value)
{
if (is_null($this->data[$value]))
if (isset($this->data[$value]) && is_null($this->data[$value]))
{
$emptyFields[] = $value;
$emptyFields[] = $value;
}
}

Expand Down
5 changes: 3 additions & 2 deletions Classes/SagepayCommon.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ static public function encryptedOrder(SagepayAbstractApi $request)
'ClientIPAddress' => $settings->getClientIPAddress(),
'TransType' => '01'
);

$query += $request->getData();

$customer = $request->getCustomer();
Expand Down Expand Up @@ -231,7 +231,7 @@ static public function encryptedOrder(SagepayAbstractApi $request)
if (!$settings->basketAsXmlDisabled())
{
$query['BasketXML'] = $basket->exportAsXml();
}
}
else
{
$query['Basket'] = $basket->exportAsXml(false);
Expand Down Expand Up @@ -292,6 +292,7 @@ static public function encryptedOrder(SagepayAbstractApi $request)
$query['TxType'] = $txType;
$query['CardType'] = 'PAYPAL';
$query['PayPalCallbackURL'] = $settings->getFullPaypalCallbackUrl() . '?vtx=' . $query['VendorTxCode'];
$query['ThreeDSNotificationURL'] = $settings->getThreeDSNotificationURL();
return $query;

case Constants::SAGEPAY_TOKEN:
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "magenest/sagepay-lib",
"description": "SagePay library for Magenest extensions",
"type": "magento2-library",
"version": "1.0.0",
"version": "1.1.0",
"license": [
"OSL-3.0"
],
Expand Down

0 comments on commit 6bb1d2d

Please sign in to comment.