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

Remove money helper from code to stop collision #119

Merged
merged 3 commits into from
Sep 5, 2022

Conversation

siegerhansma
Copy link
Contributor

In one of my projects I installed a package that depended on the akaunting/money package. These both use a money helper. The akaunting/money package overrides the money helper in the laravel-cashier-mollie package in my case.

This pull requests removes the money helper from the client code and directly uses the Money and Currency class. The tests still use the helper, but for users of the package that shouldn't matter.

@sandervanhooft
Copy link
Collaborator

Hi @siegerhansma !

Thanks for this PR. Can you point me to the signature of the helper in the colliding package?

@siegerhansma
Copy link
Contributor Author

@sandervanhooft
Copy link
Collaborator

Thanks! It appears to me the helper itself isn't removed in this PR?

@siegerhansma
Copy link
Contributor Author

Correct, it's still used in the tests. Should I replace them in the tests and remove the helper?

@sandervanhooft
Copy link
Collaborator

That would definitely help keeping things consistent :)

@siegerhansma
Copy link
Contributor Author

No problem, I'll update the PR later this week.

@sandervanhooft
Copy link
Collaborator

Related: #128 #89

@siegerhansma
Copy link
Contributor Author

@sandervanhooft Removed the helper and updated all the tests to use the class instead of the helper. Not sure about the conflict though.

@sandervanhooft sandervanhooft merged commit c713a9e into mollie:main Sep 5, 2022
@sandervanhooft
Copy link
Collaborator

Looks good to me! Thanks @siegerhansma !

@RemiHin
Copy link

RemiHin commented Nov 3, 2022

@sandervanhooft
This was a breaking change in a minor release.
Broke our code because of the missing money function

@sandervanhooft
Copy link
Collaborator

Hi @RemiHin ,

Thanks for reporting and sorry to hear that. I was under the impression it was only used by Cashier internally. But I now see it's also used by the charge builder. Let me revert this and put the money helper back.

@siegerhansma this will have to wait until next major release.

@RemiHin
Copy link

RemiHin commented Nov 3, 2022

hi @sandervanhooft
We we're able to work around by using the Money and Currency Classes suggested by @siegerhansma, but we might not be the only people using the helper :) thanks for the quick response

@sandervanhooft
Copy link
Collaborator

Thanks @RemiHin,

Exactly what I was thinking, that's why I am prepping the patch release right now :)

@sandervanhooft
Copy link
Collaborator

Here you go: https://github.com/mollie/laravel-cashier-mollie/releases/tag/v2.5.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants