Merge pull request #20478 from rycks/develop

fix #20477: add online_payment_url on orders API requests
This commit is contained in:
Laurent Destailleur
2022-04-01 14:47:38 +02:00
committed by GitHub
2 changed files with 18 additions and 0 deletions

View File

@@ -135,6 +135,11 @@ class Orders extends DolibarrApi
// Add external contacts ids
$this->commande->contacts_ids = $this->commande->liste_contact(-1, 'external', $contact_list);
$this->commande->fetchObjectLinked();
// Add online_payment_url, cf #20477
require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
$this->commande->online_payment_url = getOnlinePaymentUrl(0, 'order', $this->commande->ref);
return $this->_cleanObjectDatas($this->commande);
}
@@ -230,6 +235,10 @@ class Orders extends DolibarrApi
if ($commande_static->fetch($obj->rowid)) {
// Add external contacts ids
$commande_static->contacts_ids = $commande_static->liste_contact(-1, 'external', 1);
// Add online_payment_url, cf #20477
require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
$commande_static->online_payment_url = getOnlinePaymentUrl(0, 'order', $commande_static->ref);
$obj_ret[] = $this->_cleanObjectDatas($commande_static);
}
$i++;
@@ -735,6 +744,10 @@ class Orders extends DolibarrApi
$this->commande->fetchObjectLinked();
//fix #20477 : add online_payment_url
require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
$this->commande->online_payment_url = getOnlinePaymentUrl(0, 'order', $this->commande->ref);
return $this->_cleanObjectDatas($this->commande);
}