_payTo : refund user if the transaction failed. #79

Closed
wants to merge 2 commits into
from

Conversation

Projects
None yet
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

_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.
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.

@jastice jastice referenced this pull request in MinecraftWars/Gringotts Jan 30, 2013

Closed

Please allow /town deposit to work #47

@@ -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)) {

This comment has been minimized.

@coaster3000

coaster3000 Jan 2, 2014

Contributor

This is working in reverse...

It should technically also return false for failing the transaction.

@coaster3000

coaster3000 Jan 2, 2014

Contributor

This is working in reverse...

It should technically also return false for failing the transaction.

@ElgarL

This comment has been minimized.

Show comment
Hide comment
@ElgarL

ElgarL Jul 1, 2014

Owner

Merged #116

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