Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🥚 Payment API creates Activity with subject: "$x Offline Payment for Contribution" even when a payment was captured online #25997

Merged
merged 1 commit into from
Apr 4, 2023

Conversation

agileware-justin
Copy link
Contributor

@agileware-justin agileware-justin commented Apr 4, 2023

Overview

Payment API creates Activity with subject: "$x Offline Payment for Contribution" even when a payment was captured online.

This change simply removes the word "Offline" so that it works for describing both online and offline payments.

Before

When the recordPaymentActivity function is called, the addActivityForPayment function has the word "Offline" hard coded for the Activity subject, irrespective of how the payment was created.

image

After

The word "Offline" is removed, so when the Activity is created it still describes both online and offline payments.

Technical Details

Comments

Ideally the generic "Contribution" would also be set in recordPaymentActivity to refer to Membership, Event or Contribution. For Events, it will use the Event Title but for everything else just uses: "Contribution".

Agileware Ref: CIVICRM-2120

@civibot
Copy link

civibot bot commented Apr 4, 2023

(Standard links)

@civibot civibot bot added the master label Apr 4, 2023
@agileware-justin agileware-justin changed the title Payment API creates Activity with subject: "$x Offline Payment for Contribution" even when a payment was captured online 🥚 Payment API creates Activity with subject: "$x Offline Payment for Contribution" even when a payment was captured online Apr 4, 2023
@eileenmcnaughton
Copy link
Contributor

Thanks @agileware-justin - the test needs updating but i think this can be merged once it is

CRM_Contribute_Form_AdditionalPaymentTest.testMultiplePaymentForPartiallyPaidContribution

Failing for the past 1 build (Since #1556 )

Stacktrace

CRM_Contribute_Form_AdditionalPaymentTest::testMultiplePaymentForPartiallyPaidContribution
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'$ 50.00 - Offline Payment for Contribution'
+'$ 50.00 - Payment for Contribution'

/home/homer/buildkit/build/build-2/web/sites/all/modules/civicrm/tests/phpunit/CRM/Contribute/Form/AdditionalPaymentTest.php:182
/home/homer/buildkit/build/build-2/web/sites/all/modules/civicrm/tests/phpunit/CiviTest/CiviUnitTestCase.php:229
/home/homer/buildkit/extern/phpunit8/phpunit8.phar:1721

CRM_Contribute_Form_AdditionalPaymentTest.testMultiplePaymentForPartiallyPaidContribution

Failing for the past 1 build (Since #1556 )
Took 0.32 sec.
Stacktrace
CRM_Contribute_Form_AdditionalPaymentTest::testMultiplePaymentForPartiallyPaidContribution
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'$ 50.00 - Offline Payment for Contribution'
+'$ 50.00 - Payment for Contribution'

/home/homer/buildkit/build/build-2/web/sites/all/modules/civicrm/tests/phpunit/CRM/Contribute/Form/AdditionalPaymentTest.php:182
/home/homer/buildkit/build/build-2/web/sites/all/modules/civicrm/tests/phpunit/CiviTest/CiviUnitTestCase.php:229
/home/homer/buildkit/extern/phpunit8/phpunit8.phar:1721

…ayment for Contribution" even when a payment was captured online
@agileware-justin
Copy link
Contributor Author

Thanks @eileenmcnaughton and done. Happy Easter too 😄 🥚

@colemanw colemanw merged commit ce0a77e into civicrm:master Apr 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants