Masspay не может оплатить
Я получаю следующую ошибку, когда пытаюсь отправить деньги с помощью API Masspay через бэкэнд моего сайта: "Неверный ввод на сервер MassPay. Убедитесь, что вы используете правильно отформатированный ввод. Masspay не завершен"
В результате деньги не переводятся.
Это происходит только тогда, когда сумма имеет десятичные цифры. Например 4,25€. ЭТОГО НЕ происходит, когда я пытаюсь отправить не десятичные суммы, например 10€, 20€ или другие.
Что происходит?
Спасибо
1 ответ
if (!empty($userCashWithdrawalId) &&!empty($cash_withdraw)) {
$data['Transaction']['user_id'] = ConstUserIds::Admin;
$data['Transaction']['foreign_id'] = $cash_withdraw['UserCashWithdrawal']['user_id'];
$data['Transaction']['class'] = 'SecondUser';
$data['Transaction']['amount'] = $cash_withdraw['UserCashWithdrawal']['amount'];
$data['Transaction']['description'] = 'User cash withdrawal request approved by admin';
$data['Transaction']['transaction_type_id'] = ConstTransactionTypes::AdminApprovedWithdrawalRequest;
$this->UserCashWithdrawal->User->Transaction->log($data);
$transaction_id = $this->UserCashWithdrawal->User->Transaction->getLastInsertId();
$data = array();
$data['Transaction']['user_id'] = $cash_withdraw['UserCashWithdrawal']['user_id'];
$data['Transaction']['foreign_id'] = ConstUserIds::Admin;
$data['Transaction']['class'] = 'SecondUser';
$data['Transaction']['amount'] = $cash_withdraw['UserCashWithdrawal']['amount'];
$data['Transaction']['description'] = 'User cash withdrawal request approved by admin';
$data['Transaction']['transaction_type_id'] = ConstTransactionTypes::AmountApprovedForUserCashWithdrawalRequest;
$this->UserCashWithdrawal->User->Transaction->log($data);
// update log transaction id
$paypal_log_array = array();
$paypal_log_array['PaypalTransactionLog']['id'] = $status['paypal_log_list'][$userCashWithdrawalId];
$paypal_log_array['PaypalTransactionLog']['transaction_id'] = $transaction_id;
$this->loadModel('PaypalTransactionLog');
$this->PaypalTransactionLog->save($paypal_log_array);
// update status
$user_cash_data = array();
$user_cash_data['UserCashWithdrawal']['id'] = $userCashWithdrawalId;
$user_cash_data['UserCashWithdrawal']['withdrawal_status_id'] = ConstWithdrawalStatus::Approved;
$this->UserCashWithdrawal->save($user_cash_data);
}
}
$messageType = 'success';
$flash_message = __l('Mass payment request is submitted in Paypal. User will be paid once process completed.');
} **else {
$user_count = count($status['paypal_log_list']);
$flash_message = '';
for ($i = 0; $i < $user_count; $i++) {
if (!empty($status['paypal_response']['L_LONGMESSAGE' . $i])) {
$flash_message.= urldecode($status['paypal_response']['L_LONGMESSAGE' . $i]) . ' , ';
}
}
$messageType = 'error';
$flash_message.= __l(' Masspay not completed');**