break; case 'cancelation': switch ($payi->detail['invoice_order_type']) { case 'S': //CANCELATION ONLY GENERATES FOR PAYMENT TYPE Lastschrift/Bankeinzug/DirectDebit //UNTIL NOW >> 17June2011 OTTO.DE ONLY USE Invoice/Rechnung/BankTransfer AND PREPAYMENT $response = ""; break; case 'J': /*NOTE: * notification email already sent by payone, also change bankeinzug (direct debit) method become banktransfer */ //RESET BACK TO UNPAID STATUS //old logic >> $amount_bank_fines = round(($payi->detail['invoice_amount'] - $request['balance']) * 100); $amount_bank_fines = round(($request['balance'] - $payi->getBalance()) * 100); $payi->bankFinesAmount($amount_bank_fines / 100 * -1); $payi->updatePaidAmount(0); $payi->updateCompleteStatus('A'); use_class("orders"); $class_o = new orders(); $orders_id = $payi->detail['invoice_order_id']; $class_o->updatePaymentStatus($orders_id, '2', 'auto-set'); //cancelpaid because of withdrawal back $payi->payoneSaldo($request['balance']); $data = array(); $data['orders_id'] = $orders_id; $data['date_withdrawal'] = $tx_time; $data['description'] = 'cancelation'; //$data['additional_charge'] = ($amount_bank_fines/100)*-1; $data['additional_charge'] = $payi->detail['invoice_amount_bank_fines'] / 100 * -1; $data['repayment_amount'] = $request['balance'];