HPWebdeveloper / laravel-pay-pocket

A modern multi-wallet Laravel 10,11 package with comprehensive logging and payments capabilities and more than 3.5k installed
https://github.com/HPWebdeveloper/demo-pay-pocket
MIT License
272 stars 30 forks source link

Add support for transaction note #10

Closed 3m1n3nc3 closed 8 months ago

3m1n3nc3 commented 8 months ago
  1. There are times when you want to ensure that only specific wallets are charged during a transaction, this PR adds support for optionally specifying which wallets should be charged in such scenarios, instead of attempting to charge all wallets. A possible use case for this is in an escrow system where funds needs to stay locked in untill an approval is given.

  2. This PR also adds support for including short transactional notes, possibly to provide context to the user.

Both features are covered by all possible test cases.

See Issue #8

HPWebdeveloper commented 8 months ago

@3m1n3nc3

I initially thought of adding a transaction note, but it wasn’t implemented at the time. Thank you for your contribution.

For this specific pull request, our focus will be exclusively on Purpose No. 2, namely the addition of the Transaction Note feature. After successfully merging this, we'll move forward with a new pull request for Purpose No. 1.

To advance with these changes, please follow these steps:

Thank you.

3m1n3nc3 commented 8 months ago

@3m1n3nc3

I initially thought of adding a transaction note, but it wasn’t implemented at the time. Thank you for your contribution.

For this specific pull request, our focus will be exclusively on Purpose No. 2, namely the addition of the Transaction Note feature. After successfully merging this, we'll move forward with a new pull request for Purpose No. 1.

To advance with these changes, please follow these steps:

  • Rebase your fork with the main branch
  • Remove any code pertaining to Purpose No. 1.
  • When it is done, execute the command ./vendor/bin/pint for code formatting.
  • Since Feature No. 2 involves modifications to the table, It is required to update the README with instructions on how to implement these changes.
  • When it is done mention me to review

Thank you.

@HPWebdeveloper It's all done now.

HPWebdeveloper commented 8 months ago

@3m1n3nc3

The reference column is expected to be auto-filled, correct?

I used this Demo and forced its composer to use this branch in local. reference column in empty. I just published the pay-pocket config file without any change.

Screenshot 2024-01-11 at 11 34 39 AM

3m1n3nc3 commented 8 months ago

@3m1n3nc3

The reference column is expected to be auto-filled, correct?

I used this Demo and forced its composer to use this branch in local. reference column in empty. I just published the pay-pocket config file without any change.

Screenshot 2024-01-11 at 11 34 39 AM

I think I forgot to reimplement the feature after the rebase. Let me do that.

3m1n3nc3 commented 8 months ago

@3m1n3nc3 The reference column is expected to be auto-filled, correct? I used this Demo and forced its composer to use this branch in local. reference column in empty. I just published the pay-pocket config file without any change. Screenshot 2024-01-11 at 11 34 39 AM

I think I forgot to reimplement the feature after the rebase. Let me do that.

Turned out I failed to add the reference field to the fillable property, I've done that now.

HPWebdeveloper commented 8 months ago

@3m1n3nc3

suppose user published the config file and doesn't provide a correct value for the 'log_reference_generator' => null,

what he provides is wrong and it is not invokable.

In this case there is a need to have Exceptions here:

https://github.com/HPWebdeveloper/laravel-pay-pocket/blob/main/src/Traits/BalanceOperation.php

Can you complete it?

3m1n3nc3 commented 8 months ago

@3m1n3nc3

suppose user published the config file and doesn't provide a correct value for the 'log_reference_generator' => null,

what he provides is wrong and it is not invokable.

In this case there is a need to have Exceptions here:

https://github.com/HPWebdeveloper/laravel-pay-pocket/blob/main/src/Traits/BalanceOperation.php

Can you complete it?

Currently it falls back to Str:random() I will add an exception and submit a PR.