@@ -31,13 +31,14 @@ function civicrm_api3_job_process_recurring($params) {
3131 $ result [$ recurringPayment ['id ' ]]['original_contribution ' ] = $ originalContribution ;
3232 $ pending = civicrm_api3 ('Contribution ' , 'repeattransaction ' , [
3333 'original_contribution_id ' => $ originalContribution ['id ' ],
34+ 'total_amount ' => $ recurringPayment ['amount ' ],
3435 'contribution_status_id ' => 'Pending ' ,
3536 'payment_processor_id ' => $ paymentProcessorID ,
3637 'is_email_receipt ' => FALSE ,
3738 ]);
3839
3940 $ payment = civicrm_api3 ('PaymentProcessor ' , 'pay ' , [
40- 'amount ' => $ originalContribution [ ' total_amount ' ],
41+ 'amount ' => $ recurringPayment [ ' amount ' ],
4142 'currency ' => $ originalContribution ['currency ' ],
4243 'payment_processor_id ' => $ paymentProcessorID ,
4344 'contributionID ' => $ pending ['id ' ],
@@ -65,6 +66,7 @@ function civicrm_api3_job_process_recurring($params) {
6566 civicrm_api3 ('ContributionRecur ' , 'create ' , [
6667 'id ' => $ recurringPayment ['id ' ],
6768 'failure_count ' => $ recurringPayment ['failure_count ' ] + 1 ,
69+ 'contribution_status_id ' => "Failed " ,
6870 ]);
6971 if (!empty ($ pending ['id ' ])) {
7072 civicrm_api3 ('Contribution ' , 'create ' , [
0 commit comments