~singpolyma/jmp-pay

b82226b61c5df1565d40f0caddb9e1418e664d57 — Stephen Paul Weber 3 years ago 1f738ae
Always a bonus, maybe of 0
1 files changed, 2 insertions(+), 2 deletions(-)

M bin/process_pending_btc_transactions
M bin/process_pending_btc_transactions => bin/process_pending_btc_transactions +2 -2
@@ 214,7 214,7 @@ class Customer

	def add_btc_credit(txid, btc_amount, fiat_amount)
		return unless add_transaction(txid, fiat_amount, "Bitcoin payment")
		if (bonus = plan.bonus_for(fiat_amount))
		if (bonus = plan.bonus_for(fiat_amount)) > 0
			add_transaction("bonus_for_#{txid}", bonus, "Bitcoin payment bonus")
		end
		notify_btc_credit(txid, btc_amount, fiat_amount, bonus)


@@ 225,7 225,7 @@ class Customer
		notify([
			"Your Bitcoin transaction of #{btc_amount.to_s('F')} BTC ",
			"has been added as $#{'%.4f' % fiat_amount} (#{plan.currency}) ",
			("+ $#{'%.4f' % bonus} bonus " if bonus),
			("+ $#{'%.4f' % bonus} bonus " if bonus > 0),
			"to your account.\n(txhash: #{tx_hash})"
		].compact.join)
	end