Skip to content
Snippets Groups Projects
Unverified Commit 28406ebb authored by jitendra's avatar jitendra Committed by GitHub
Browse files

Update hook_civicrm_alterPaymentProcessorParams.md

parent 17a8e8f5
No related branches found
No related tags found
No related merge requests found
......@@ -28,4 +28,28 @@ With this hook, you can pass custom parameters, or use features of your back-end
## Example
function civitest_civicrm_alterPaymentProcessorParams($paymentObj, &$rawParams, &$cookedParams) { if ($paymentObj->class_name == Payment_Dummy ) { $employer = empty($rawParams['custom_1']) ? '' : $rawParams['custom_1']; $occupation = empty($rawParams['custom_2']) ? '' : $rawParams['custom_2']; $cookedParams['custom'] = "$employer|$occupation"; } else if ($paymentObj->class_name == Payment_AuthorizeNet) { //Actual translation for one application: //Employer > Ship to Country (x_ship_to_country) //Occupation > Company (x_company) //Solicitor > Ship-to First Name (x_ship_to_first_name) //Event > Ship-to Last Name (x_ship_to_last_name) //Other > Ship-to Company (x_ship_to_company) $cookedParams['x_ship_to_country'] = $rawParams['custom_1']; $cookedParams['x_company'] = $rawParams['custom_2']; $cookedParams['x_ship_to_last_name'] = $rawParams['accountingCode']; //for now $country_info = da_core_fetch_country_data_by_crm_id($rawParams['country-1']); $cookedParams['x_ship_to_company'] = $country_info['iso_code']; } elseif ($paymentObj->billing_mode == 2) { // Express Checkout $cookedParams['desc'] = $rawParams['eventName']; $cookedParams['custom'] = $rawParams['eventId']; }}
\ No newline at end of file
function civitest_civicrm_alterPaymentProcessorParams($paymentObj, &$rawParams, &$cookedParams) {
if ($paymentObj->class_name == Payment_Dummy ) {
$employer = empty($rawParams['custom_1']) ? '' : $rawParams['custom_1'];
$occupation = empty($rawParams['custom_2']) ? '' : $rawParams['custom_2'];
$cookedParams['custom'] = "$employer|$occupation"; }
else if ($paymentObj->class_name == Payment_AuthorizeNet) {
//Actual translation for one application:
//Employer > Ship to Country (x_ship_to_country)
//Occupation > Company (x_company)
//Solicitor > Ship-to First Name (x_ship_to_first_name)
//Event > Ship-to Last Name (x_ship_to_last_name)
//Other > Ship-to Company (x_ship_to_company)
$cookedParams['x_ship_to_country'] = $rawParams['custom_1'];
$cookedParams['x_company'] = $rawParams['custom_2'];
$cookedParams['x_ship_to_last_name'] = $rawParams['accountingCode'];
//for now
$country_info = da_core_fetch_country_data_by_crm_id($rawParams['country-1']);
$cookedParams['x_ship_to_company'] = $country_info['iso_code'];
}
elseif ($paymentObj->billing_mode == 2) {
// Express Checkout
$cookedParams['desc'] = $rawParams['eventName'];
$cookedParams['custom'] = $rawParams['eventId'];
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment