Git Product home page Git Product logo

contributte / gopay-inline Goto Github PK

View Code? Open in Web Editor NEW
32.0 5.0 32.0 256 KB

:credit_card: GoPay Inline Payment for Nette Framework

Home Page: https://contributte.org/packages/contributte/gopay-inline.html

License: BSD 3-Clause "New" or "Revised" License

JavaScript 0.15% PHP 99.07% Shell 0.07% Batchfile 0.10% Makefile 0.60%
gopay ecommerce api nette payments markette curl gopay-inline contributte

gopay-inline's Introduction

Website 🚀 contributte.org | Contact 👨🏻‍💻 f3l1x.io | Twitter 🐦 @contributte

Usage

To install the latest version of contributte/gopay-inline use Composer.

composer require markette/gopay-inline

Documentation

For details on how to use this package, check out our documentation.

Versions

State Version Branch Nette PHP
dev ^2.2 master 2.4 / ^3.0 ^7.3
stable ^2.1 master 2.4 / ^3.0 ^7.2

Development

See how to contribute to this package.

This package is currently maintaining by these authors.


Consider to support contributte development team. Also thank you for using this package.

gopay-inline's People

Contributors

bohacf avatar daihousl avatar f3l1x avatar grogy avatar haltuf avatar hermajan avatar jakubsedlarik avatar janbarasek avatar janhrivnak avatar josefzajac avatar kotmic avatar martinknor avatar michaeltichy222 avatar paveljurasek avatar pepa-linha avatar petrhudik avatar petrparolek avatar premekkoch avatar trsak avatar vody105 avatar vojtasvoboda avatar zeddosx avatar zelenomodrypes avatar zingon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

gopay-inline's Issues

Wrong installation instructions in README

Spent more time than I'd be willing to admit on this.

There is a wrong info in README.md regarding the installation:

composer require contributte/gopay-inline

Packagist does not know such a package, but the error given by composer is not very helpful:

Could not find a matching version of package contributte/gopay-inline. Check the package spelling, your version constraint and that the package is available in a stability which matches your minimum-stability (stable).

Finally, I've noticed the correct installation command is:

composer require markette/gopay-inline

Documentation has it right, it's just the README that's incorrect.

Cents rounding

It is not issue, but I don't now how to solve when I have negative cents rounding (in czech "Haléřové vyrovnání"). Because it's not possible to send negative value to gateway.

Eshop owner don't want to turn off cents rounding for payment by card.

When I try to add product with price -0,30 Kč:

snimek obrazovky 2015-12-15 v 22 13 10

Guys, any idea?

Argument $data in PaymentFactory::create() should be regular entity

Hello,

I think the argument $data in PaymentFactory::create() should be Entity because when I upgrade this package to a new version, it can make BC break.

Real log:

Snímek obrazovky 2020-10-11 v 9 38 47

This error can not be inspected by PhpStan, because array is too common a data type.

If it make sense I can send PR.

Thanks.

Payment price validation of an multi-item

There should be total price of items in an payment.items.amount according to the GoPay documentation. For the example we have an item ITEM1 with price 50, so I'd created the following array
$paymen = [ ...,
'amount' => \Money\Money::CZK(100),
'items' => [ [ 'name' => 'ITEM1', count => 2, 'amount' => \Money\Money::CZK(100) ] ]
]

In this example the following validation error raises "Payment price (100) and items price (200) do not match".
I think this package counts with item's amount only for 1 piece.

Wrong type used for price amounts

Payment uses float to store the amount, which is a rather unfortunate choice. How about using amount in cents as integer, or string or proper money object, because even integers are vulnerable to e.g. overflowing (in theory, that is)?

Btw GoPay docs says to send amounts in cents, but this package seems to expect crowns, which is not really documented. I was surprised when the gateway asked for 50k when I just wanted five hundred 😄

How to create signature?

Hi,
according to the gopay documentation, it goes this way.

$encryptedSignature = GopayHelper::encrypt(
                      GopayHelper::hash(
                      GopayHelper::concatPaymentCommand($targetGoId,
                                                        $paymentSessionId,
                                                        $secureKey)
                                                     ), $secureKey);	

But the data that my response returns is

'id' => 3156614799
'order_number' => 'INF252'
'state' => 'CREATED'
'amount' => 605
'currency' => 'CZK'
'payer' => stdClass
'target' => stdClass
'recurrence' => stdClass
'additional_params' => array
'lang' => 'cs'
'gw_url' => 'https://gw.sandbox.gopay.com/gw/v3/4e26c514484f8c7fd08f45177aa503c4'

So what is the procedure for creating a signature? Because I didn't find any solution anywhere.

Thx

RecurrentPayment configuration not compatible with Payment (callback parameter)

Payment requires callback key with return_url and notify_url.
RecurrentPayment on the other hand does not allow callback key at all and is therefore incompatible.

I believe that correct configuration for both payment types should look like:

$payment = [
    .....
    'callback' => [
        'return_url' => 'http://www.myeshop.cz/api/gopay/return',
        'notify_url' => 'http://www.myeshop.cz/api/gopay/notify',
    ],
    .....
]

Contributte style

  • move docs to .docs folder
  • create makefile
  • apply phpstan
  • apply coding standards

prev: #50

Nette 3 support

Are there any plans to support Nette 3?

Right now, there is a depreciation warning when used with Nette 3.

PHP User Deprecated: Service gopay.client: Nette\DI\Definitions\ServiceDefinition::setClass() second parameter $args is deprecated, use setFactory() in .../src/DI/Definitions/ServiceDefinition.php:47

vatRate a type je NULL u items při použití PaymentFactory

Pokud pro vytvoření objektu Markette\GopayInline\Api\Entity\Payment použiji PaymentFactory a v poli itemu definuji klíče vat_rate a type, ve výsledném objektu budou mít hodnotu NULL.

Rychlou analýzou odhaduji, že problém je v PaymentFactory na ř. 132 v chybné definici mapovacího pole. Pokusím se opravit.

Contributte

  • change namespace
  • change badge URL
  • apply contributte's codesniffer/phpstan/
  • min PHP 7.2 (just idea)

EET je NULL

Při nastavení klíče $payment['eet'] podle README.md a následném zavolání funkce

PaymentFactory::create($payment)

je vytvořen objekt Markette\GopayInline\Api\Entity\Payment

Ten má hodnotu atributu ["eet":protected]=>NULL

Rychlý odhad: v PaymentFactory.php chybí setter pro objekt eet, jdu se pustit do podrobnější analýzy.

Auto update authorization token after expiration.

Hi,

authorization token is valid only 30 minutes and after that it throws exception. I tried to find any method like $client->reAuthenticate() or something like that but it doesn't exists. Or maybe put any auto revalidation before expiration. (this issue is made from slack conversation on PéHáPkaři).

Thank you.

Contributte standardise

EET účtenky platby

Potřeboval bych rozšířit funkčnost o podporu volání této API funkce:
https://doc.gopay.com/cs/#eet-%C3%BA%C4%8Dtenky-platby

Funkce vrátí seznam všech EET účtenek k dané platbě.

Při refundaci platby přes API totiž notifikace o refundaci obsahuje EET kódy k původní platbě (podle podpory Gopay feature, nikoliv bug) a automatický email, který jde zákazníkovi, žádné EET kódy neobsahuje! (opět ověřeno na podpoře)

Je přitom povinností poplatníka kódy zákazníkovi sdělit i v případě stornované platby, jak vyplývá z § 7, zákona č. 112/2016 Sb.

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.