Merge pull request #19661 from civicrm/5.35
[civicrm-core.git] / api / v3 / Contribution.php
index de6bf1b0629acebab79c343281b1c8ec3681c82b..710c6ee7f073c10bd576a88dfe3d69624e458800 100644 (file)
@@ -401,6 +401,7 @@ function civicrm_api3_contribution_sendconfirmation($params) {
     'cc_receipt',
     'bcc_receipt',
     'receipt_text',
+    'pay_later_receipt',
     'payment_processor_id',
   ];
   $input = array_intersect_key($params, array_flip($allowedParams));
@@ -441,6 +442,10 @@ function _civicrm_api3_contribution_sendconfirmation_spec(&$params) {
     'title' => ts('Message (string)'),
     'type' => CRM_Utils_Type::T_STRING,
   ];
+  $params['pay_later_receipt'] = [
+    'title' => ts('Pay Later Message (string)'),
+    'type' => CRM_Utils_Type::T_STRING,
+  ];
   $params['receipt_update'] = [
     'title' => ts('Update the Receipt Date'),
     'type' => CRM_Utils_Type::T_BOOLEAN,
@@ -679,7 +684,7 @@ function _ipn_process_transaction($params, $contribution, $input, $ids) {
     'related_contact' => $ids['related_contact'] ?? NULL,
     'participant' => !empty($objects['participant']) ? $objects['participant']->id : NULL,
     'contributionRecur' => !empty($objects['contributionRecur']) ? $objects['contributionRecur']->id : NULL,
-  ], $objects['contribution'],
+  ], $objects['contribution']->id ?? NULL,
     $params['is_post_payment_create'] ?? NULL);
 }