Skip to content

_payTo : refund user if the transaction failed. #79

Closed
wants to merge 2 commits into from

3 participants

@roblabla

In function _payTo, if the collector fails to collect the amount then the player should be refunded (to avoid having money vanishing into thin air).

roblabla added some commits Jan 17, 2013
@roblabla roblabla _payTo : refund user if the transaction failed.
In function _payTo, if the collector fails to collect the amount,
then the payer should be refunded and the transaction marked as failed.
9ce36ca
@roblabla roblabla If transaction failed leave transfer as successful
If I don't leave the transaction as successful, Residents will be kicked out of their town because the town can't receive the payment.
e41ac10
@jastice jastice referenced this pull request in MinecraftWars/Gringotts Jan 30, 2013
Closed

Please allow /town deposit to work #47

@coaster3000 coaster3000 commented on the diff Jan 2, 2014
...lmergames/bukkit/towny/object/TownyEconomyObject.java
@@ -94,7 +94,10 @@ public boolean payTo(double amount, TownyEconomyObject collector, String reason)
private boolean _payTo(double amount, TownyEconomyObject collector) throws EconomyException {
if (_pay(amount)) {
- collector._collect(amount);
+ if (collector._collect(amount)) {
@coaster3000
coaster3000 added a note Jan 2, 2014

This is working in reverse...

It should technically also return false for failing the transaction.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@ElgarL
Owner
ElgarL commented Jul 1, 2014

Merged #116

@ElgarL ElgarL closed this Jul 1, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.