curl_setopt($ch, CURLOPT_URL, API_URL); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data_post)); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_TIMEOUT, 30); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); $response = curl_exec($ch); curl_close($ch); $result = json_decode($response, true); } $_SESSION['transactions'][] = [ 'id' => $request_id, 'telco' => $telco, 'serial' => $serial, 'code' => $code, 'amount' => $amount, 'status' => 'pending', 'date' => date('Y-m-d H:i') ]; if (isset($result['status']) && ($result['status'] == 1 || $result['status'] == 99)) { echo json_encode(['status' => 'success', 'message' => 'Đã kết nối và đẩy thẻ lên Card9s thành công!']); } else { $err_msg = json_encode($result, JSON_UNESCAPED_UNICODE); echo json_encode(['status' => 'error', 'message' => 'Phản hồi từ Card9s: ' . $err_msg]); } exit; } ?> 'amount' => $amount, 'status' => 'pending', 'date' => date('Y-m-d H:i') ]; // Xử lý phản hồi từ Card9s if (isset($result['status']) && ($result['status'] == 1 || $result['status'] == 99 || $result['status'] == 'success')) { echo json_encode(['status' => 'success', 'message' => 'Gửi thẻ lên Card9s thành công! Đang xử lý tự động.']); } else { // Trả về thông báo lỗi chi tiết từ Card9s (Ví dụ: lang.invalid_card_code) $err_msg = json_encode($result, JSON_UNESCAPED_UNICODE); echo json_encode(['status' => 'error', 'message' => 'Phản hồi từ Card9s: ' . $err_msg]); } exit; } ?> Hệ Thống Đổi Thẻ Toàn Diện — APIDOITHE.COM
GIAO DIỆN ĐỒNG BỘ TRỰC TIẾP CARD9S

PHASE 3: ĐỔI THẺ CÀO ĐẤU NỐI KẾT NỐI API CARD9S