Keep Getting Refunding Fail Message #5191

This commit is contained in:
Pererinha 2015-03-31 14:07:10 -03:00
parent 15f31776b3
commit 39a1a6da99

View File

@ -2327,7 +2327,7 @@ class Crunchbutton_Order extends Crunchbutton_Order_Trackchange {
try {
// refund the debit
// See #5191
$amount = $this->calcFinalPriceMinusUsersCredit();
$amount = $this->charged();
$amount = floatval( number_format( $amount, 2 ) );
$amount = intval( $amount * 100 );
$ch = Crunchbutton_Balanced_Debit::byId( $this->txn );
@ -2371,6 +2371,12 @@ class Crunchbutton_Order extends Crunchbutton_Order_Trackchange {
try {
// cancel the hold
$hold = Crunchbutton_Balanced_CardHold::byOrder($this);
Log::debug([
'order' => $this->id_order,
'action' => 'cancel hold',
'status' => 'trying to cancel hold',
'amount' => $amount
]);
if ($hold) {
$res = $hold->void();
}