I want to retrieve the CC number from authorize.net and display it in sugarcrm v6.5 my problem now is that in the documentation found in authorize.net the code is meant for native PHP. And I just started learning sugarcrm, now what I want to learn is how do I use the code in their document to match sugarcrm.
this it the link to their code I want to use link here
this is my current implementation. And I get this error in sugarcrm: "There was an error processing your request, please try again at a later time."
<?php
require_once("include/MVC/View/views/view.detail.php");
use CB\Integrations\Provider\AuthorizeNet;
class CB_PaymentProfilesViewDetail extends ViewDetail
{
var $contacts_warning;
var $company_logo_path;
var $company_tagline;
var $provider;
public function __construct()
{
global $sugar_config;
$settings = $sugar_config["authorizenet_settings"];
$this->provider = new AuthorizeNet();
$this->provider->auth($settings["appName"], $settings["transactionKey"]);
parent::ViewDetail();
}
function preDisplay() {
$this->contacts_warning = 'Our contacts database is not for personal use. Please do not use it for things not strictly related to company business. You know who you are!';
$this->company_tagline = 'Serving the biggest and brightest stars in Hollywood!';
parent::preDisplay();
}
public function display()
{
$this->provider->setCustomerProfileId(40843288);
echo '<div align="center" style="font-color: red">'.$this->provider->getCustomerPaymentProfileId() .'</div>';
if ($this->bean->name) {
$this->dv->defs['templateMeta']['form']['buttons'][] = array(
"customCode" => '{$CUSTOMER_PROFILE}'
);
$this->ss->assign('CUSTOMER_PROFILE',
$this->bean->provider->getHostedProfilePageButton($this->bean->name)
);
}
parent::display();
}
}