Created
May 25, 2017 06:07
-
-
Save torunar/c55269799c737af29e9f1799870b3cc7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/add_ppa_fields.php b/add_ppa_fields.php | |
new file mode 100644 | |
index 0000000..50771c4 | |
--- /dev/null | |
+++ b/add_ppa_fields.php | |
@@ -0,0 +1,39 @@ | |
+<?php | |
+ | |
+define('AREA', 'A'); | |
+define('ACCOUNT_TYPE', 'admin'); | |
+ | |
+require_once('init.php'); | |
+ | |
+$langvars = array( | |
+ 'addons.paypal_adaptive.first_name' => 'PayPal account holder\'s first name', | |
+ 'addons.paypal_adaptive.last_name' => 'PayPal account holder\'s last name', | |
+ 'ttc_addons.paypal_adaptive.first_name' => 'Please enter the PayPal account holder\'s first name.', | |
+ 'ttc_addons.paypal_adaptive.last_name' => 'Please enter the PayPal account holder\'s last name.', | |
+); | |
+ | |
+db_query( | |
+ 'ALTER TABLE ?:companies' | |
+ . ' ADD `ppa_first_name` varchar(255) NOT NULL DEFAULT ?s,' | |
+ . ' ADD `ppa_last_name` varchar(255) NOT NULL DEFAULT ?s', | |
+ '', | |
+ '' | |
+); | |
+ | |
+fn_echo('Companies table altered<br>'); | |
+ | |
+foreach (\Tygh\Languages\Languages::getAll() as $lang) { | |
+ foreach ($langvars as $name => $value) { | |
+ db_query('REPLACE INTO ?:language_values ?e', array( | |
+ 'lang_code' => $lang['lang_code'], | |
+ 'name' => $name, | |
+ 'value' => $value | |
+ )); | |
+ } | |
+} | |
+ | |
+fn_echo('Translations added<br>'); | |
+ | |
+fn_clear_cache('all'); | |
+ | |
+fn_echo('Cache cleared<br>'); | |
\ No newline at end of file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/app/addons/paypal_adaptive/func.php b/app/addons/paypal_adaptive/func.php | |
index 6a74bea..5dd8933 100644 | |
--- a/app/addons/paypal_adaptive/func.php | |
+++ b/app/addons/paypal_adaptive/func.php | |
@@ -890,6 +890,8 @@ function fn_paypal_adaptive_get_companies($params, &$fields, $sortings, $conditi | |
{ | |
$fields[] = '?:companies.paypal_verification'; | |
$fields[] = '?:companies.paypal_email'; | |
+ $fields[] = '?:companies.ppa_first_name'; | |
+ $fields[] = '?:companies.ppa_last_name'; | |
} | |
function fn_paypal_adaptive_get_verified_status($company_data) | |
@@ -898,9 +900,9 @@ function fn_paypal_adaptive_get_verified_status($company_data) | |
if (!empty($company_data['paypal_email'])) { | |
$post_data = array( | |
'emailAddress' => $company_data['paypal_email'], | |
- 'firstName' => $company_data['company'], | |
- 'lastName' => ' ', | |
- 'matchCriteria' => 'NONE', | |
+ 'firstName' => $company_data['ppa_first_name'], | |
+ 'lastName' => $company_data['ppa_last_name'], | |
+ 'matchCriteria' => 'NAME', | |
'requestEnvelope.errorLanguage' => 'en_US', | |
); | |
$payment_id = db_get_field('SELECT payment_id FROM ?:payments WHERE processor_id = (SELECT processor_id FROM ?:payment_processors WHERE processor = ?s)', 'PayPal Adaptive'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/design/backend/templates/addons/paypal_adaptive/hooks/companies/general_information.post.tpl b/design/backend/templates/addons/paypal_adaptive/hooks/companies/general_information.post.tpl | |
index db7248e..9bfe5b1 100644 | |
--- a/design/backend/templates/addons/paypal_adaptive/hooks/companies/general_information.post.tpl | |
+++ b/design/backend/templates/addons/paypal_adaptive/hooks/companies/general_information.post.tpl | |
@@ -7,5 +7,17 @@ | |
<input type="text" id="email" name="company_data[paypal_email]" class="input-text" size="32" maxlength="128" value="{$company_data.paypal_email}"/> | |
</div> | |
</div> | |
+ <div class="control-group"> | |
+ <label for="ppa_first_name" class="control-label">{__("addons.paypal_adaptive.first_name")}:</label> | |
+ <div class="controls"> | |
+ <input type="text" id="ppa_first_name" name="company_data[ppa_first_name]" class="input-text" size="32" maxlength="128" value="{$company_data.ppa_first_name}"/> | |
+ </div> | |
+ </div> | |
+ <div class="control-group"> | |
+ <label for="ppa_last_name" class="control-label">{__("addons.paypal_adaptive.last_name")}:</label> | |
+ <div class="controls"> | |
+ <input type="text" id="ppa_last_name" name="company_data[ppa_last_name]" class="input-text" size="32" maxlength="128" value="{$company_data.ppa_last_name}"/> | |
+ </div> | |
+ </div> | |
{/if} | |
\ No newline at end of file |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment