Page MenuHomekolab.org

Mollie payments
ClosedPublic

Authored by machniak on Mar 17 2020, 11:27 AM.

Details

Summary

Integration with Payment provider Mollie

Diff Detail

Repository
rK kolab
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

machniak requested review of this revision.Mar 17 2020, 11:27 AM
machniak created this revision.
vanmeeuwen requested changes to this revision.Mar 18 2020, 3:24 PM
vanmeeuwen added inline comments.
src/app/Console/Commands/WalletCharge.php
58

This automatic charging will be subject to the user entering in to such agreement.

Supposedly, the agreement would be formulated as follows:

[ ] Automatically top up my balance with [ $x ] CHF if the balance falls below [ $y ] CHF.
src/app/Http/Controllers/API/PaymentsController.php
131

Please clarify the circumstances that lead to $payment->hasRefunds()?

135

Please clarify the circumstances that lead to $payment->hasChargebacks()?

src/app/Jobs/WalletPayment.php
49

We probably should not charge the customer with the wallet's current balance and increase the wallet's balance to 0.

See also the earlier comment.

src/app/Observers/WalletObserver.php
66

Is this because of the referential integrity by foreign key?

src/app/Wallet.php
96

No additional whitespace is needed here, right?

src/database/migrations/2020_03_16_100000_create_payments.php
27

This could be debatable.

This revision now requires changes to proceed.Mar 18 2020, 3:24 PM
machniak updated this revision to Diff 2614.Mar 20 2020, 9:18 AM
  • Tests for payments controller
  • Browser test for payment with Mollie
vanmeeuwen requested changes to this revision.Mar 20 2020, 9:59 AM

This differential would preferably be rebased on to current origin/master HEAD.

Also, there's a test failure;

$ php -dzend_extension=xdebug.so vendor/bin/phpunit 
PHPUnit 7.5.20 by Sebastian Bergmann and contributors.

............II.......I.IIII.........IIIII...........I..........  63 / 189 ( 33%)
.............I......I...I.I...................I................ 126 / 189 ( 66%)
..III..IIII...I.I.I........................E................... 189 / 189 (100%)


Time: 3.27 minutes, Memory: 68.50 MB

There was 1 error:

1) Tests\Browser\PaymentTest::testPayment
Facebook\WebDriver\Exception\TimeoutException: Waited 5 seconds for selector [#container].

/home/vanmeeuwen/devel/src/apheleia/kolab.git/src/vendor/laravel/dusk/src/Concerns/WaitsForElements.php:291
/home/vanmeeuwen/devel/src/apheleia/kolab.git/src/vendor/laravel/dusk/src/Concerns/WaitsForElements.php:44
/home/vanmeeuwen/devel/src/apheleia/kolab.git/src/tests/Browser/Pages/PaymentMollie.php:28
/home/vanmeeuwen/devel/src/apheleia/kolab.git/src/vendor/laravel/dusk/src/Browser.php:187
/home/vanmeeuwen/devel/src/apheleia/kolab.git/src/tests/Browser/PaymentTest.php:51
/home/vanmeeuwen/devel/src/apheleia/kolab.git/src/vendor/laravel/dusk/src/Concerns/ProvidesBrowser.php:68
/home/vanmeeuwen/devel/src/apheleia/kolab.git/src/tests/Browser/PaymentTest.php:79

ERRORS!
Tests: 189, Assertions: 2077, Errors: 1, Incomplete: 28.

Generating code coverage report in HTML format ... done
This revision now requires changes to proceed.Mar 20 2020, 9:59 AM
machniak updated this revision to Diff 2620.Mar 20 2020, 10:25 AM
  • Set locale for Mollie to fix browser test
machniak updated this revision to Diff 2626.Mar 20 2020, 10:45 AM
  • Reset mollie_id when testing payment
machniak updated this revision to Diff 2632.Mar 20 2020, 1:23 PM
  • The proxy on 127.0.0.1 can be trusted
  • Added APP_PUBLIC_URL setting
machniak updated this revision to Diff 2638.Mar 20 2020, 2:25 PM
  • Change webhook location to fix auth issue
machniak updated this revision to Diff 2644.Mar 20 2020, 2:41 PM
  • RedirectUrl don't have to public
vanmeeuwen accepted this revision.Mar 20 2020, 2:48 PM
This revision is now accepted and ready to land.Mar 20 2020, 2:48 PM
This revision was automatically updated to reflect the committed changes.