Subscription payment is not updating
@mattwire Stripe charges OK, Civi Records as Pending transaction, No email is sent and seeing Fatal error in the log:
MJWIPNTrait call to repeattransaction failed: DB Error: already exists; params: Array ( [contribution_recur_id] => 274 [contribution_status_id] => 2 [receive_date] => 20201218095828 [order_reference] => in_1HzfjEA7J6ExrhfuTmxnSEpk [trxn_id] => in_1HzfjEA7J6ExrhfuTmxnSEpk [total_amount] => 108 [fee_amount] => 1.5 [is_email_receipt] => )
> $backTrace = #0 /home/webadmin/public_html/cmm/sites/all/modules/civicrm/CRM/Core/Error.php(942): CRM_Core_Error::backtrace("backTrace", TRUE) #1 /home/webadmin/public_html/cmm/sites/all/modules/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(922): CRM_Core_Error::exceptionHandler(Object(DB_Error)) #2 /home/webadmin/public_html/cmm/sites/all/modules/civicrm/vendor/pear/db/DB.php(997): PEAR_Error->__construct("DB Error: already exists", -5, 16, (Array:2), "INSERT INTO `civicrm_contribution` (`contact_id` , `financial_type_id` , `con...") #3 /home/webadmin/public_html/cmm/sites/all/modules/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(575): DB_Error->__construct(-5, 16, (Array:2), "INSERT INTO `civicrm_contribution` (`contact_id` , `financial_type_id` , `con...") #4 /home/webadmin/public_html/cmm/sites/all/modules/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(223): PEAR->_raiseError(Object(DB_mysqli), NULL, -5, 16, (Array:2), "INSERT INTO `civicrm_contribution` (`contact_id` , `financial_type_id` , `con...", "DB_Error", TRUE) #5 /home/webadmin/public_html/cmm/sites/all/modules/civicrm/vendor/pear/db/DB/common.php(1928): PEAR->__call("raiseError", (Array:7)) #6 /home/webadmin/public_html/cmm/sites/all/modules/civicrm/vendor/pear/db/DB/mysqli.php(936): DB_common->raiseError(-5, NULL, NULL, "INSERT INTO `civicrm_contribution` (`contact_id` , `financial_type_id` , `con...", "1062 ** Duplicate entry 'in_1HzfjEA7J6ExrhfuTmxnSEpk' for key 'UI_contrib_trx...") #7 /home/webadmin/public_html/cmm/sites/all/modules/civicrm/vendor/pear/db/DB/mysqli.php(406): DB_mysqli->mysqliRaiseError() #8 /home/webadmin/public_html/cmm/sites/all/modules/civicrm/vendor/pear/db/DB/common.php(1234): DB_mysqli->simpleQuery("INSERT INTO `civicrm_contribution` (`contact_id` , `financial_type_id` , `con...") #9 /home/webadmin/public_html/cmm/sites/all/modules/civicrm/packages/DB/DataObject.php(2696): DB_common->query("INSERT INTO `civicrm_contribution` (`contact_id` , `financial_type_id` , `con...") #10 /home/webadmin/public_html/cmm/sites/all/modules/civicrm/packages/DB/DataObject.php(1245): DB_DataObject->_query("INSERT INTO `civicrm_contribution` (`contact_id` , `financial_type_id` , `con...") #11 /home/webadmin/public_html/cmm/sites/all/modules/civicrm/CRM/Core/DAO.php(639): DB_DataObject->insert() #12 /home/webadmin/public_html/cmm/sites/all/modules/civicrm/CRM/Contribute/BAO/Contribution.php(190): CRM_Core_DAO->save() #13 /home/webadmin/public_html/cmm/sites/all/modules/civicrm/CRM/Contribute/BAO/Contribution.php(470): CRM_Contribute_BAO_Contribution::add((Array:24)) #14 /home/webadmin/public_html/cmm/sites/all/modules/civicrm/api/v3/utils.php(1297): CRM_Contribute_BAO_Contribution::create((Array:24), (Array:1)) #15 /home/webadmin/public_html/cmm/sites/all/modules/civicrm/api/v3/Contribution.php(77): _civicrm_api3_basic_create("CRM_Contribute_BAO_Contribution", (Array:24), "Contribution") #16 /home/webadmin/public_html/cmm/sites/all/modules/civicrm/Civi/API/Provider/MagicFunctionProvider.php(89): civicrm_api3_contribution_create((Array:24)) #17 /home/webadmin/public_html/cmm/sites/all/modules/civicrm/Civi/API/Kernel.php(150): Civi\API\Provider\MagicFunctionProvider->invoke((Array:8)) #18 /home/webadmin/public_html/cmm/sites/all/modules/civicrm/Civi/API/Kernel.php(81): Civi\API\Kernel->runRequest((Array:8)) #19 /home/webadmin/public_html/cmm/sites/all/modules/civicrm/api/api.php(131): Civi\API\Kernel->runSafe("Contribution", "create", (Array:19)) #20 /home/webadmin/public_html/cmm/sites/all/modules/civicrm/CRM/Contribute/BAO/Contribution.php(2674): civicrm_api3("Contribution", "create", (Array:19)) #21 /home/webadmin/public_html/cmm/sites/all/modules/civicrm/CRM/Contribute/BAO/Contribution.php(4442): CRM_Contribute_BAO_Contribution::repeatTransaction(Object(CRM_Contribute_BAO_Contribution), (Array:13), (Array:18)) #22 /home/webadmin/public_html/cmm/sites/all/modules/civicrm/api/v3/Contribution.php(683): CRM_Contribute_BAO_Contribution::completeOrder((Array:12), NULL, Object(CRM_Contribute_BAO_Contribution), NULL) #23 /home/webadmin/public_html/cmm/sites/all/modules/civicrm/api/v3/Contribution.php(629): _ipn_process_transaction((Array:11), Object(CRM_Contribute_BAO_Contribution), (Array:12), (Array:10)) #24 /home/webadmin/public_html/cmm/sites/all/modules/civicrm/Civi/API/Provider/MagicFunctionProvider.php(89): civicrm_api3_contribution_repeattransaction((Array:11)) #25 /home/webadmin/public_html/cmm/sites/all/modules/civicrm/Civi/API/Kernel.php(150): Civi\API\Provider\MagicFunctionProvider->invoke((Array:8)) #26 /home/webadmin/public_html/cmm/sites/all/modules/civicrm/Civi/API/Kernel.php(81): Civi\API\Kernel->runRequest((Array:8)) #27 /home/webadmin/public_html/cmm/sites/all/modules/civicrm/api/api.php(131): Civi\API\Kernel->runSafe("Contribution", "repeattransaction", (Array:9)) #28 /home/webadmin/public_html/cmm/sites/default/files/civicrm/ext/mjwshared/CRM/Core/Payment/MJWIPNTrait.php(246): civicrm_api3("Contribution", "repeattransaction", (Array:9)) #29 /home/webadmin/public_html/cmm/sites/default/files/civicrm/ext/stripe/CRM/Core/Payment/StripeIPN.php(415): CRM_Core_Payment_StripeIPN->repeatContribution((Array:7)) #30 /home/webadmin/public_html/cmm/sites/default/files/civicrm/ext/stripe/CRM/Core/Payment/StripeIPN.php(219): CRM_Core_Payment_StripeIPN->createNextContributionForRecur() #31 /home/webadmin/public_html/cmm/sites/default/files/civicrm/ext/stripe/CRM/Core/Payment/Stripe.php(1148): CRM_Core_Payment_StripeIPN->main() #32 /home/webadmin/public_html/cmm/sites/all/modules/civicrm/CRM/Core/Payment.php(1610): CRM_Core_Payment_Stripe->handlePaymentNotification() #33 /home/webadmin/public_html/cmm/sites/all/modules/civicrm/CRM/Core/Payment.php(1503): CRM_Core_Payment::handlePaymentMethod("handlePaymentNotification", (Array:3)) #34 /home/webadmin/public_html/cmm/sites/all/modules/civicrm/CRM/Core/Invoke.php(278): CRM_Core_Payment::handleIPN() #35 /home/webadmin/public_html/cmm/sites/all/modules/civicrm/CRM/Core/Invoke.php(68): CRM_Core_Invoke::runItem((Array:14)) #36 /home/webadmin/public_html/cmm/sites/all/modules/civicrm/CRM/Core/Invoke.php(36): CRM_Core_Invoke::_invoke((Array:4)) #37 /home/webadmin/public_html/cmm/sites/all/modules/civicrm/drupal/civicrm.module(459): CRM_Core_Invoke::invoke((Array:4)) #38 /home/webadmin/public_html/cmm/includes/menu.inc(527): civicrm_invoke("payment", "ipn", "3") #39 /home/webadmin/public_html/cmm/index.php(21): menu_execute_active_handler() #40 {main}
``
$Fatal Error Details = Array ( [callback] => Array ( [0] => CRM_Core_Error [1] => exceptionHandler ) [code] => -5 [message] => DB Error: already exists [mode] => 16 [debug_info] => INSERT INTO `civicrm_contribution` (`contact_id` , `financial_type_id` , `contribution_page_id` , `payment_instrument_id` , `receive_date` , `total_amount` , `fee_amount` , `net_amount` , `trxn_id` , `currency` , `source` , `contribution_recur_id` , `is_test` , `contribution_status_id` , `check_number` ) VALUES ( 396 , 47 , 43 , 1 , 20201218095828 , 108 , 1.5 , 106.5 , 'in_1HzfjEA7J6ExrhfuTmxnSEpk' , 'GBP' , 'Online Contribution: Krishna\'s Cows' , 274 , 0 , 2 , NULL ) [nativecode=1062 ** Duplicate entry 'in_1HzfjEA7J6ExrhfuTmxnSEpk' for key 'UI_contrib_trxn_id'] [type] => DB_Error [user_info] => INSERT INTO `civicrm_contribution` (`contact_id` , `financial_type_id` , `contribution_page_id` , `payment_instrument_id` , `receive_date` , `total_amount` , `fee_amount` , `net_amount` , `trxn_id` , `currency` , `source` , `contribution_recur_id` , `is_test` , `contribution_status_id` , `check_number` ) VALUES ( 396 , 47 , 43 , 1 , 20201218095828 , 108 , 1.5 , 106.5 , 'in_1HzfjEA7J6ExrhfuTmxnSEpk' , 'GBP' , 'Online Contribution: Krishna\'s Cows' , 274 , 0 , 2 , NULL ) [nativecode=1062 ** Duplicate entry 'in_1HzfjEA7J6ExrhfuTmxnSEpk' for key 'UI_contrib_trxn_id'] [to_string] => [db_error: message="DB Error: already exists" code=-5 mode=callback callback=CRM_Core_Error::exceptionHandler prefix="" info="INSERT INTO `civicrm_contribution` (`contact_id` , `financial_type_id` , `contribution_page_id` , `payment_instrument_id` , `receive_date` , `total_amount` , `fee_amount` , `net_amount` , `trxn_id` , `currency` , `source` , `contribution_recur_id` , `is_test` , `contribution_status_id` , `check_number` ) VALUES ( 396 , 47 , 43 , 1 , 20201218095828 , 108 , 1.5 , 106.5 , 'in_1HzfjEA7J6ExrhfuTmxnSEpk' , 'GBP' , 'Online Contribution: Krishna\'s Cows' , 274 , 0 , 2 , NULL ) [nativecode=1062 ** Duplicate entry 'in_1HzfjEA7J6ExrhfuTmxnSEpk' for key 'UI_contrib_trxn_id']"] )
Edited by tapash