Git Product home page Git Product logo

Comments (11)

f3l1x avatar f3l1x commented on August 20, 2024

Hmmm. Do you need it pass to paymet's items? Gopay does not accept negative values?

from gopay-inline.

vojtasvoboda avatar vojtasvoboda commented on August 20, 2024

Yes, customers should see what they pay for. Yes, Gopay does not accept negative amounts - see documentation -> Objects -> Items -> amount (long > 0).

There is also second problem, if you don't pass rounding as payment item, total sum doesn't match:

snimek obrazovky 2015-12-16 v 10 14 31

from gopay-inline.

f3l1x avatar f3l1x commented on August 20, 2024

I get your point. If some webservice does not support it, you use it bad.

from gopay-inline.

vojtasvoboda avatar vojtasvoboda commented on August 20, 2024

So... how can I solve it? :-) Cents rounding is pretty common thing.

from gopay-inline.

vojtasvoboda avatar vojtasvoboda commented on August 20, 2024

Gopay technical support suggested me add this rounding to final price. So maybe some config switch "Turn off validation" will be great?

from gopay-inline.

f3l1x avatar f3l1x commented on August 20, 2024

I'm not sure if it is allowed on Gopay side. You can pass different items price and payment price?

from gopay-inline.

vojtasvoboda avatar vojtasvoboda commented on August 20, 2024

Yes to Gopay you can send different items price, but in this library is some Validator, see last screenshot above.

from gopay-inline.

f3l1x avatar f3l1x commented on August 20, 2024

Ok. I have added 2nd parameter validators.

PaymentFactory - https://github.com/Markette/GopayInline/blob/9a8be30ba3d160d91f0628a8d62e14d8b58fbb89/src/Api/Entity/PaymentFactory.php#L148-L152

Tests - https://github.com/Markette/GopayInline/blob/9a8be30ba3d160d91f0628a8d62e14d8b58fbb89/tests/cases/unit/Api/Entity/PaymentFactory.phpt#L120-L124

It is backward compatible. Just use create($data, $validators = [])

from gopay-inline.

f3l1x avatar f3l1x commented on August 20, 2024

Please test it on master and I will tag it.

markette/gopay-inline: 1.1.0 should target to master, minimum-stability: dev

"markette/gopay-inline": "~1.1.0@dev"

from gopay-inline.

vojtasvoboda avatar vojtasvoboda commented on August 20, 2024

Thank you, works great!

from gopay-inline.

f3l1x avatar f3l1x commented on August 20, 2024

Great.

from gopay-inline.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.