Jump to content

Prestashop 1.7 and paypal api credientials


MackStores.Com

Recommended Posts

Well we had a lot of problem with paypal module for 1.7 as there was no ways to put an api credentials.

Browsed the forums and people are suffering the same  going round and round  between paypal website and our own

SO we did some tweaks to make it work for us

1) in the  Module->paypal->views->templates->admin folder there is a file called configuration.tpl in this we added this following code in the end.

{*added by mackstores.com*}
<div style="width:50%" class="panel">
<form action={$form_url_mss|escape:'html'} method="post">
 Api User Name <input type="text" name="user_name_ms" value="{$api_user_name_live}" /><br>
 Api Signature <input type="text" name="signature_ms" value="{$api_signature_live}" /><br>
 Api password<input type="text" name="pass_ms" value="{$api_password_live}" /><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="submit" name="Pay_pal_cred_mod_mackstores" value="{l s='Update' mod='paypal'}" class="button"/></td>
</form>
</div>
{*added by mackstores.com*}

 

2.) in module folder  we opened paypal.php in the ( private function _postProcess() ) function added the following code

        if (Tools::isSubmit('Pay_pal_cred_mod_mackstores')) //added by mackstores.com
        {
            Configuration::updateValue('PAYPAL_USERNAME_LIVE', Tools::getValue('user_name_ms'));
            Configuration::updateValue('PAYPAL_PSWD_LIVE', Tools::getValue('signature_ms'));
            Configuration::updateValue('PAYPAL_SIGNATURE_LIVE', Tools::getValue('pass_ms'));
			Configuration::updateValue('PAYPAL_LIVE_ACCESS', 1);
        
        }

 

3. Again in the paypal.php under ((  public function getContent() )) we added (note the remarked lines // are added)

$this->context->smarty->assign(array(
            'path' => $this->_path,
            'country' => Country::getNameById($this->context->language->id, $this->context->country->id),
            'localization' => $this->context->link->getAdminLink('AdminLocalization', true),
            'preference' => $this->context->link->getAdminLink('AdminPreferences', true),
            'active_products' => $this->express_checkout,
            'return_url' => $return_url,
            'paypal_card' => Configuration::get('PAYPAL_API_CARD'),
            'api_user_name_sandbox' => Configuration::get('PAYPAL_USERNAME_SANDBOX'),
            'api_user_name_live' => Configuration::get('PAYPAL_USERNAME_LIVE'),//added by mackstores.com
            'api_signature_live' => Configuration::get('PAYPAL_SIGNATURE_LIVE'),//added by mackstores.com
            'api_password_live' => Configuration::get('PAYPAL_PSWD_LIVE'),//added by mackstores.com
            'form_url_mss' => $_SERVER['REQUEST_URI'],//added by mackstores.com
            'ec_card_active' => $ec_card_active,
            'ec_paypal_active' => $ec_paypal_active,
            'need_rounding' => Configuration::get('PS_ROUND_TYPE') == Order::ROUND_ITEM ? 0 : 1,
        ));


Now we have put the api params and it works fine but still the error reporting on return to the customer is bad. suppose a customer has less balance and it comes back to the website and says unexpected error clearly they released the ps 1.7 with being on mercy on paid modules

Hope this post helps  lots of stuck people

  • Like 1
Link to comment
Share on other sites

  • 2 months later...
  • 1 month later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...