Comments (10)
Diky za upozorneni, zkusim doimplementovat ruseni opakovanych a predautorizovanych plateb.
from gopay.
Muzes zkusit prosim tento kod?
https://github.com/Markette/Gopay/blob/master/src/Gopay/Service/RecurrentPaymentService.php#L80-L98
from gopay.
@f3l1x
Vďaka za rýchly fix! cancelRecurrent()
funguje správne aj na strane GoPay, 👍 ale samotná metóda cancelRecurrent()
nevracia žiadnu hodnotu (vždy vráti NULL
). Asi by bolo fajn, keby vrátila aspoň boolean. :)
EDIT: GoPay dokonca klientovi pošle notifikačný mail o zrušení recurrent platby.
from gopay.
Muzu tam vracet return TRUE
jestli to pomuze, protoze ani oficialni GoPay API nic nevraci.
https://github.com/Markette/GopayApi/blob/master/src/GopaySoap.php#L852-L910
Takhle se to bud provede nebo se vyhodi vyjimka. Stejne by jsi ji mel nejspis odchytavat.
from gopay.
Výnimky si odchytávam, ale z nejakého dôvodu mi to nikdy nehodilo CALL_RESULT_ACCEPTED výnimku a tak som netušil že čo sa deje...či to prešlo, neprešlo, alebo čo.
Mňa len v prvej chvíli napadlo niečo takéto. Možno by to bolo handy.
public function cancelRecurrent($paymentSessionId)
{
try {
$this->gopay->soap->voidRecurrentPayment(
$paymentSessionId,
$this->gopay->config->getGopayId(),
$this->gopay->config->getGopaySecretKey()
);
} catch (Exception $e) {
if ($e->getMessage() !== GopayHelper::CALL_RESULT_ACCEPTED) {
throw new GopayException($e->getMessage(), 0, $e);
}
return TRUE;
}
}`
from gopay.
Uff no, uplne se mi to nelibi. :-)
To return true by se melo vracet pokazde kdyz se nevyhodi vyjimka, takze mimo try/catch block nejspis. Ale rikam si k cemu mi to bude.
Kdybych to pouzival, tak bych mel nejspis takovyhle zapis.
try{
$service->cancelRecurrent($paymentSessionId);
$this->processSuccessCanceling();
} catch (GopayException $e) {
$this->processInvalidCanceling();
}
Tzn, ze return true vubec nevyuziju. Urcite si muzes podedit RecurrentPaymentService
a obalit si to do vlastni.
Slo by to?
from gopay.
Lol, vôbec ma nenapadlo si RecurrentPaymentService
podediť. :))
Tak okej teda, takto to ako to je to bude hádam stačiť.
Vďaka!
from gopay.
Neni zac. :-)
Melo by to jit takto.
extensions:
gopay: Markette\Gopay\DI\Extension
services:
gopay.service.payment: MyPaymentService
gopay.service.recurrentPayment: MyRecurrentPaymentService
gopay.service.preAuthorizedPayment: MyPreAuthorizedPaymentService
Pokud by jsi to chtel vyuzivat jako do ted. :-)
PS: Muzeme to oznacit jako uzavrene? Vydal bych novou verzi 3.0.1 a pak take 3.1.0 s podporou Nette 2.4 a dropnutim PHP 5.5.
from gopay.
U mně dobrý. :) Môžeme to podľa mňa zatvoriť.
from gopay.
@MaRmARk0 Diky moc za pomoc. :-)
from gopay.
Related Issues (20)
- Bump 2.3 HOT 1
- [stable] v3.0.0 HOT 1
- Tracy - tracking panel
- How to set SK lang HOT 8
- EET support HOT 7
- Ambiguous class App\Model\ShopModel resolution HOT 2
- https://testgw.gopay.cz ssl certificate expired HOT 11
- Move to PHP 7.1 HOT 6
- Dependencies - move nette to optional dependencies HOT 1
- ID objednavky muze byt string (nyni jen int) HOT 1
- Update readme
- Remove Nette\Object HOT 5
- Bitcoin platby HOT 4
- Movement ID, additional_params, is there a way how to set?
- Nette 3.0 HOT 1
- Contributte style docs folder
- Nastavení notification_url HOT 1
- Failing tests HOT 1
- trim(): Passing null to parameter #1 ($string) of type string is deprecated
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gopay.