Skip to content

Commit

Permalink
PLGCSCS-145: Add Pay After Delivery - BNPL_MF. Remove issuers from iDEAL
Browse files Browse the repository at this point in the history
  • Loading branch information
danielcivit committed Oct 9, 2024
1 parent cc91e4f commit 3e3cdf5
Show file tree
Hide file tree
Showing 19 changed files with 157 additions and 376 deletions.
70 changes: 0 additions & 70 deletions src/app/lib/other/smarty/plugins/block.msp_issuers.php

This file was deleted.

70 changes: 0 additions & 70 deletions src/app/lib/other/templater/plugins/block.msp_issuers.php

This file was deleted.

This file was deleted.

80 changes: 13 additions & 67 deletions src/app/payments/MultiSafepay.combined.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ class MultiSafepay
'phone' => '',
'email' => '',
'gender' => '',
'issuer' => ''
);
var $plugin = array(
'shop' => '',
Expand Down Expand Up @@ -215,30 +214,6 @@ function checkSettings()
$this->merchant['site_code'] = trim($this->merchant['site_code']);
}

public function getIdealIssuers()
{
$this->request_xml = $this->createIdealIssuersRequest();
$this->api_url = $this->getApiUrl();
$this->reply_xml = $this->xmlPost($this->api_url, $this->request_xml);
$issuers = $this->parseXmlResponse($this->reply_xml);


return $issuers;
}

function createIdealIssuersRequest()
{
$request = '<?xml version="1.0" encoding="UTF-8"?>
<idealissuers ua="iDeal Issuers Request">
<merchant>
<account>' . $this->xmlEscape($this->merchant['account_id']) . '</account>
<site_id>' . $this->xmlEscape($this->merchant['site_id']) . '</site_id>
<site_secure_code>' . $this->xmlEscape($this->merchant['site_code']) . '</site_secure_code>
</merchant>
</idealissuers>';
return $request;
}

/*
* Starts a transaction and returns the payment url
*/
Expand Down Expand Up @@ -589,27 +564,12 @@ function getGateways()
$rootNode['gateways']['gateway'] = $xml_gateways;
}

// get gatesways
// get gateways
$gateways = array();
foreach ($rootNode['gateways']['gateway'] as $xml_gateway) {
$gateway = array();
$gateway['id'] = $xml_gateway['id']['VALUE'];
$gateway['description'] = $xml_gateway['description']['VALUE'];

// issuers
if (isset($xml_gateway['issuers'])) {
$issuers = array();

foreach ($xml_gateway['issuers']['issuer'] as $xml_issuer) {
$issuer = array();
$issuer['id'] = $xml_issuer['id']['VALUE'];
$issuer['description'] = $xml_issuer['description']['VALUE'];
$issuers[$issuer['id']] = $issuer;
}

$gateway['issuers'] = $issuers;
}

$gateways[$gateway['id']] = $gateway;
}

Expand All @@ -623,12 +583,6 @@ function getGateways()

function createTransactionRequest()
{
// issuer attribute
$issuer = "";
if (!empty($this->issuer)) {
$issuer = ' issuer="' . $this->xmlEscape($this->issuer) . '"';
}

$request = '<?xml version="1.0" encoding="UTF-8"?>
<redirecttransaction ua="' . $this->plugin_name . ' ' . $this->version . '">
<merchant>
Expand Down Expand Up @@ -690,7 +644,7 @@ function createTransactionRequest()
<manual>' . $this->xmlEscape($this->transaction['manual']) . '</manual>
<daysactive>' . $this->xmlEscape($this->transaction['daysactive']) . '</daysactive>
<secondsactive>' . $this->xmlEscape($this->transaction['secondsactive']) . '</secondsactive>
<gateway' . $issuer . '>' . $this->xmlEscape($this->transaction['gateway']) . '</gateway>
<gateway>' . $this->xmlEscape($this->transaction['gateway']) . '</gateway>
</transaction>
<signature>' . $this->xmlEscape($this->signature) . '</signature>
</redirecttransaction>';
Expand All @@ -701,17 +655,6 @@ function createTransactionRequest()
function createDirectXMLTransactionRequest()
{
$this->cart_xml = $this->cart->GetXML();
$issuer = "";
if (!empty($this->issuer)) {
$issuer = ' issuer="' . $this->xmlEscape($this->issuer) . '"';
}
if ($this->extravars != '') {
$gatewayinfo = '<gatewayinfo>
<issuerid>' . $this->extravars . '</issuerid>
</gatewayinfo>';
} else {
$gatewayinfo = '';
}

$request = '<?xml version="1.0" encoding="UTF-8"?>
<directtransaction ua="' . $this->plugin_name . ' ' . $this->version . '">
Expand All @@ -727,7 +670,7 @@ function createDirectXMLTransactionRequest()
<manual>' . $this->xmlEscape($this->transaction['manual']) . '</manual>
<daysactive>' . $this->xmlEscape($this->transaction['daysactive']) . '</daysactive>
<secondsactive>' . $this->xmlEscape($this->transaction['secondsactive']) . '</secondsactive>
<gateway' . $issuer . '>' . $this->xmlEscape($this->transaction['gateway']) . '</gateway>
<gateway>' . $this->xmlEscape($this->transaction['gateway']) . '</gateway>
</transaction>
<merchant>
<account>' . $this->xmlEscape($this->merchant['account_id']) . '</account>
Expand Down Expand Up @@ -776,7 +719,6 @@ function createDirectXMLTransactionRequest()
<phone>' . $this->xmlEscape($this->delivery['phone']) . '</phone>
<email>' . $this->xmlEscape($this->delivery['email']) . '</email>
</customer-delivery>
' . $gatewayinfo . '
' . $this->cart_xml . '
<signature>' . $this->xmlEscape($this->signature) . '</signature>
</directtransaction>';
Expand All @@ -786,10 +728,6 @@ function createDirectXMLTransactionRequest()

function createDirectBankTransferTransactionRequest()
{
$issuer = "";
if (!empty($this->issuer)) {
$issuer = ' issuer="' . $this->xmlEscape($this->issuer) . '"';
}
$request = '<?xml version="1.0" encoding="UTF-8"?>
<directtransaction ua="' . $this->plugin_name . ' ' . $this->version . '">
<transaction>
Expand All @@ -804,7 +742,7 @@ function createDirectBankTransferTransactionRequest()
<manual>' . $this->xmlEscape($this->transaction['manual']) . '</manual>
<daysactive>' . $this->xmlEscape($this->transaction['daysactive']) . '</daysactive>
<secondsactive>' . $this->xmlEscape($this->transaction['secondsactive']) . '</secondsactive>
<gateway' . $issuer . '>' . $this->xmlEscape($this->transaction['gateway']) . '</gateway>
<gateway>' . $this->xmlEscape($this->transaction['gateway']) . '</gateway>
</transaction>
<merchant>
<account>' . $this->xmlEscape($this->merchant['account_id']) . '</account>
Expand Down Expand Up @@ -960,7 +898,6 @@ function createCheckoutRequest()
<bankaccount>' . $this->xmlEscape($this->gatewayinfo['bankaccount']) . '</bankaccount>
<phone>' . $this->xmlEscape($this->gatewayinfo['phone']) . '</phone>
<email>' . $this->xmlEscape($this->gatewayinfo['email']) . '</email>
<issuerid>' . $this->xmlEscape($this->gatewayinfo['issuer']) . '</issuerid>
</gatewayinfo>
<transaction>
<id>' . $this->xmlEscape($this->transaction['id']) . '</id>
Expand Down Expand Up @@ -1417,6 +1354,15 @@ function rstrpos($haystack, $needle, $offset = null)
return $size - $pos - strlen($needle);
}

/*
* Empty method to add retro compatibility
* when some old files are retained in the
* upgrading process
*/
function getIdealIssuers()
{
return null;
}
}

/**
Expand Down
Loading

0 comments on commit 3e3cdf5

Please sign in to comment.