systopia / de.systopia.twingle

CiviCRM Twingle Integration
Other
4 stars 2 forks source link

Integrate Twingle Shop #69

Closed MarcMichalsky closed 2 months ago

MarcMichalsky commented 1 year ago

This PR aims to integrate Twingle Shop orders with CiviCRM.

Objective

The objective of this Twingle Shop integration is not to blow up CiviCRM into a full-grown merchandise management system. For this reason I decided to not create a separate entity for shop orders.

On the other hand, orders should not only be attached to contributions as custom fields or notes, as this is not useful for optimizing order processes in my opinion. A workflow that also maps invoicing, status and shipping in CiviCRM after an order would be extremely inconvenient this way.

Therefore, I came to the conclusion that a viable solution is to map orders as contributions with line items and shops as price sets. This way, orders that do not arrive via the Twingle Shop, but e.g. by phone or mail, can be processed with the same workflow.

In order to match the created Twingle Shops with the existing price sets in CiviCRM, I want to use the Twingle API. Unlike in this extension, the communication is not from Twingle to CiviCRM but the other way round: CiviCRM retrieves the existing shops and products from Twingle and creates the corresponding price sets in its database.

Furthermore, the Twingle Shop integration will be completely optional, so that the behavior of this extension will not change in any way for users who do not use the Twingle Shop.

Tasks


This PR is work in progress!

MarcMichalsky commented 1 year ago

Rebased on PR #71

jensschuppe commented 7 months ago

Now that all the dependencies have been merged into master, let's rebase this branch onto that, @MarcMichalsky!

MarcMichalsky commented 7 months ago

Now that all the dependencies have been merged into master, let's rebase this branch onto that, @MarcMichalsky!

Done! 💪

But before you create an alpha release, please give me some time to test it.

MarcMichalsky commented 4 months ago

Rebased on master

RoWo-DS commented 2 months ago

Hi Marc, is this PR ready to be merged into master? Or do you need anything to make that happen? Best wishes! Daniel

jensschuppe commented 2 months ago

I rebased onto current master again, merge conflicts solved in a way that this branch is now identical to @MarcMichalsky's master branch.

MarcMichalsky commented 2 months ago

Hello everyone,

Unfortunately I haven't had time to write any tests yet. However, we have been running the shop integration since Christmas in my organization.

I think it would be good if we could set up a kind of test framework that includes all the functions of the extension. Further tests for the shop integration could then be added there. I noticed somewhere that you had already written down a few ideas for this, @jensschuppe?

jensschuppe commented 2 months ago

@MarcMichalsky I think you're referring to #98 - which is basically about mocking requests to the various API endpoints/actions.

I thought the write some tests part of this PR was about unit tests. Anyway, both tasks can be follow-up issues for not blocking a merge of the shop functionality. I think you and maybe @RoWo-DS running this in production (with prior manual testing) would suffice for releasing a new version of the extension with it.

jensschuppe commented 2 months ago

This has now been released with version 1.5-beta.

@MarcMichalsky feel free to open follow-up issues for the remaining tasks. Thanks again for your work (and patience with the reviews)! :+1:

RoWo-DS commented 2 months ago

I successfully tested the final pull request for regular donations and donations made with the Twingle shop (sync CiviCRM campaign to twinglemanager and sync donation from twinglemanager to CiviCRM).

MarcMichalsky commented 2 months ago

Thanks @jensschuppe! I will tackle the testing in a follow-up issue.

@RoWo-DS And can you also synchronize the Twingle Shop products as line items?

RoWo-DS commented 1 month ago

@RoWo-DS And can you also synchronize the Twingle Shop products as line items?

I don't know. Probably not. Where would I find the line items in CiviCRM? Do I need a special configuration to synchronise them from the twinglemanager?

Update: I found the neccessary configuration within the Twingle API profile. It works, the shop products are synchronised as line items.