pixidos / gpwebpay-core Goto Github PK
View Code? Open in Web Editor NEWLibrary for GPWebPay HTTP API
Home Page: https://gpwebpay-core.readthedocs.io/en/latest/
Library for GPWebPay HTTP API
Home Page: https://gpwebpay-core.readthedocs.io/en/latest/
Getting this error in my environment. This is the method I use:
/**
* @param $order_id
* @param $amount
*
* @return string
* @throws \Pixidos\GPWebPay\Exceptions\InvalidArgumentException
* @throws \Pixidos\GPWebPay\Exceptions\SignerException
*/
public function get_payment_url( $order_id, $amount ) {
$operation = new Operation(
new OrderNumber( $order_id ),
new Amount( $amount ),
new Currency( \Pixidos\GPWebPay\Enum\Currency::CZK() )
);
$request = $this->get_request_factory()->create( $operation );
return $request->getRequestUrl();
}
Any idea how to fix this? This happens only on one of my test environments for some reason, works fine on another staging.
Thanks!
Is it planned to add the APAY method? Thank You
How about PSD2? When will be implemented?
https://www.globalpayments.cz/cs-cz/blog/2021/01/26/psd2-addinfo
Default use of Amount
is imprecise and generates incorrect transaction orders. I forked the repo and added failing test to a new branch imprecise-amount
(https://github.com/robskr/gpwebpay-core/tree/imprecise-amount).
I don't see how this can be fixed without either requiring ext-bcmath
or leaving user code to provide actual precise amount (non-float and already converted to cents).
So I'd suggest deprecating option to pass non-cents amounts (basically to avoid multiplying float) and removing it in next version. Introducing Amount interface and e. g. PreciseAmount
or CentsAmount
class to avoid BC break is also a possibility, but that seems like too much hassle just to preserve broken functionality. Nevertheless, I think BC break is more than justified here and maybe it would even be more sensible to just release new major version with changed constructor:
public function __construct(int $amount);
I'm indeed willing to help with the fix, just need to know the preferred way to fix it. Actually here's a draft with the changed constructor 👉 https://github.com/robskr/gpwebpay-core/tree/imprecise-amount-fix so I can make a PR right away.
In our project, we need to work with SHA256 (for security reasons).
There is a call of the openssl_sign
function here: https://github.com/Pixidos/gpwebpay-core/blob/master/src/Signer/Signer.php#L56, but there is no way how to provide the fourth argument that determines the algorithm used.
Is there a change that the API will be extended or should I send a pull request?
Thank you very much,
Vojtěch
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.