From 4233eb144f167d3a60e27ca055e0ddb3b018e473 Mon Sep 17 00:00:00 2001 From: jitendrapurohit Date: Thu, 18 Dec 2014 18:47:33 +0530 Subject: [PATCH] Registration Confirm page fails with discounted priceset CRM-15730 fix --- CRM/Core/Payment/PayPalImpl.php | 12 ++++++------ CRM/Event/Form/Registration/Confirm.php | 5 ++++- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/CRM/Core/Payment/PayPalImpl.php b/CRM/Core/Payment/PayPalImpl.php index 8481a4ec81..867df555c8 100644 --- a/CRM/Core/Payment/PayPalImpl.php +++ b/CRM/Core/Payment/PayPalImpl.php @@ -110,7 +110,7 @@ class CRM_Core_Payment_PayPalImpl extends CRM_Core_Payment { $args['paymentAction'] = $params['payment_action']; $args['amt'] = $params['amount']; $args['currencyCode'] = $params['currencyID']; - $args['desc'] = $params['description']; + $args['desc'] = CRM_Utils_Array::value('description', $params); $args['invnum'] = $params['invoiceID']; $args['returnURL'] = $params['returnURL']; $args['cancelURL'] = $params['cancelURL']; @@ -167,10 +167,10 @@ class CRM_Core_Payment_PayPalImpl extends CRM_Core_Payment { $params['payer_id'] = $result['payerid']; $params['payer_status'] = $result['payerstatus']; $params['first_name'] = $result['firstname']; - $params['middle_name'] = $result['middlename']; + $params['middle_name'] = CRM_Utils_Array::value('middlename', $result); $params['last_name'] = $result['lastname']; $params['street_address'] = $result['shiptostreet']; - $params['supplemental_address_1'] = $result['shiptostreet2']; + $params['supplemental_address_1'] = CRM_Utils_Array::value('shiptostreet2', $result); $params['city'] = $result['shiptocity']; $params['state_province'] = $result['shiptostate']; $params['postal_code'] = $result['shiptozip']; @@ -200,8 +200,8 @@ class CRM_Core_Payment_PayPalImpl extends CRM_Core_Payment { $args['currencyCode'] = $params['currencyID']; $args['payerID'] = $params['payer_id']; $args['invnum'] = $params['invoiceID']; - $args['returnURL'] = $params['returnURL']; - $args['cancelURL'] = $params['cancelURL']; + $args['returnURL'] = CRM_Utils_Array::value('returnURL', $params); + $args['cancelURL'] = CRM_Utils_Array::value('cancelURL', $params); $args['desc'] = $params['description']; $result = $this->invokeAPI($args); @@ -215,7 +215,7 @@ class CRM_Core_Payment_PayPalImpl extends CRM_Core_Payment { $params['trxn_id'] = $result['transactionid']; $params['gross_amount'] = $result['amt']; $params['fee_amount'] = $result['feeamt']; - $params['net_amount'] = $result['settleamt']; + $params['net_amount'] = CRM_Utils_Array::value('settleamt', $result); if ($params['net_amount'] == 0 && $params['fee_amount'] != 0) { $params['net_amount'] = $params['gross_amount'] - $params['fee_amount']; } diff --git a/CRM/Event/Form/Registration/Confirm.php b/CRM/Event/Form/Registration/Confirm.php index 9f2a2c78e9..b0fd2db935 100644 --- a/CRM/Event/Form/Registration/Confirm.php +++ b/CRM/Event/Form/Registration/Confirm.php @@ -99,7 +99,7 @@ class CRM_Event_Form_Registration_Confirm extends CRM_Event_Form_Registration { else CRM_Core_Error::fatal($paymentObjError); - $params['payer'] = $expressParams['payer']; + $params['payer'] = CRM_Utils_Array::value('payer', $expressParams); $params['payer_id'] = $expressParams['payer_id']; $params['payer_status'] = $expressParams['payer_status']; @@ -121,6 +121,9 @@ class CRM_Event_Form_Registration_Confirm extends CRM_Event_Form_Registration { $params['discountAmount'] = $this->_params[0]['discountAmount']; $params['discountMessage'] = $this->_params[0]['discountMessage']; } + if (!empty($this->_params[0]['amount_priceset_level_radio'])) { + $params['amount_priceset_level_radio'] = $this->_params[0]['amount_priceset_level_radio']; + } $params['amount_level'] = $this->_params[0]['amount_level']; $params['currencyID'] = $this->_params[0]['currencyID']; $params['payment_action'] = 'Sale'; -- 2.25.1