Skip to content
Snippets Groups Projects

Standardisation/fix when calling changeSubscriptionAmount

Merged mattwire requested to merge mattwire/upgraderecur:changesubscriptionamount into main
2 unresolved threads

The changeSubscriptionAmount function wasn't documented at all until last week...

https://docs.civicrm.org/dev/en/latest/extensions/payment-processors/paymentclass/#changesubscriptionamount

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
249 249 public function changeSubscriptionAmount(array $changeActivity, array $recur, CRM_Core_Payment $paymentProcessorObject) :string {
250 250 // Old (current, as of 5.49) method
251 251 $message = '';
252 $newAmount = $changeActivity['updaterecur_activity_fields.updaterecur_new_amount'];
  • Author Reporter

    Assigning to a variable isn't actually required for this PR but it felt cleaner - and I've got another proposed change where this would be used.

  • Please register or sign in to reply
  • mattwire
    mattwire @mattwire started a thread on the diff
  • 249 249 public function changeSubscriptionAmount(array $changeActivity, array $recur, CRM_Core_Payment $paymentProcessorObject) :string {
    250 250 // Old (current, as of 5.49) method
    251 251 $message = '';
    252 $newAmount = $changeActivity['updaterecur_activity_fields.updaterecur_new_amount'];
    253 // contributionRecurID is the "correct" parameter per propertyBag, but it wasn't well defined before 5.70
    254 // so we need to pass in id as well as some PaymentProcessors will expect that.
    255 // Older payment processors will still expect `subscriptionId` which is really processor_id but we don't support that.
    252 256 $paymentProcessorObject->changeSubscriptionAmount($message, [
    257 'contributionRecurID' => $recur['id'],
  • Rich mentioned in commit 2e271402

    mentioned in commit 2e271402

  • merged

  • Please register or sign in to reply
    Loading